Example #1
0
<?php

$CMS_ADMIN_PAGE = 1;
$path = dirname(dirname(dirname(__FILE__)));
require_once $path . DIRECTORY_SEPARATOR . 'include.php';
$urlext = get_secure_param();
check_login();
$userid = get_userid();
$config =& $gCms->GetConfig();
$modules =& $gCms->modules;
$tiny = $modules["TinyMCE"]['object'];
$tiny->curlang = get_preference($userid, 'default_cms_language');
$filepickerstyle = $tiny->GetPreference("filepickerstyle", "both");
$tiny->smarty->assign("filepickerstyle", $filepickerstyle);
$tiny->smarty->assign("rooturl", $config["root_url"]);
$tiny->smarty->assign("admindir", $config["admin_dir"]);
$tiny->smarty->assign("filepickertitle", $tiny->Lang("filepickertitle"));
$tiny->smarty->assign("youareintext", $tiny->Lang("youareintext"));
$rootpath = "";
$rooturl = "";
if ($_GET["type"] == "image") {
    $rootpath = $config["image_uploads_path"];
    $rooturl = $config["image_uploads_url"];
    $tiny->smarty->assign("isimage", "1");
} else {
    $rootpath = $config["uploads_path"];
    $rooturl = $config["uploads_url"];
    $tiny->smarty->assign("isimage", "0");
}
if (!$tiny->CheckPermission('allowadvancedprofile')) {
    if ($tiny->GetPreference("restrictdirs", 0) == 1) {
Example #2
0
 function GenerateConfig($frontend = false, $templateid = "", $languageid = "")
 {
     $result = "";
     $result .= $this->GetCustomDropDown();
     $result .= $this->GetCMSLinker();
     $config = $this->GetConfig();
     $urlext = '?';
     if ($frontend) {
         $this->smarty->assign("isfrontend", "true");
     } else {
         $urlext = get_secure_param();
         $this->smarty->assign("isfrontend", "false");
     }
     if ($this->GetPreference("startenabled", "1") == "1") {
         $this->smarty->assign("startupmode", "exact");
     } else {
         $this->smarty->assign("startupmode", "none");
     }
     if (isset($_SESSION['tiny_live_textareas'])) {
         $this->smarty->assign("textareas", $_SESSION["tiny_live_textareas"]);
     }
     $this->smarty->assign("css", $config['root_url'] . "/modules/TinyMCE/stylesheet.php?templateid=" . $templateid . "&amp;mediatype=screen&amp;bogus=" . time());
     $this->smarty->assign("rooturl", $config["root_url"]);
     $this->smarty->assign("encoding", $this->GetPreference('entityencoding', 'raw'));
     $this->smarty->assign("skin", $this->GetPreference('skin', 'default'));
     $this->smarty->assign("skinvariation", $this->GetPreference('skinvariation', ''));
     $this->smarty->assign("allowresizing", $this->GetPreference('allowresizing', 'none'));
     $plugins = $this->GetPreference('plugins', $this->plugins_default_enabled);
     if ($this->GetPreference("allow_tables", "0") == "1" || $this->GetPreference("advanced_allow_tables", "0") == "1" || $this->GetPreference("front_allow_tables", "0") == "1") {
         $plugins .= ",table";
     }
     // Add module plugins
     $all_module_plugins = $this->GetModulePlugins();
     $module_plugins_available = $this->GetPreference('module_plugins', '');
     $module_pluginsarray = explode(',', $module_plugins_available);
     $module_plugins = '';
     if (count($all_module_plugins) > 0) {
         foreach ($all_module_plugins as $onemodule) {
             foreach ($onemodule as $oneplugin) {
                 if (in_array($oneplugin[0], $module_pluginsarray)) {
                     $module_plugins .= ",-" . $oneplugin[0];
                     $result .= "{$oneplugin['1']}\n\ntinymce.PluginManager.add('{$oneplugin['0']}', tinymce.plugins.{$oneplugin['0']});\n\n";
                 }
             }
         }
     }
     $this->smarty->assign("urlext", $urlext);
     $this->smarty->assign("plugins", $plugins);
     $this->smarty->assign("module_plugins", $module_plugins);
     if ($this->GetPreference("forcecleanpaste", "1") == "1") {
         $this->smarty->assign("pasteautoclean", "true");
     }
     if ($frontend) {
         $toolbar = 1;
         if ($this->GetPreference('front_toolbar1') != '') {
             $this->smarty->assign("toolbar" . $toolbar, $this->GetPreference('front_toolbar1'));
             $toolbar++;
         }
         if ($this->GetPreference('front_toolbar2') != '') {
             $this->smarty->assign("toolbar" . $toolbar, $this->GetPreference('front_toolbar2'));
             $toolbar++;
         }
         if ($this->GetPreference('front_toolbar3') != '') {
             $this->smarty->assign("toolbar" . $toolbar, $this->GetPreference('front_toolbar3'));
             $toolbar++;
         }
         if ($this->GetPreference("front_allow_tables", "0") == "1") {
             $this->smarty->assign("toolbar" . $toolbar, "tablecontrols");
         }
     } else {
         if ($this->CheckPermission('allowadvancedprofile')) {
             $toolbar = 1;
             if ($this->GetPreference('advanced_toolbar1') != '') {
                 $this->smarty->assign("toolbar" . $toolbar, $this->GetPreference('advanced_toolbar1'));
                 $toolbar++;
             }
             if ($this->GetPreference('advanced_toolbar2') != '') {
                 $this->smarty->assign("toolbar" . $toolbar, $this->GetPreference('advanced_toolbar2'));
                 $toolbar++;
             }
             if ($this->GetPreference('advanced_toolbar3') != '') {
                 $this->smarty->assign("toolbar" . $toolbar, $this->GetPreference('advanced_toolbar3'));
                 $toolbar++;
             }
             if ($this->GetPreference("advanced_allow_tables", "0") == "1") {
                 $this->smarty->assign("toolbar" . $toolbar, "tablecontrols");
             }
         } else {
             $toolbar = 1;
             if ($this->GetPreference('toolbar1') != '') {
                 $this->smarty->assign("toolbar" . $toolbar, $this->GetPreference('toolbar1'));
                 $toolbar++;
             }
             if ($this->GetPreference('toolbar2') != '') {
                 $this->smarty->assign("toolbar" . $toolbar, $this->GetPreference('toolbar2'));
                 $toolbar++;
             }
             if ($this->GetPreference('toolbar3') != '') {
                 $this->smarty->assign("toolbar" . $toolbar, $this->GetPreference('toolbar3'));
                 $toolbar++;
             }
             if ($this->GetPreference("allow_tables", "0") == "1") {
                 $this->smarty->assign("toolbar" . $toolbar, "tablecontrols");
             }
         }
     }
     $this->smarty->assign("blockformats", $this->GetPreference("dropdownblockformats", "p,div,h1,h2,h3,h4,h5,h6,div,blockquote,dt,dd,code,samp"));
     if ($this->GetPreference("relativeurls", 1) == 1) {
         $this->smarty->assign("relativeurls", "true");
     } else {
         $this->smarty->assign("relativeurls", "false");
     }
     $this->smarty->assign("language", $languageid);
     if ($this->GetPreference('source_formatting', 1) == 1) {
         $this->smarty->assign("sourceformatting", "true");
     } else {
         $this->smarty->assign("sourceformatting", "false");
     }
     if ($this->GetPreference('show_path', 1) == 1) {
         $this->smarty->assign("showpath", "1");
     }
     $this->smarty->assign("editorwidth", "");
     if ($this->GetPreference("editor_width_auto", 1) != 1) {
         $this->smarty->assign("editorwidth", "'" . $this->GetPreference("editor_width") . $this->GetPreference("editor_width_unit") . "'");
     }
     $this->smarty->assign("editorheight", "");
     if ($this->GetPreference("editor_height_auto", 1) != 1) {
         $this->smarty->assign("editorheight", "'" . $this->GetPreference("editor_height") . $this->GetPreference("editor_height_unit") . "'");
     }
     if ($this->GetPreference("newlinestyle", "p") != "p") {
         $this->smarty->assign("force_br_newlines", "true");
         $this->smarty->assign("force_p_newlines", "false");
     } else {
         $this->smarty->assign("force_br_newlines", "false");
         $this->smarty->assign("force_p_newlines", "true");
     }
     if ($this->GetPreference("forcedrootblock", "false") == "false") {
         $this->smarty->assign("forcedrootblock", "false");
     } else {
         $this->smarty->assign("forcedrootblock", "'" . $this->GetPreference("forcedrootblock") . "'");
     }
     $this->smarty->assign("dateformat", $this->GetPreference('dateformat', "%Y-%m-%d"));
     $this->smarty->assign("timeformat", $this->GetPreference('timeformat', "%H:%M:%S"));
     $css_styles = $this->GetPreference('css_styles');
     $css_styles = str_replace("\n", "", $css_styles);
     $css_styles = str_replace("\r", "", $css_styles);
     $this->smarty->assign("css_styles", $css_styles);
     $extraconfig = "";
     if ($this->GetPreference("extraconfig") != "") {
         /* $lines=explode("\n",$this->GetPreference("extraconfig"));
            if (count($lines)>0) {
            $extraconfig="//Extra configuration\n";
            foreach($lines as $line) {
            $line=trim($line);
            //if (substr($line,-1,1)!=",") $line.=",";
            //$line=",".$line;
            $extraconfig.=",".$line."\n";
            }
            } */
         $extraconfig = "//Extra configuration\n";
         $extraconfig .= "," . $this->GetPreference("extraconfig");
     }
     $this->smarty->assign("extraconfig", $extraconfig);
     $this->smarty->assign("filepickertitle", $this->Lang("filepickertitle"));
     $this->smarty->assign("fpwidth", $this->GetPreference("fpwidth", "700"));
     $this->smarty->assign("fpheight", $this->GetPreference("fpheight", "500"));
     $result .= $this->ProcessTemplate('tinyconfig.tpl');
     return $result;
 }