Viewing File: /usr/local/cpanel/base/frontend/jupiter/filemanager/editors/image_browser_include.html.tt
[%
USE JSON;
SET account_locale = locale.get_user_locale(), #The account's locale name, in the session locale.
direction = locale.get_html_dir_attr(),
lang_file_path_debug = "../../libraries/elfinder/source/js/i18n/elfinder." _ account_locale _ ".js",
supported_file_browser_locales = ["ar", "bg", "ca", "cs", "de", "es", "fr", "hu", "jp", "LANG", "nl", "no", "pl", "pt_BR", "ru", "zh_CH"],
use_locale = "false",
lang_file_path = "../../libraries/elfinder/js/i18n/elfinder." _ account_locale _ ".js",
security_token = CPANEL.ENV.cp_security_token;
# If locale is not found, fallback to English
FOREACH locale IN supported_file_browser_locales;
IF account_locale == locale;
use_locale = "true";
BREAK;
END;
END;
%]
<!--
DO NOT REORDER THE CSS!!! It is setup in a fallback order that allows the cpanel specific
elfinder customizations to work correctly to override those provided elfinder.
-->
<!-- elFinder CSS (REQUIRED) -->
<link rel="stylesheet" type="text/css" href="[% MagicRevision('../../libraries/jquery-ui/current/jquery-ui.min.css') %]">
<link rel="stylesheet" type="text/css" href="[% MagicRevision('../../libraries/elfinder/css/elfinder.min.css') %]">
<link rel="stylesheet" type="text/css" href="[% MagicRevision('../../libraries/elfinder/css/theme.css') %]">
<link rel="stylesheet" type="text/css" href="[% MagicRevision('../../elfinder_dependencies/css/elfinder.css') %]">
<!-- jQuery and jQuery UI (REQUIRED) -->
[% IF CPANEL.is_debug_mode_enabled() %]
<script type="text/javascript" src="[% MagicRevision('../../libraries/jquery/current/jquery.js') %]"></script>
<script type="text/javascript" src="[% MagicRevision('../../libraries/jquery-ui/current/jquery-ui.js')%]"></script>
<script type="text/javascript" src="[% MagicRevision('../../libraries/elfinder/js/elfinder.full.js') %]"></script>
[% IF use_locale == "true" %]
<script type="text/javascript" src="[% MagicRevision(lang_file_path_debug) %]"></script>
[% END %]
[% ELSE %]
<script type="text/javascript" src="[% MagicRevision('../../libraries/jquery/current/jquery.min.js') %]"></script>
<script type="text/javascript" src="[% MagicRevision('../../libraries/jquery-ui/current/jquery-ui.min.js')%]"></script>
<script type="text/javascript" src="[% MagicRevision('../../libraries/elfinder/js/elfinder.min.js') %]"></script>
[% IF use_locale == "true" %]
<script type="text/javascript" src="[% MagicRevision(lang_file_path) %]"></script>
[% END %]
[% END %]
<!-- elFinder Container -->
<div id="elfinder">
</div>
<script type="text/javascript" charset="utf-8">
(function() {
/**
* Helper method to get URL parameters
*
* @method getUrlParam
* @param String paramName name of the parameter
* @return string
*/
function getUrlParam(paramName)
{
var reParam = new RegExp("(?:[\?&]|&)" + paramName + "=([^&]+)", "i") ;
var match = window.location.search.match(reParam) ;
return (match && match.length > 1) ? match[1] : "" ;
}
// ondomready
$().ready(function() {
var funcNum = getUrlParam("CKEditorFuncNum");
var dir = decodeURIComponent(getUrlParam("dir"));
var baseURL = decodeURIComponent(getUrlParam("url"));
var dirPath = decodeURIComponent(getUrlParam("dirPath"));
var encodedURLForConnector = "[% security_token %]" + "/backend/elfinder_connector.cgi?dir=" + encodeURIComponent(dir) + "&dirPath=" + encodeURIComponent(dirPath);
var config = {
url : encodedURLForConnector,
lang: "[% account_locale %]",
height: "530",
onlyMimes: ["image"],
uiOptions : {
// toolbar configuration
toolbar : [
["back", "forward"],
["info"],
["search"]
],
// directories tree options
tree : {
// expand current root on init
openRootOnLoad : true,
// auto load current dir parents
syncTree : true
},
// navbar options
navbar : {
minWidth : 150,
maxWidth : 500
},
// current working directory options
cwd : {
// display parent directory in listing as ".."
oldSchool : false
}
},
contextmenu : {
// navbarfolder menu
navbar : ["open", "|", "info"],
// current directory menu
cwd : ["reload", "back", "|", "info"],
// current directory file menu
files : [
"getfile", "|", "open", "|", "info"
]
},
/**
* callback method after a file has been selected in elfinder
*
* @method getFileCallback
* @param String file filepath
*/
getFileCallback : function(file) {
var path = file.path.replace(/^(public_html)/,"");
var fileURL = decodeURIComponent(path);
window.opener.CKEDITOR.tools.callFunction(funcNum, fileURL);
window.close();
},
resizable: true
};
var elf = $("#elfinder").elfinder(config).elfinder("instance");
});
})();
</script>
Back to Directory
File Manager