Exemple #1
0
 public static function sysReady()
 {
     if (Themes::getCurrentTheme()->hasInterface()) {
         if (Themes::getCurrentTheme()->hasInterfaceName()) {
             $name = Themes::getCurrentTheme()->getInterfaceName();
         }
         Admin::registerPage('theme-settings', $name ? $name : __('admin', 'theme-settings'), 'ThemeInterface::displayInterface', 2);
     }
 }
Exemple #2
0
    public static function create($name, $initContents)
    {
        $p = self::$plugin;
        queue_css($p->pluginPublicDir() . 'elrte/css/smoothness/jquery-ui-1.8.13.custom.css');
        queue_css($p->pluginPublicDir() . 'elrte/css/elrte.min.css');
        queue_css($p->pluginPublicDir() . 'elfinder/css/elfinder.min.css');
        queue_css($p->pluginPublicDir() . 'elfinder/css/theme.css');
        queue_js($p->pluginPublicDir() . 'elrte/js/jquery-ui-1.8.13.custom.min.js');
        queue_js($p->pluginPublicDir() . 'elrte/js/elrte.full.js');
        queue_js($p->pluginPublicDir() . 'elfinder/js/elfinder.full.js');
        queue_js($p->pluginPublicDir() . 'elrte/js/i18n/elrte.en.js');
        return sprintf(<<<EOT
<script type="text/javascript" charset="utf-8">
\t\$(function() {
\t\tvar opts = {
\t\t\tlang         : 'en',   // set your language
\t\t\tstyleWithCSS : false,
\t\t\theight       : 400,
\t\t\ttoolbar      : 'maxi',
\t\t\tcssfiles     : ['%s'],
\t\t\tfmOpen : function(callback) {
\t\t\t\t\$('<div />').dialogelfinder({
\t\t\t\t\turl : '%selfinder/php/connector.php',
\t\t\t\t\tlang : 'en',
\t\t\t\t\tcommandsOptions : {
\t\t\t\t\t\tgetfile : {
\t\t\t\t\t\t\tonlyURL  : true, // disable to return detail info
\t\t\t\t\t\t\tmultiple : false, // disable to return multiple files info
\t\t\t\t\t\t\tfolders  : false, // disable to return folders info
\t\t\t\t\t\t\toncomplete : 'destroy' // action after callback (""/"close"/"destroy")
\t\t\t\t\t\t}
\t\t\t\t\t},
\t\t\t\t\tgetFileCallback : function (obj) {
\t\t\t\t\t\tcallback(obj.baseUrl + obj.path.substr(obj.path.replace('\\\\', '/').indexOf('/')+1));
\t\t\t\t\t}
\t\t\t\t})
\t\t\t}
\t\t};
\t\t// create editor
\t\t\$('#%s').elrte(opts);

\t\t// or this way
\t\t// var editor = new elRTE(document.getElementById('our-element'), opts);
\t});
</script>
<textarea id="%s">%s</textarea>
EOT
, Themes::getCurrentTheme()->getPublicPath() . "editor.css", $p->pluginPublicDir(), $name, $name, $initContents);
    }