Example #1
0
 function replaceSpecialChars($text, $nochmal_erlauben)
 {
     # $nochmal_erlauben = für Tags mit src z.B. img dann muss das % auch gewandelt werden
     $text = str_replace('/', 'ssslashhh', $text);
     if (preg_match('#\\%([0-9a-f]{2})#i', $text) < 1) {
         $text = mo_rawurlencode(stripslashes($text));
     }
     if ($nochmal_erlauben) {
         $text = mo_rawurlencode(stripslashes($text));
     }
     $text = str_replace('ssslashhh', '/', $text);
     return $text;
 }
Example #2
0
 function get_Description($coded_as = false, $index = false, $group = false)
 {
     if ($index === false) {
         $index = $this->currentIndex;
     }
     if ($group === false) {
         $group = $this->currentGroup;
     }
     $image = $this->MenuArray[$this->currentGallery][$group][$index];
     $description = $this->GalleryArray[$this->currentGallery][$image]['description'];
     if ($description !== false) {
         $description = $this->GalleryArray[$this->currentGallery][$image]['description'];
         if ($coded_as == "html") {
             global $specialchars;
             $description = $specialchars->rebuildSpecialChars($description, false, true);
         } elseif ($coded_as == "url") {
             $description = mo_rawurlencode($description);
         }
         return $description;
     }
     return $description;
 }
Example #3
0
function plugins()
{
    global $ADMIN_CONF;
    global $CatPage;
    global $message;
    global $specialchars;
    global $debug;
    $plugin_manage_open = false;
    # plugins löschen
    if (getRequestValue('plugin-all-del', 'post') and getRequestValue('plugin-del', 'post')) {
        plugin_del();
        $plugin_manage_open = true;
    }
    # hochgeladenes plugin installieren
    if (isset($_FILES["plugin-install-file"]["error"]) and getRequestValue('plugin-install', 'post') and $_FILES["plugin-install-file"]["error"] == 0 and strtolower(substr($_FILES["plugin-install-file"]["name"], -4)) == ".zip") {
        $debug .= "install=" . $_FILES["plugin-install-file"]["name"] . "<br />\n";
        plugin_install();
        $plugin_manage_open = true;
    } elseif ($plugin_select = $specialchars->rebuildSpecialChars(getRequestValue('plugin-install-select', 'post'), false, false) and getRequestValue('plugin-install', 'post') and is_file(PLUGIN_DIR_REL . $specialchars->replaceSpecialChars($plugin_select, false)) !== false and strtolower(substr($plugin_select, -4)) == ".zip") {
        $debug .= "local install=" . getRequestValue('plugin-install-select', 'post') . "<br />\n";
        plugin_install($plugin_select);
        $plugin_manage_open = true;
    }
    $showdebug = false;
    if ($showdebug and !empty($debug)) {
        $message .= returnMessage(false, $debug);
    }
    require_once BASE_DIR_CMS . "Plugin.php";
    if (false !== ($plugin_name = getRequestValue('pluginadmin'))) {
        #,'get'
        if (file_exists(PLUGIN_DIR_REL . $plugin_name)) {
            define("PLUGINADMIN", $plugin_name);
            if (file_exists(PLUGIN_DIR_REL . PLUGINADMIN . "/plugin.conf.php") and file_exists(PLUGIN_DIR_REL . PLUGINADMIN . "/index.php")) {
                require_once PLUGIN_DIR_REL . PLUGINADMIN . "/index.php";
                # Enthält der Code eine Klasse mit dem Namen des Plugins und ist es auch der Dirname?
                if (class_exists(PLUGINADMIN) and in_array(PLUGINADMIN, get_declared_classes())) {
                    # $PLUGIN_ADMIN_ADD_HEAD gibts nur hier und ist für sachen die in den head sollen
                    global $PLUGIN_ADMIN_ADD_HEAD;
                    $PLUGIN_ADMIN_ADD_HEAD = array();
                    $multi_user = "";
                    if (defined('MULTI_USER') and MULTI_USER) {
                        $multi_user = "******";
                    }
                    define("PLUGINADMIN_GET_URL", URL_BASE . ADMIN_DIR_NAME . "/index.php?pluginadmin=" . PLUGINADMIN . "&amp;nojs=true&amp;action=" . ACTION . $multi_user);
                    $plugin = new $plugin_name();
                    $info = $plugin->getInfo();
                    $config = $plugin->getConfig();
                    if (PLUGIN_DIR_REL . $plugin_name . '/' . $config["--admin~~"]["datei_admin"] == PLUGIN_DIR_REL . PLUGINADMIN . "/index.php") {
                        return $plugin->getContent("");
                    } else {
                        return require_once PLUGIN_DIR_REL . $plugin_name . '/' . $config["--admin~~"]["datei_admin"];
                    }
                }
            } else {
                die;
            }
        } else {
            die;
        }
    }
    if (getRequestValue('chanceplugin', 'post') == "true" and false !== ($plugin_name = getRequestValue('plugin_name', 'post'))) {
        if (file_exists(PLUGIN_DIR_REL . $plugin_name) and file_exists(PLUGIN_DIR_REL . $plugin_name . "/plugin.conf.php") and file_exists(PLUGIN_DIR_REL . $plugin_name . "/index.php")) {
            $conf_plugin = new Properties(PLUGIN_DIR_REL . $plugin_name . "/plugin.conf.php");
        } else {
            die("Fatal Error");
        }
        if (false !== ($activ = getRequestValue(array($plugin_name, 'active'), 'post')) and ($activ == "true" or $activ == "false")) {
            $conf_plugin->set("active", $activ);
            ajax_return("success", true);
        } elseif ($conf_plugin->get("active") == "true") {
            require_once PLUGIN_DIR_REL . $plugin_name . "/index.php";
            # Enthält der Code eine Klasse mit dem Namen des Plugins und ist es auch der Dirname?
            if (class_exists($plugin_name) and in_array($plugin_name, get_declared_classes())) {
                $plugin = new $plugin_name();
                # das ist nötig weil es sein kann das in getInfo() variblen initaliesiert werden
                $tmp = $plugin->getInfo();
                $config = $plugin->getConfig();
                echo save_plugin_settings($conf_plugin, $config, $plugin_name);
                exit;
            } else {
                die("Fatal Error");
            }
        }
        die("Fatal Error");
    }
    $pagecontent = '';
    $show = $ADMIN_CONF->get("plugins");
    if (!is_array($show)) {
        $show = array();
    }
    if (ROOT or in_array("plugin_-_manage", $show)) {
        $multi_user = "";
        if (defined('MULTI_USER') and MULTI_USER) {
            $multi_user = "******";
        }
        $html_manage = "";
        $plugin_manage = array();
        $disabled = '';
        if (!function_exists('gzopen')) {
            $disabled = ' disabled="disabled"';
        }
        $plugin_install = array();
        foreach (getDirAsArray(PLUGIN_DIR_REL, array(".zip")) as $zip_file) {
            $plugin_install[] = '<option value="' . mo_rawurlencode($zip_file) . '">' . $zip_file . '</option>';
        }
        $plugin_install_html = "";
        if (count($plugin_install) > 0) {
            $plugin_install_html .= '<br /><select class="mo-install-select mo-select-div" name="plugin-install-select" size="1"' . $disabled . '>' . '<option value="">' . getLanguageValue("plugins_select", true) . '</option>' . implode("", $plugin_install) . '</select>';
        }
        $plugin_manage["plugins_title_manage"][] = '<form id="js-plugin-manage" action="index.php?nojs=true&amp;action=plugins' . $multi_user . '" method="post" enctype="multipart/form-data">' . '<div class="mo-nowrap align-right ui-helper-clearfix">' . '<span class="align-left" style="float:left"><span class="mo-bold">' . getLanguageValue("plugins_text_filebutton") . '</span><br />' . getLanguageValue("plugins_text_fileinfo") . '</span>' . '<input type="file" id="js-plugin-install-file" name="plugin-install-file" class="mo-select-div"' . $disabled . ' />' . $plugin_install_html . '<input type="submit" id="js-plugin-install-submit" name="plugin-install" value="' . getLanguageValue("plugins_button_install", true) . '"' . $disabled . ' /><br />' . '<input type="submit" id="js-plugin-del-submit" value="' . getLanguageValue("plugins_button_delete", true) . '" class="mo-margin-top js-send-del-stop" />' . '</div></form>';
        $plugin_manage["plugins_title_manage"]["toggle"] = true;
        $html_manage = contend_template($plugin_manage);
        $html_manage = str_replace("js-toggle", "js-toggle-manage", $html_manage);
        # es wurde in der template verwaltung was gemacht dann soll die aufgeklapt bleiben
        if ($plugin_manage_open) {
            $html_manage = str_replace("display:none;", "", $html_manage);
        }
        $pagecontent .= $html_manage;
    }
    $pagecontent .= '<ul class="js-plugins mo-ul">';
    $dircontent = getDirAsArray(PLUGIN_DIR_REL, "dir", "natcasesort");
    foreach ($dircontent as $currentelement) {
        $new_plugin_conf = false;
        if (!ROOT and !in_array($currentelement, $show)) {
            continue;
        }
        if (file_exists(PLUGIN_DIR_REL . $currentelement . "/index.php")) {
            if (!is_file(PLUGIN_DIR_REL . $currentelement . "/plugin.conf.php")) {
                if (false === newConf(PLUGIN_DIR_REL . $currentelement . "/plugin.conf.php")) {
                    die;
                } else {
                    $new_plugin_conf = true;
                }
            }
            require_once PLUGIN_DIR_REL . $currentelement . "/index.php";
            # Enthält der Code eine Klasse mit dem Namen des Plugins und ist es auch der Dirname?
            if (class_exists($currentelement) and in_array($currentelement, get_declared_classes())) {
                $plugin = new $currentelement();
            } else {
                # Plugin Dirname stimt nicht mit Plugin Classnamen überein
                continue;
            }
            # plugin.conf.php wurde neu erstelt.
            # Wenn es die getDefaultSettings() gibt fühle die plugin.conf.php damit
            if ($new_plugin_conf and method_exists($plugin, 'getDefaultSettings')) {
                $plugin->settings->setFromArray($plugin->getDefaultSettings());
            }
            $plugin_css_li_error = NULL;
            $plugin_error = false;
            $plugin_info = $plugin->getInfo();
            # Plugin Info Prüfen
            if (isset($plugin_info) and count($plugin_info) > 0) {
                $plugin_name = strip_tags($plugin_info[0], '<b>');
                if (substr(strip_tags($plugin_name), 0, strlen($currentelement)) != $currentelement) {
                    $plugin_name = "<b>" . $currentelement . "</b> " . strip_tags($plugin_name);
                }
                $plugin_name = htmlentities($plugin_name, ENT_COMPAT, CHARSET);
                $plugin_name = str_replace(array("&lt;", "&gt;", "\$"), array("<", ">", ""), $plugin_name);
            } else {
                $plugin_error = '<img class="mo-tool-icon mo-icons-icon mo-icons-error" src="' . ICON_URL_SLICE . '" alt="error" />' . getLanguageValue('plugins_error') . ' <b>' . $currentelement . '</b>';
                $plugin_css_li_error = ' ui-state-error';
            }
            $pagecontent .= '<li class="js-plugin mo-li ui-widget-content ui-corner-all' . $plugin_css_li_error . '">' . '<div class="js-tools-show-hide mo-li-head-tag mo-li-head-tag-no-ul ui-state-active ui-corner-all ui-helper-clearfix">';
            $check_show = ' style="display:none;"';
            if ($plugin_manage_open) {
                $check_show = '';
            }
            if ($plugin_error === false) {
                $pagecontent .= '<span class="js-plugin-name mo-padding-left mo-middle">' . $plugin_name . '</span>' . '<div style="float:right;" class="mo-tag-height-from-icon mo-middle mo-nowrap">' . '<span class="js-plugin-active mo-staus">' . buildCheckBox($currentelement . '[active]', $plugin->settings->get("active") == "true", getLanguageValue("plugins_input_active")) . '</span>' . '<img class="js-tools-icon-show-hide js-toggle mo-tool-icon mo-icons-icon mo-icons-edit" src="' . ICON_URL_SLICE . '" alt="edit" />' . '<input type="checkbox" value="' . $currentelement . '" class="mo-checkbox mo-checkbox-del js-plugin-del"' . $check_show . ' />' . '</div>' . '</div>' . '<div class="js-toggle-content mo-in-ul-ul ui-helper-clearfix" style="display:none;">' . get_plugin_info($plugin_info);
                # geändert damit getConfig() nicht 2mal ausgeführt wird
                $config = $plugin->getConfig();
                # Beschreibung und inputs der Konfiguration Bauen und ausgeben
                $pagecontent .= get_plugin_config($plugin->settings, $config, $currentelement);
            } else {
                $pagecontent .= $plugin_error;
            }
            $pagecontent .= '</div></li>';
            unset($plugin);
        }
    }
    $pagecontent .= '</ul>';
    return $pagecontent;
}
Example #4
0
function cleanValue($value)
{
    if (is_array($value)) {
        foreach ($value as $key => $val) {
            $value[$key] = cleanValue($val);
        }
    } elseif (is_bool($value)) {
        return $value;
    } else {
        // Nullbytes abfangen!
        if (strpos("tmp" . $value, "") > 0) {
            die;
        }
        $value = rawurldecode($value);
        $value = stripslashes($value);
        $value = str_replace(array("\r\n", "\r", "\n"), "-tmpbr_", $value);
        $value = trim($value, "..");
        if (basename($value) != $value) {
            $value = str_replace(basename($value), trim(basename($value), ".."), $value);
        }
        $value = strip_tags($value);
        $value = str_replace("-tmpbr_", "\n", $value);
        $value = mo_rawurlencode($value);
    }
    return $value;
}
Example #5
0
 public function post()
 {
     if (getRequestValue('_method') === 'DELETE') {
         return $this->delete();
     }
     $upload = isset($_FILES[$this->options['param_name']]) ? $_FILES[$this->options['param_name']] : null;
     $info = array();
     if ($upload && is_array($upload['tmp_name'])) {
         // param_name is an array identifier like "files[]",
         // $_FILES is a multi-dimensional array:
         foreach ($upload['tmp_name'] as $index => $value) {
             $info[] = $this->handle_file_upload($upload['tmp_name'][$index], isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : $upload['name'][$index], isset($_SERVER['HTTP_X_FILE_SIZE']) ? $_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'][$index], isset($_SERVER['HTTP_X_FILE_TYPE']) ? $_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'][$index], $upload['error'][$index]);
         }
     } elseif ($upload || isset($_SERVER['HTTP_X_FILE_NAME'])) {
         // param_name is a single object identifier like "file",
         // $_FILES is a one-dimensional array:
         $info[] = $this->handle_file_upload(isset($upload['tmp_name']) ? $upload['tmp_name'] : null, isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : (isset($upload['name']) ? $upload['name'] : null), isset($_SERVER['HTTP_X_FILE_SIZE']) ? $_SERVER['HTTP_X_FILE_SIZE'] : (isset($upload['size']) ? $upload['size'] : null), isset($_SERVER['HTTP_X_FILE_TYPE']) ? $_SERVER['HTTP_X_FILE_TYPE'] : (isset($upload['type']) ? $upload['type'] : null), isset($upload['error']) ? $upload['error'] : null);
     }
     header('Vary: Accept');
     $json = $this->my_json_encode($info);
     $redirect = getRequestValue('redirect', false, false) ? getRequestValue('redirect') : null;
     if ($redirect) {
         header('Location: ' . sprintf($redirect, mo_rawurlencode($json)));
         return;
     }
     if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false) {
         header('Content-type: application/json');
     } else {
         header('Content-type: text/plain');
     }
     header('content-type: text/html');
     echo '<div id="json-data">' . $json . '</div>';
 }
Example #6
0
 function get_UrlCoded($name, $protectUrlChr = false)
 {
     $name = html_entity_decode($name, ENT_QUOTES, CHARSET);
     if (preg_match('#\\%([0-9a-f]{2})#i', $name) < 1) {
         $name = mo_rawurlencode(stripslashes($name));
     }
     if ($protectUrlChr === true) {
         $name = str_replace($this->link_search, $this->link_replace, $name);
     }
     return $name;
 }
Example #7
0
function template()
{
    global $CMS_CONF;
    global $specialchars;
    global $message;
    global $debug;
    $template_manage_open = false;
    # templates löschen
    if (getRequestValue('template-all-del', 'post') and getRequestValue('template-del', 'post')) {
        template_del();
        $template_manage_open = true;
    }
    # template activ setzen
    if (!getRequestValue('template-all-del', 'post') and !getRequestValue('template-install', 'post') and getRequestValue('template-active', 'post')) {
        $debug .= "active=" . getRequestValue('template-active', 'post') . "<br />\n";
        template_setactiv();
    }
    # hochgeladenes template installieren
    if (isset($_FILES["template-install-file"]["error"]) and getRequestValue('template-install', 'post') and $_FILES["template-install-file"]["error"] == 0 and strtolower(substr($_FILES["template-install-file"]["name"], -4)) == ".zip") {
        $debug .= "install=" . $_FILES["template-install-file"]["name"] . "<br />\n";
        template_install();
        $template_manage_open = true;
    } elseif ($template_select = $specialchars->rebuildSpecialChars(getRequestValue('template-install-select', 'post'), false, false) and getRequestValue('template-install', 'post') and is_file(BASE_DIR . LAYOUT_DIR_NAME . "/" . $template_select) !== false and strtolower(substr($template_select, -4)) == ".zip") {
        $debug .= "local install=" . getRequestValue('template-install-select', 'post') . "<br />\n";
        template_install($template_select);
        $template_manage_open = true;
    }
    $showdebug = false;
    if ($showdebug and !empty($debug)) {
        $message .= returnMessage(false, $debug);
    }
    $ACTIV_TEMPLATE = $CMS_CONF->get("cmslayout");
    $LAYOUT_DIR = LAYOUT_DIR_NAME . "/" . $ACTIV_TEMPLATE . '/';
    if (getRequestValue('chancefiles') == "true") {
        require_once BASE_DIR_ADMIN . "jquery/File-Upload/upload.class.php";
    }
    if (false !== ($newfile = getRequestValue('newfile', 'post')) and false !== ($orgfile = getRequestValue('orgfile', 'post')) and false !== ($curent_dir = getRequestValue('curent_dir', 'post'))) {
        $dir = BASE_DIR . LAYOUT_DIR_NAME . "/" . str_replace('%2F', '/', $curent_dir) . "/";
        if (true !== ($error = moveFileDir($dir . $orgfile, $dir . $newfile, true))) {
            ajax_return("error", true, $error, true, "js-dialog-reload");
        }
        ajax_return("success", true);
    }
    if (getRequestValue('templateselectbox', 'post') == "true") {
        require_once BASE_DIR_ADMIN . 'editsite.php';
        # wir schiken die neue selectbox zurück
        echo '<span id="replace-item">' . returnTemplateSelectbox() . '</span>';
        ajax_return("success", true);
    }
    if (getRequestValue('configtemplate', 'post') == "true") {
        if (false !== ($templatefile = BASE_DIR . getRequestValue('templatefile', 'post', false)) and !file_exists($templatefile)) {
            ajax_return("error", true, returnMessage(false, getLanguageValue("error_no_file_dir") . " " . $templatefile), true, true);
        }
        if (false !== ($content = getRequestValue('content', 'post', false))) {
            if (false === mo_file_put_contents($templatefile, $content)) {
                ajax_return("error", true, returnMessage(false, getLanguageValue("editor_content_error_save")), true, true);
            }
            echo ajax_return("success", false);
        } else {
            if (false === ($syntax = get_contents_ace_edit($templatefile))) {
                ajax_return("error", true, returnMessage(false, getLanguageValue("editor_content_error_open")), true, true);
            }
            echo '<textarea id="page-content">' . $syntax . '</textarea>';
            echo ajax_return("success", false);
        }
        exit;
    }
    global $ADMIN_CONF;
    $show = $ADMIN_CONF->get("template");
    if (!is_array($show)) {
        $show = array();
    }
    $html_manage = "";
    if (ROOT or in_array("template_manage", $show)) {
        $template_manage = array();
        $disabled = '';
        if (!function_exists('gzopen')) {
            $disabled = ' disabled="disabled"';
        }
        $template_install = array();
        foreach (getDirAsArray(BASE_DIR . LAYOUT_DIR_NAME, array(".zip")) as $zip_file) {
            $template_install[] = '<option value="' . mo_rawurlencode($zip_file) . '">' . $zip_file . '</option>';
        }
        $template_install_html = "";
        if (count($template_install) > 0) {
            $template_install_html .= '<br /><select class="mo-install-select mo-select-div" name="template-install-select" size="1"' . $disabled . '>' . '<option value="">' . getLanguageValue("template_select", true) . '</option>' . implode("", $template_install) . '</select>';
        }
        $template_manage["template_title_manage"][] = '<div class="mo-nowrap align-right ui-helper-clearfix">' . '<span class="align-left" style="float:left"><span class="mo-bold">' . getLanguageValue("template_text_filebutton") . '</span><br />' . getLanguageValue("template_text_fileinfo") . '</span>' . '<input type="file" id="js-template-install-file" name="template-install-file" class="mo-select-div"' . $disabled . ' />' . $template_install_html . '<input type="submit" id="js-template-install-submit" name="template-install" value="' . getLanguageValue("template_button_install", true) . '"' . $disabled . ' /><br />' . '<input type="submit" id="js-template-del-submit" value="' . getLanguageValue("template_button_delete", true) . '" class="mo-margin-top" />' . '</div>';
        foreach (getDirAsArray(BASE_DIR . LAYOUT_DIR_NAME, "dir", "natcasesort") as $pos => $file) {
            $template_activ = '';
            $checkbox_del = '<input type="checkbox" name="template-del[]" value="' . $file . '" class="mo-checkbox" />';
            $radio_activ = '<input id="template-status' . $pos . '" name="template-active" type="radio" value="' . $file . '" class="mo-radio" /><label for="template-status' . $pos . '">' . getLanguageValue("template_input_set_active") . '</label>';
            if ($ACTIV_TEMPLATE == $file) {
                $checkbox_del = '&nbsp;';
                $radio_activ = "";
                $template_activ = ' mo-bold';
            }
            $template_manage["template_title_manage"][] = '<div class="mo-middle mo-tag-height-from-icon ui-helper-clearfix">' . '<span class="mo-nowrap  mo-padding-left' . $template_activ . '">' . $specialchars->rebuildSpecialChars($file, false, true) . '</span>' . '<div style="float:right;">' . $checkbox_del . '</div>' . '<div style="float:right;width:30%;">' . $radio_activ . '</div>' . '</div>';
        }
        $multi_user = "";
        if (defined('MULTI_USER') and MULTI_USER) {
            $multi_user = "******";
        }
        if (count($template_manage["template_title_manage"]) > 0) {
            $template_manage["template_title_manage"]["toggle"] = true;
            $html_manage = '<form id="js-template-manage" action="index.php?nojs=true&amp;action=template' . $multi_user . '" method="post" enctype="multipart/form-data">' . contend_template($template_manage) . '</form>';
            # es wurde in der template verwaltung was gemacht dann soll die aufgeklapt bleiben
            if ($template_manage_open) {
                $html_manage = str_replace("display:none;", "", $html_manage);
            }
        }
    }
    $html_template = "";
    if (ROOT or in_array("template_edit", $show)) {
        $template = array();
        foreach (getDirAsArray(BASE_DIR . $LAYOUT_DIR, array(".html"), "natcasesort") as $file) {
            $template["template_title_html_css"][] = '<div class="js-tools-show-hide mo-middle mo-tag-height-from-icon ui-helper-clearfix">' . '<span class="js-filename mo-nowrap mo-padding-left">' . $file . '</span>' . '<img style="float:right;" class="js-tools-icon-show-hide js-edit-template js-html mo-tool-icon mo-icons-icon mo-icons-page-edit" src="' . ICON_URL_SLICE . '" alt="page-edit" hspace="0" vspace="0" />' . '<span class="js-edit-file-pfad" style="display:none;">' . $specialchars->replaceSpecialChars($LAYOUT_DIR . $file, true) . '</span>' . '</div>';
        }
        foreach (getDirAsArray(BASE_DIR . $LAYOUT_DIR . 'css', array(".css"), "natcasesort") as $file) {
            $template["template_title_html_css"][] = '<div class="js-tools-show-hide mo-middle mo-tag-height-from-icon ui-helper-clearfix">' . '<span class="js-filename mo-nowrap mo-padding-left"><span class="mo-bold mo-padding-right">css/</span>' . $file . '</span>' . '<img style="float:right;" class="js-tools-icon-show-hide js-edit-template js-css mo-tool-icon mo-icons-icon mo-icons-page-edit" src="' . ICON_URL_SLICE . '" alt="page-edit" hspace="0" vspace="0" />' . '<span class="js-edit-file-pfad" style="display:none;">' . $specialchars->replaceSpecialChars($LAYOUT_DIR . 'css/' . $file, true) . '</span>' . '</div>';
        }
        require_once BASE_DIR_ADMIN . "jquery/File-Upload/fileupload.php";
        $template_img = getFileUpload($CMS_CONF->get("cmslayout") . '/grafiken');
        $html_img = get_template_truss('<li class="mo-li ui-corner-all">' . $template_img . '</li>', "template_title_grafiken", true);
        $html_template = get_template_truss('<li class="ui-corner-all">' . contend_template($template) . $html_img . '</li>', "template_title_template", false);
        $html_template = str_replace("{TemplateName}", '<span style="font-weight:normal;">' . $specialchars->rebuildSpecialChars($CMS_CONF->get("cmslayout"), false, true) . '</span>', $html_template);
    }
    $html_plugins = "";
    if (ROOT or in_array("template_plugin_css", $show)) {
        $show = $ADMIN_CONF->get("plugins");
        if (!is_array($show)) {
            $show = array();
        }
        global $activ_plugins;
        $template_plugins = array();
        $template_plugins["template_title_plugins"] = array();
        foreach ($activ_plugins as $plugin) {
            if (!ROOT and !in_array($plugin, $show)) {
                continue;
            }
            if (!is_file(BASE_DIR . PLUGIN_DIR_NAME . "/" . $plugin . "/plugin.css")) {
                continue;
            }
            $template_plugins["template_title_plugins"][] = '<div class="js-tools-show-hide mo-middle mo-tag-height-from-icon ui-helper-clearfix">' . '<span class="js-filename mo-nowrap mo-padding-left"><span class="mo-bold mo-padding-right">css/</span>' . $plugin . '</span>' . '<img style="float:right;" class="js-tools-icon-show-hide js-edit-template js-css mo-tool-icon mo-icons-icon mo-icons-page-edit" src="' . ICON_URL_SLICE . '" alt="page-edit" hspace="0" vspace="0" />' . '<span class="js-edit-file-pfad" style="display:none;">' . $specialchars->replaceSpecialChars(PLUGIN_DIR_NAME . "/" . $plugin . "/plugin.css", true) . '</span>' . '</div>';
        }
        if (count($template_plugins["template_title_plugins"]) > 0) {
            $template_plugins["template_title_plugins"]["toggle"] = true;
            $html_plugins = contend_template($template_plugins);
        }
    }
    $html_editor = "";
    if (!empty($html_template) or !empty($html_plugins)) {
        $html_editor = pageedit_dialog();
    }
    return $html_manage . $html_template . $html_plugins . $html_editor;
}