Пример #1
0
function getFileUpload($curent_dir, $dir = false, $count_text = false, $newcss = "")
{
    $head = "";
    if (ACTION != "template") {
        $count = "0";
        $gallery_tools = "";
        if (ACTION == "gallery") {
            $count = count(getDirAsArray(GALLERIES_DIR_REL . $curent_dir, "img"));
            $gallery_tools = '<img class="js-tools-icon-show-hide js-rename-file mo-tool-icon mo-icon' . $newcss . ' mo-icons-icon mo-icons-work" src="' . ICON_URL_SLICE . '" alt="work" />' . '<img class="js-tools-icon-show-hide js-edit-delete mo-tool-icon mo-icon' . $newcss . ' mo-icons-icon mo-icons-delete" src="' . ICON_URL_SLICE . '" alt="delete" hspace="0" vspace="0" />';
        } elseif (ACTION == "files") {
            global $CatPage;
            $count = count($CatPage->get_FileArray($curent_dir));
        }
        $head = '<div class="js-tools-show-hide mo-li-head-tag mo-li-head-tag-no-ul ui-state-active ui-corner-all mo-middle">' . '<span class="js-gallery-name mo-padding-left mo-bold">' . $dir . '</span>' . '<div style="float:right;" class="mo-nowrap">' . '<span class="mo-staus mo-font-small' . $newcss . '">( ' . '<span class="files-count">' . $count . '</span> ' . $count_text . ' )</span>' . '<img class="js-tools-icon-show-hide js-toggle mo-tool-icon' . $newcss . ' mo-icons-icon mo-icons-edit" src="' . ICON_URL_SLICE . '" alt="edit" />' . $gallery_tools . '</div>' . '<br class="mo-clear" />' . '</div>';
    }
    $css = "mo-ul";
    if (ACTION != "template") {
        $css = "mo-in-ul-ul";
    }
    $fileupload = '<ul class="js-toggle-content ' . $css . ' ui-corner-bottom" style="display:none;">' . '<li class="ui-widget-content ui-corner-all">' . '<input type="hidden" name="curent_dir" value="' . $curent_dir . '" />' . '<input type="hidden" name="chancefiles" value="true" />' . '<input type="hidden" name="action" value="' . ACTION . '" />' . '<div class="fileupload-buttonbar mo-li-head-tag mo-li-head-tag-no-ul ui-widget-header ui-corner-top">' . '<span class="fileinput-button">' . '<img class="mo-icons-icon mo-icons-add-file" src="' . ICON_URL_SLICE . '" alt="add-file" />' . '<input type="file" name="files[]" />' . '</span>' . '<button type="submit" class="fu-img-button start mo-icons-icon mo-icons-save">&nbsp;</button>' . '<button type="reset" class="fu-img-button cancel mo-icons-icon mo-icons-stop">&nbsp;</button>' . '<img style="width:2em;height:1px;" src="' . ICON_URL_SLICE . '" alt=" " />' . '<button type="button" class="fu-img-button delete mo-icons-icon mo-icons-delete">&nbsp;</button>';
    if (ACTION == "gallery") {
        $fileupload .= '<button type="button" class="fu-img-button resize mo-icons-icon mo-icons-img-scale">&nbsp;</button>';
    }
    $fileupload .= '<input type="checkbox" class="toggle" />';
    if (ACTION == "gallery") {
        global $GALLERY_CONF;
        $tmp_w = "";
        $tmp_h = "";
        if ($GALLERY_CONF->get('maxwidth') != "auto" and $GALLERY_CONF->get('maxwidth') > 0) {
            $tmp_w = $GALLERY_CONF->get('maxwidth');
        }
        if ($GALLERY_CONF->get('maxheight') != "auto" and $GALLERY_CONF->get('maxheight') > 0) {
            $tmp_h = $GALLERY_CONF->get('maxheight');
        }
        $fileupload .= '' . '<img style="width:2em;height:1px;" src="' . ICON_URL_SLICE . '" alt=" " />' . getLanguageValue("gallery_image_size") . ' <input type="text" name="new_width" value="' . $tmp_w . '" size="4" maxlength="4" class="mo-input-digit js-in-digit" /> x <input type="text" name="new_height" value="' . $tmp_h . '" size="4" maxlength="4" class="mo-input-digit js-in-digit" />' . '<img style="width:2em;height:1px;" src="' . ICON_URL_SLICE . '" alt=" " />' . getLanguageValue("gallery_preview_size") . ' <input type="text" name="thumbnail_max_width" value="' . $GALLERY_CONF->get('maxthumbwidth') . '" size="4" maxlength="4" class="mo-input-digit js-in-digit" /> x <input type="text" name="thumbnail_max_height" value="' . $GALLERY_CONF->get('maxthumbheight') . '" size="4" maxlength="4" class="mo-input-digit js-in-digit" />' . '';
    }
    $fileupload .= '</div>' . '<ul class="files"></ul>' . '</li>' . '</ul>';
    $form_start = '<form class="fileupload" action="index.php" method="post" enctype="multipart/form-data">';
    $form_end = '</form>';
    return $form_start . $head . $fileupload . $form_end;
}
Пример #2
0
 function getContent($value)
 {
     $values = explode(",", $value);
     global $CMS_CONF;
     global $specialchars;
     global $lang_gallery_cms;
     $dir = PLUGIN_DIR_REL . "Galerie/";
     $lang_gallery_cms = new Language($dir . "sprachen/cms_language_" . $CMS_CONF->get("cmslanguage") . ".txt");
     $embedded = $this->settings->get("target");
     $linkprefix = "index.php?cat=" . CAT_REQUEST . "&amp;page=" . PAGE_REQUEST . "&amp;";
     if ($embedded == "_blank") {
         $linkprefix = "index.php?galtemplate=true&amp;";
     }
     if ($CMS_CONF->get("modrewrite") == "true") {
         $linkprefix = URL_BASE . CAT_REQUEST . "/" . PAGE_REQUEST . ".html?";
         if ($embedded == "_blank") {
             $linkprefix = "index.php.html?galtemplate=true&amp;";
         }
     }
     $index = NULL;
     if (getRequestValue('index', 'get', false)) {
         $index = getRequestValue('index', 'get', false);
     }
     $cat_activ = "";
     if (CAT_REQUEST == basename(dirname($_SERVER['REQUEST_URI'])) and $embedded == "_self") {
         $cat_activ = "../";
     }
     if ($this->settings->get("usethumbs") == "true") {
         $usethumbs = true;
     } else {
         $usethumbs = false;
     }
     // Übergebene Parameter überprüfen
     $gal_request = $specialchars->replacespecialchars($specialchars->getHtmlEntityDecode($values[0]), false);
     if (getRequestValue("gal", 'get', false)) {
         $gal_request = $specialchars->replacespecialchars(getRequestValue("gal", 'get', false), false);
     }
     $GALERIE_DIR = BASE_DIR . GALLERIES_DIR_NAME . "/" . $gal_request . "/";
     $GALERIE_DIR_SRC = str_replace("%", "%25", URL_BASE . GALLERIES_DIR_NAME . "/" . $gal_request . "/");
     # keine Galerie angegeben oder Galerie gibts nicht
     if ($gal_request == "" || !file_exists($GALERIE_DIR)) {
         global $syntax;
         if ($gal_request == "") {
             return $syntax->createDeadlink($lang_gallery_cms->getLanguageValue("message_gallerydir_error_0"), $lang_gallery_cms->getLanguageValue("message_gallerydir_error_0"));
         } else {
             return $syntax->createDeadlink($specialchars->rebuildSpecialChars($gal_request, false, true), $lang_gallery_cms->getLanguageValue("message_gallerydir_error_1", $specialchars->rebuildSpecialChars($gal_request, false, true)));
         }
     }
     # Galerie erzeugen
     if ($embedded == "_self" or getRequestValue('gal', 'get', false)) {
         $alldescriptions = false;
         if (is_file($GALERIE_DIR . "texte.conf.php")) {
             $alldescriptions = new Properties($GALERIE_DIR . "texte.conf.php");
         }
         // Galerieverzeichnis einlesen
         $picarray = getDirAsArray($GALERIE_DIR, "img");
         $allindexes = array();
         for ($i = 1; $i <= count($picarray); $i++) {
             array_push($allindexes, $i);
         }
         // globaler Index
         if (!isset($index) || !in_array($index, $allindexes)) {
             $index = 1;
         } else {
             $index = $index;
         }
         // Bestimmung der Positionen
         $first = 1;
         $last = count($allindexes);
         if (!in_array($index - 1, $allindexes)) {
             $previous = $last;
         } else {
             $previous = $index - 1;
         }
         if (!in_array($index + 1, $allindexes)) {
             $next = 1;
         } else {
             $next = $index + 1;
         }
         $template = NULL;
         if ($this->settings->get("gallerytemplate")) {
             if ($embedded == "_self") {
                 $template = '<div class="embeddedgallery">' . $this->settings->get("gallerytemplate") . '</div>';
             } else {
                 $template = $this->settings->get("gallerytemplate");
                 if (strrpos("tmp" . $value, '{NUMBERMENU}') > 0) {
                     $template = $value;
                 }
             }
         } else {
             $template = "{GALLERYMENU}{NUMBERMENU}\n{CURRENTPIC}\n{CURRENTDESCRIPTION}";
             if (strrpos("tmp" . $value, '{NUMBERMENU}') > 0) {
                 $template = $value;
             }
         }
         $html = $template;
         if (count($picarray) == 0) {
             $html = str_replace('{NUMBERMENU}', $lang_gallery_cms->getLanguageValue("message_galleryempty_0"), $html);
         }
         # Titel der Galerie
         $html = str_replace('{CURRENTGALLERY}', $specialchars->rebuildSpecialChars($gal_request, false, true), $html);
         if ($usethumbs) {
             $html = str_replace('{GALLERYMENU}', "&nbsp;", $html);
             $html = str_replace('{NUMBERMENU}', $this->getThumbnails($picarray, $alldescriptions, $GALERIE_DIR, $GALERIE_DIR_SRC), $html);
             $html = str_replace('{CURRENTPIC}', "&nbsp;", $html);
             $html = str_replace('{CURRENTDESCRIPTION}', "&nbsp;", $html);
             $html = str_replace('{XOUTOFY}', "&nbsp;", $html);
         } else {
             $html = str_replace('{GALLERYMENU}', $this->getGalleryMenu($picarray, $linkprefix, $gal_request, $index, $first, $previous, $next, $last), $html);
             $html = str_replace('{NUMBERMENU}', $this->getNumberMenu($picarray, $linkprefix, $index, $gal_request, $first, $last), $html);
             $html = str_replace('{CURRENTPIC}', $this->getCurrentPic($picarray, $index, $GALERIE_DIR_SRC), $html);
             if (count($picarray) > 0) {
                 $html = str_replace('{CURRENTDESCRIPTION}', $this->getCurrentDescription($picarray[$index - 1], $picarray, $alldescriptions), $html);
             } else {
                 $html = str_replace('{CURRENTDESCRIPTION}', "", $html);
             }
             $html = str_replace('{XOUTOFY}', $this->getXoutofY($picarray, $index, $last), $html);
             $html = str_replace('{CURRENT_INDEX}', $index, $html);
             $html = str_replace('{PREVIOUS_INDEX}', $previous, $html);
             $html = str_replace('{NEXT_INDEX}', $next, $html);
         }
         return $html;
         # Galerie Link erzeugen
     } else {
         $j = 0;
         if (file_exists($GALERIE_DIR)) {
             $handle = opendir($GALERIE_DIR);
             while ($file = readdir($handle)) {
                 if (is_file($GALERIE_DIR . $file) and $file != "texte.conf.php") {
                     $j++;
                 }
             }
             closedir($handle);
         } else {
             global $syntax;
             // Galerie nicht vorhanden
             return $syntax->createDeadlink($specialchars->rebuildSpecialChars($values[0], false, true), $lang_gallery_cms->getLanguageValue("tooltip_link_gallery_error_1", $specialchars->rebuildSpecialChars($values[0], false, true)));
         }
         $gal_name = NULL;
         if (isset($values[0])) {
             $gal_name = $specialchars->rebuildSpecialChars($values[0], false, false);
         }
         if (isset($values[1])) {
             $gal_name = $specialchars->rebuildSpecialChars($values[1], false, false);
         }
         global $syntax;
         return "<a class=\"gallery\" href=\"" . $linkprefix . "gal=" . $gal_request . "\" " . $syntax->getTitleAttribute($lang_gallery_cms->getLanguageValue("tooltip_link_gallery_2", $specialchars->rebuildSpecialChars($values[0], false, true), $j)) . "target=\"" . $this->settings->get("target") . "\">" . $gal_name . "</a>";
     }
 }
Пример #3
0
function changeFromFtp()
{
    global $message;
    global $specialchars;
    $success = false;
    $dirgallery = getDirAsArray(GALLERIES_DIR_REL, "dir");
    foreach ($dirgallery as $currentgalerien) {
        $change = false;
        if (true !== ($error = setChmod(GALLERIES_DIR_REL . $currentgalerien))) {
            $message .= returnMessage(false, $error);
            return;
        }
        $test_galerie = $specialchars->replaceSpecialChars($specialchars->rebuildSpecialChars($currentgalerien, false, false), false);
        if ($test_galerie != $currentgalerien) {
            $nr = 0;
            $new_name = $test_galerie;
            while (in_array($new_name, $dirgallery)) {
                $new_name = "%23_" . $nr . "_" . $test_galerie;
                $nr++;
            }
            if (true !== ($error = moveFileDir(GALLERIES_DIR_REL . $currentgalerien, GALLERIES_DIR_REL . $new_name))) {
                $message .= returnMessage(false, $error);
                return;
            }
            $change = true;
            $currentgalerien = $new_name;
        }
        if (!is_dir(GALLERIES_DIR_REL . $currentgalerien . '/' . PREVIEW_DIR_NAME)) {
            if (true !== ($error = mkdirMulti(GALLERIES_DIR_REL . $currentgalerien . '/' . PREVIEW_DIR_NAME))) {
                $message .= returnMessage(false, $error);
                return;
            }
            $change = true;
        }
        if (!file_exists(GALLERIES_DIR_REL . $currentgalerien . "/texte.conf.php")) {
            if (false === newConf(GALLERIES_DIR_REL . $currentgalerien . "/texte.conf.php")) {
                $message .= returnMessage(false, getLanguageValue("gallery_error_subtitle_conf"));
                return;
            }
            $change = true;
        }
        $dirimg = getDirAsArray(GALLERIES_DIR_REL . $currentgalerien, "img");
        foreach ($dirimg as $currentimg) {
            if (true !== ($error = setChmod(GALLERIES_DIR_REL . $currentgalerien . "/" . $currentimg))) {
                $message .= returnMessage(false, $error);
                return;
            }
            $test_img = cleanUploadFile($currentimg);
            if ($test_img != $currentimg) {
                $nr = 0;
                $new_name = $test_img;
                while (in_array($new_name, $dirimg)) {
                    $new_name = "_" . $nr . "_" . $test_img;
                    $nr++;
                }
                if (true !== ($error = moveFileDir(GALLERIES_DIR_REL . $currentgalerien . "/" . $currentimg, GALLERIES_DIR_REL . $currentgalerien . "/" . $new_name))) {
                    $message .= returnMessage(false, $error);
                    return;
                }
                $change = true;
                if (is_file(GALLERIES_DIR_REL . $currentgalerien . '/' . PREVIEW_DIR_NAME . "/" . $currentimg)) {
                    if (true !== ($error = moveFileDir(GALLERIES_DIR_REL . $currentgalerien . '/' . PREVIEW_DIR_NAME . "/" . $currentimg, GALLERIES_DIR_REL . $currentgalerien . '/' . PREVIEW_DIR_NAME . "/" . $new_name))) {
                        $message .= returnMessage(false, $error);
                        return;
                    }
                    $change = true;
                }
            }
        }
        if ($change) {
            $success .= "<b>" . $specialchars->rebuildSpecialChars($currentgalerien, false, true) . "</b><br />";
        }
    }
    if ($success) {
        $message .= returnMessage(true, getLanguageValue("gallery_messages_from_ftp") . "<br /><br />" . $success);
    } else {
        $message .= returnMessage(true, getLanguageValue("gallery_messages_from_ftp_no") . "");
    }
}
Пример #4
0
function config()
{
    global $CMS_CONF;
    global $specialchars;
    global $CONTACT_CONF;
    global $ADMIN_CONF;
    global $USER_SYNTAX;
    if (getRequestValue('savesyntax', 'post') == "true") {
        if (false !== ($content = getRequestValue('content', 'post', false)) and $CMS_CONF->get('usecmssyntax') == "true") {
            $USER_SYNTAX->setFromTextarea($content);
            require_once BASE_DIR_ADMIN . 'editsite.php';
            $selctbox = '<span id="replace-item">' . returnUserSyntaxSelectbox() . '</span>';
            $var_UserSyntax = '0E0M0P0T0Y0';
            # die userSxntax hat sich geändert deshalb schiecken wir dem editor userSyntax die neuen
            global $USER_SYNTAX;
            $moziloUserSyntax = $USER_SYNTAX->toArray();
            if (count($moziloUserSyntax) > 0) {
                $moziloUserSyntax = array_keys($moziloUserSyntax);
                rsort($moziloUserSyntax);
                $var_UserSyntax = implode('|', $moziloUserSyntax);
            }
            $var_UserSyntax = '<span id="moziloUserSyntax">' . $var_UserSyntax . '</span>';
            echo ajax_return("success", false) . $selctbox . $var_UserSyntax;
        } elseif ($CMS_CONF->get('usecmssyntax') == "true") {
            require_once BASE_DIR_ADMIN . 'editsite.php';
            $selctbox = '<span id="replace-item">' . returnUserSyntaxSelectbox() . '</span>';
            $selctbox .= '<textarea id="page-content">' . $USER_SYNTAX->getToTextarea() . '</textarea>';
            echo ajax_return("success", false) . $selctbox;
        }
        exit;
    } elseif (getRequestValue('chanceconfig', 'post') == "true") {
        echo set_config_para();
        exit;
    }
    $pagecontent = NULL;
    $show = $ADMIN_CONF->get("config");
    if (!is_array($show)) {
        $show = array();
    }
    $template = array();
    $error = array();
    // ALLGEMEINE EINSTELLUNGEN
    $titel = "config_titel_cmsglobal";
    // Zeile "WEBSITE-TITEL", "TITEL-TRENNER" und "WEBSITE-TITELLEISTE"
    if (ROOT or in_array("websitetitle", $show)) {
        $error[$titel][] = false;
        $template[$titel][] = '<div class="ui-helper-clearfix">' . '<div class="mo-in-li-l">' . getLanguageValue("config_text_websitetitle") . '</div>' . '<div class="mo-in-li-r">' . '<input type="text" class="mo-input-text" name="websitetitle" value="' . $specialchars->rebuildSpecialChars($CMS_CONF->get("websitetitle"), true, true) . '" />' . '</div>' . '</div>' . '<div class="mo-padding-top ui-helper-clearfix">' . '<div class="mo-in-li-l">' . getLanguageValue("config_text_websitetitleseparator") . '</div>' . '<div class="mo-in-li-r">' . '<input type="text" class="mo-input-text" name="titlebarseparator" value="' . $specialchars->rebuildSpecialChars($CMS_CONF->get("titlebarseparator"), true, true) . '" />' . '</div>' . '</div>' . '<div class="mo-padding-top">' . getLanguageValue("config_text_websitetitlebar") . '<br /><input type="text" class="mo-input-text mo-input-margin-top" name="titlebarformat" value="' . $specialchars->rebuildSpecialChars($CMS_CONF->get("titlebarformat"), true, true) . '" />' . '</div>';
    }
    // Zeile "WEBSITE-BESCHREIBUNG" und "WEBSITE-KEYWORDS"
    if (ROOT or in_array("websitedescription", $show)) {
        $error[$titel][] = false;
        $template[$titel][] = getLanguageValue("config_text_websitedescription") . '<br /><input type="text" class="mo-input-text mo-input-margin-top" name="websitedescription" value="' . $specialchars->rebuildSpecialChars($CMS_CONF->get("websitedescription"), true, true) . '" /><div class="mo-padding-top">' . getLanguageValue("config_text_websitekeywords") . '</div><input type="text" class="mo-input-text mo-input-margin-top" name="websitekeywords" value="' . $specialchars->rebuildSpecialChars($CMS_CONF->get("websitekeywords"), true, true) . '" />';
    }
    // Zeile "SPRACHAUSWAHL"
    if (ROOT or in_array("cmslanguage", $show)) {
        $tmp_array = getDirAsArray(BASE_DIR_CMS . 'sprachen', "file", "natcasesort");
        if (count($tmp_array) <= 0) {
            $error[$titel][] = getLanguageValue("config_error_language_empty");
        } elseif (!in_array("language_" . $CMS_CONF->get('cmslanguage') . ".txt", $tmp_array)) {
            $error[$titel][] = getLanguageValue("config_error_languagefile_error") . "<br />" . CMS_DIR_NAME . "/sprachen/language_" . $CMS_CONF->get('cmslanguage') . ".txt";
        } else {
            $error[$titel][] = false;
        }
        $conf_inhalt = '<div class="mo-select-div"><select name="cmslanguage" class="mo-select">';
        foreach ($tmp_array as $file) {
            $currentlanguagecode = substr($file, strlen("language_"), strlen($file) - strlen("language_") - strlen(".txt"));
            $selected = NULL;
            // aktuell ausgewählte Sprache als ausgewählt markieren
            if ($currentlanguagecode == $CMS_CONF->get("cmslanguage")) {
                $selected = " selected";
            }
            $conf_inhalt .= '<option' . $selected . ' value="' . $currentlanguagecode . '">';
            // Übersetzer aus der aktuellen Sprachdatei holen
            $languagefile = new Properties(BASE_DIR_CMS . "sprachen/" . $file);
            $conf_inhalt .= $currentlanguagecode . " (" . getLanguageValue("config_input_translator") . " " . $languagefile->get("_translator_0") . ")";
            $conf_inhalt .= "</option>";
        }
        $conf_inhalt .= "</select></div>";
        $template[$titel][] = array(getLanguageValue("config_text_cmslanguage"), $conf_inhalt);
    }
    // Zeile "STANDARD-KATEGORIE"
    if (ROOT or in_array("defaultcat", $show)) {
        $tmp_array = getDirAsArray(CONTENT_DIR_REL, "dir", "natcasesort");
        if (count($tmp_array) <= 0) {
            $error[$titel][] = getLanguageValue("config_error_defaultcat_emty");
        } elseif (!in_array($CMS_CONF->get('defaultcat'), $tmp_array)) {
            $error[$titel][] = getLanguageValue("config_error_defaultcat_existed") . "<br />" . $specialchars->rebuildSpecialChars($CMS_CONF->get('defaultcat'), true, true);
        } else {
            $error[$titel][] = false;
        }
        $conf_inhalt = '<div class="mo-select-div"><select name="defaultcat" class="mo-select">';
        foreach ($tmp_array as $element) {
            if (count(getDirAsArray(CONTENT_DIR_REL . $element, array(EXT_PAGE, EXT_HIDDEN), "none")) == 0) {
                continue;
            }
            $selected = NULL;
            if ($element == $CMS_CONF->get("defaultcat")) {
                $selected = "selected ";
            }
            $conf_inhalt .= '<option ' . $selected . 'value="' . $element . '">' . $specialchars->rebuildSpecialChars($element, true, true) . "</option>";
        }
        $conf_inhalt .= "</select></div>";
        $template[$titel][] = array(getLanguageValue("config_text_defaultcat"), $conf_inhalt);
    }
    if (ROOT or in_array("draftmode", $show)) {
        $conf_checkbox = buildCheckBox("draftmode", $CMS_CONF->get("draftmode"), getLanguageValue("config_input_draftmode"));
        $conf_select = "";
        $tmp_array = getDirAsArray(BASE_DIR . "layouts", "dir", "natcasesort");
        if (count($tmp_array) <= 0) {
            $error[$titel][] = getLanguageValue("config_error_layouts_emty");
        } else {
            $error[$titel][] = false;
        }
        $conf_select .= '<div style="font-size:.4em;">&nbsp;</div><div class="mo-select-div"><select name="draftlayout" class="mo-select">';
        $conf_select .= '<option value="false">' . getLanguageValue("config_input_draftlayout") . '</option>';
        foreach ($tmp_array as $file) {
            $selected = NULL;
            if ($file == $CMS_CONF->get("draftlayout")) {
                $selected = " selected";
            }
            $conf_select .= '<option' . $selected . ' value="' . $file . '">';
            $conf_select .= $specialchars->rebuildSpecialChars($file, true, true);
            $conf_select .= "</option>";
        }
        $conf_select .= "</select></div>";
        $template[$titel][] = array(getLanguageValue("config_text_draftmode"), $conf_checkbox . $conf_select);
    }
    # sitemap.xml
    if (ROOT or in_array("usesitemap", $show)) {
        $error[$titel][] = false;
        $template[$titel][] = array(getLanguageValue("config_text_usesitemap"), buildCheckBox("usesitemap", $CMS_CONF->get("usesitemap"), getLanguageValue("config_input_usesitemap")));
    }
    // Zeile "NUTZE CMS-SYNTAX"
    // SYNTAX-EINSTELLUNGEN
    $titel = "config_titel_cmssyntax";
    if (ROOT or in_array("usecmssyntax", $show)) {
        $error[$titel][] = false;
        $template[$titel][] = array(getLanguageValue("config_text_usesyntax"), buildCheckBox("usecmssyntax", $CMS_CONF->get("usecmssyntax"), getLanguageValue("config_input_usesyntax")));
    }
    if (ROOT or (in_array("usecmssyntax", $show) or !in_array("usecmssyntax", $show) and $CMS_CONF->get("usecmssyntax") == "true")) {
        if (ROOT or in_array("editusersyntax", $show)) {
            $error[$titel][] = false;
            $template[$titel][] = array(getLanguageValue("config_text_usersyntax"), '<div class="js-usecmssyntax">' . '<img class="js-editsyntax mo-tool-icon mo-icons-icon mo-icons-page-edit" src="' . ICON_URL_SLICE . '" alt="page-edit" hspace="0" vspace="0" />' . '</div>');
        }
        // Zeile "ERSETZE EMOTICONS"
        if (ROOT or in_array("replaceemoticons", $show)) {
            $error[$titel][] = false;
            $template[$titel][] = array(getLanguageValue("config_text_replaceemoticons"), '<div class="js-usecmssyntax">' . buildCheckBox("replaceemoticons", $CMS_CONF->get("replaceemoticons") == "true", getLanguageValue("config_input_replaceemoticons")) . '</div>');
        }
        if (ROOT or in_array("defaultcolors", $show)) {
            $error[$titel][] = false;
            $colors_div = '<div class="mo-in-li-l">';
            $colors_div .= '<img class="js-save-default-color mo-tool-icon mo-icons-icon mo-icons-save" src="' . ICON_URL_SLICE . '" alt="save" />';
            $colors_div .= '<img id="js-del-config-default-color" class="mo-tool-icon ui-corner-all mo-icons-icon mo-icons-delete" src="' . ICON_URL_SLICE . '" alt="delete" hspace="0" vspace="0" />';
            $colors_div .= '<div id="js-config-default-color-box" class="ce-default-color-box ui-widget-content ui-corner-all">&nbsp;';
            $colors_div .= '</div>';
            $colors_div .= '</div>';
            $colors_div .= '<div id="js-menu-config-default-color" class="mo-in-li-r">' . '← <img class="js-new-config-default-color ce-bg-color-change ce-default-color-img ui-widget-content ui-corner-all" alt="" title="" src="' . ICON_URL_SLICE . '" />' . '<input type="text" maxlength="6" value="DD0000" class="ce-bg-color-change js-in-hex ce-in-hex" id="js-new-default-color-value" size="6" />' . '<img class="js-coloreditor-button ed-icon-border ed-syntax-icon ed-farbeedit" alt="' . getLanguageValue("dialog_title_coloredit") . '" title="' . getLanguageValue("dialog_title_coloredit") . '" src="' . ICON_URL_SLICE . '" style="display:none;" />' . '</div>';
            $template[$titel][] = '<div class="mo-margin-bottom">' . getLanguageValue("config_text_defaultcolors") . '</div>' . $colors_div . '<input type="hidden" name="defaultcolors" value="' . $specialchars->rebuildSpecialChars($CMS_CONF->get("defaultcolors"), false, false) . '" />';
        }
    }
    // Erweiterte Einstellungen
    // Zeile "showhiddenpagesin"
    $titel = "config_titel_expert";
    if (ROOT or in_array("hiddenpages", $show)) {
        $error[$titel][] = false;
        $template[$titel][] = array(getLanguageValue("config_text_showhiddenpages"), buildCheckBox("showhiddenpagesinsearch", $CMS_CONF->get("showhiddenpagesinsearch") == "true", getLanguageValue("config_input_search")) . '<br />' . buildCheckBox("showhiddenpagesinsitemap", $CMS_CONF->get("showhiddenpagesinsitemap") == "true", getLanguageValue("config_input_sitemap")) . '<br />' . buildCheckBox("showhiddenpagesasdefaultpage", $CMS_CONF->get("showhiddenpagesasdefaultpage") == "true", getLanguageValue("config_input_pagesasdefaultpage")));
    }
    // Zeile "Links öffnen self blank"
    if (ROOT or in_array("targetblank", $show)) {
        $error[$titel][] = false;
        $template[$titel][] = array(getLanguageValue("config_text_target"), buildCheckBox("targetblank_download", $CMS_CONF->get("targetblank_download") == "true", getLanguageValue("config_input_download")) . '<br />' . buildCheckBox("targetblank_link", $CMS_CONF->get("targetblank_link") == "true", getLanguageValue("config_input_link")));
    }
    // Zeile "wenn page == cat"
    if (ROOT or in_array("hidecatnamedpages", $show)) {
        $error[$titel][] = false;
        $template[$titel][] = array(getLanguageValue("config_text_catnamedpages"), buildCheckBox("hidecatnamedpages", $CMS_CONF->get("hidecatnamedpages") == "true", getLanguageValue("config_input_catnamedpages")));
    }
    // Zeile "mod_rewrite"
    if (ROOT or in_array("modrewrite", $show)) {
        $error[$titel][] = false;
        $template[$titel][] = array(getLanguageValue("config_text_modrewrite"), buildCheckBox("modrewrite", $CMS_CONF->get("modrewrite") == "true", getLanguageValue("config_input_modrewrite")));
    }
    // Zeile "showsyntaxtooltips"
    if (ROOT or in_array("showsyntaxtooltips", $show)) {
        $error[$titel][] = false;
        $template[$titel][] = array(getLanguageValue("config_text_showsyntaxtooltips"), buildCheckBox("showsyntaxtooltips", $CMS_CONF->get("showsyntaxtooltips") == "true", getLanguageValue("config_input_showsyntaxtooltips")));
    }
    $pagecontent .= contend_template($template, $error);
    if (ROOT or in_array("editusersyntax", $ADMIN_CONF->get("config"))) {
        $pagecontent .= pageedit_dialog();
    }
    return $pagecontent;
}
Пример #5
0
function returnTemplateSelectbox()
{
    global $CMS_CONF;
    global $specialchars;
    $LAYOUT_DIR = BASE_DIR . LAYOUT_DIR_NAME . "/" . $CMS_CONF->get("cmslayout") . '/';
    $selectbox = '<select name="template_css" class="overviewselect" title="' . getLanguageValue("toolbar_template", true) . ':">';
    $selectbox .= '<optgroup label="' . getLanguageValue("toolbar_template_css", true) . '">';
    foreach (getDirAsArray($LAYOUT_DIR . 'css', array(".css"), "natcasesort") as $file) {
        $selectbox .= '<option value="{LAYOUT_DIR}/css/' . $specialchars->replaceSpecialChars($file, true) . '">' . $specialchars->rebuildSpecialChars($file, false, true) . '</option>';
    }
    $selectbox .= '</optgroup>';
    $selectbox .= '<optgroup label="' . getLanguageValue("toolbar_template_image", true) . '">';
    foreach (getDirAsArray($LAYOUT_DIR . 'grafiken', "img", "natcasesort") as $file) {
        $selectbox .= '<option value="{LAYOUT_DIR}/grafiken/' . $specialchars->replaceSpecialChars($file, true) . '">' . $specialchars->rebuildSpecialChars($file, false, true) . '</option>';
    }
    $selectbox .= '</optgroup>';
    $selectbox .= "</select>";
    return $selectbox;
}
Пример #6
0
function updateFileNameInAll($old_name, $new_name)
{
    # nur diese pfade werden unterstüzt
    # dir/kategorie/CAT
    # dir/kategorie/CAT/PAGE
    # dir/kategorie/CAT/dateien/FILE
    # dir/galerien/GALLERY
    $oldnew = array("old" => array("url" => array()), "new" => array("url" => array()));
    # Kategorie Inhaltseite/Datei
    if (strstr($old_name, "/" . CONTENT_DIR_NAME . "/") and substr($old_name, -EXT_LENGTH) != EXT_LINK) {
        $old_name = str_replace(CONTENT_DIR_REL, "", $old_name);
        $new_name = str_replace(CONTENT_DIR_REL, "", $new_name);
        # es ist eine Datei
        if (strstr($old_name, "/" . CONTENT_FILES_DIR_NAME . "/")) {
            $old_name = str_replace("/" . CONTENT_FILES_DIR_NAME . "/", ":", $old_name);
            $new_name = str_replace("/" . CONTENT_FILES_DIR_NAME . "/", ":", $new_name);
            $oldnew["old"]["url"][0] = FILE_START . $old_name . FILE_END;
            $oldnew["new"]["url"][0] = FILE_START . $new_name . FILE_END;
            # es wurde die Kategorie oder Inhaltseite geändert
        } else {
            # es wurde nur die Inhaltseite geändert
            if (strstr($old_name, "/")) {
                $old_name = str_replace(array("/", EXT_PAGE, EXT_HIDDEN, EXT_DRAFT), array(":"), $old_name);
                $new_name = str_replace(array("/", EXT_PAGE, EXT_HIDDEN, EXT_DRAFT), array(":"), $new_name);
                $oldnew["old"]["url"][0] = FILE_START . $old_name . FILE_END;
                $oldnew["new"]["url"][0] = FILE_START . $new_name . FILE_END;
                # es wurde die Kategorie geändert
            } else {
                global $CMS_CONF;
                if ($CMS_CONF->get("defaultcat") == $old_name) {
                    $CMS_CONF->set("defaultcat", $new_name);
                }
                $tmp_dir = CONTENT_DIR_REL . $new_name;
                $oldnew["old"]["url"][0] = FILE_START . $old_name . FILE_END;
                $oldnew["new"]["url"][0] = FILE_START . $new_name . FILE_END;
                # alle Inhaltseiten
                foreach (getDirAsArray($tmp_dir, array(EXT_PAGE, EXT_HIDDEN, EXT_DRAFT)) as $page) {
                    $page = str_replace(array(EXT_PAGE, EXT_HIDDEN, EXT_DRAFT), "", $page);
                    $oldnew["old"]["url"][] = FILE_START . $old_name . ":" . $page . FILE_END;
                    $oldnew["new"]["url"][] = FILE_START . $new_name . ":" . $page . FILE_END;
                }
                # alle Dateien
                foreach (getDirAsArray($tmp_dir . "/" . CONTENT_FILES_DIR_NAME, "file") as $file) {
                    $oldnew["old"]["url"][] = FILE_START . $old_name . ":" . $file . FILE_END;
                    $oldnew["new"]["url"][] = FILE_START . $new_name . ":" . $file . FILE_END;
                }
            }
        }
        # Gallery
    } elseif (strstr($old_name, "/" . GALLERIES_DIR_NAME . "/")) {
        $old_name = str_replace(GALLERIES_DIR_REL, "", $old_name);
        $new_name = str_replace(GALLERIES_DIR_REL, "", $new_name);
        $oldnew["old"]["url"][0] = FILE_START . $old_name . FILE_END;
        $oldnew["new"]["url"][0] = FILE_START . $new_name . FILE_END;
    } else {
        return;
    }
    $oldnew["old"]["str"] = array_map('rawurldecode', $oldnew["old"]["url"]);
    $oldnew["new"]["str"] = array_map('rawurldecode', $oldnew["new"]["url"]);
    # Inhaltseiten
    foreach (getDirAsArray(CONTENT_DIR_REL, "dir") as $cat) {
        if (substr($cat, -EXT_LENGTH) == EXT_LINK) {
            continue;
        }
        foreach (getDirAsArray(CONTENT_DIR_REL . $cat, array(EXT_PAGE, EXT_HIDDEN, EXT_DRAFT)) as $page) {
            updateFileName(CONTENT_DIR_REL . $cat . "/" . $page, $oldnew);
        }
    }
    # alle template.html und gallerytemplate.html dateien
    foreach (getDirAsArray(BASE_DIR . LAYOUT_DIR_NAME, "dir") as $template_dir) {
        if (file_exists(BASE_DIR . LAYOUT_DIR_NAME . "/" . $template_dir . "/template.html")) {
            updateFileName(BASE_DIR . LAYOUT_DIR_NAME . "/" . $template_dir . "/template.html", $oldnew);
        }
        if (file_exists(BASE_DIR . LAYOUT_DIR_NAME . "/" . $template_dir . "/gallerytemplate.html")) {
            updateFileName(BASE_DIR . LAYOUT_DIR_NAME . "/" . $template_dir . "/gallerytemplate.html", $oldnew);
        }
    }
    # Plugins Conf
    foreach (getDirAsArray(BASE_DIR . PLUGIN_DIR_NAME, "dir") as $plugin_dir) {
        if (file_exists(BASE_DIR . PLUGIN_DIR_NAME . "/" . $plugin_dir . "/plugin.conf.php")) {
            changeCatPageInConf(BASE_DIR . PLUGIN_DIR_NAME . "/" . $plugin_dir . "/plugin.conf.php", $oldnew);
        }
    }
}
Пример #7
0
 function make_DirGalleryArray($Galleries, $with_preview, $with_description)
 {
     #!!!!!!!!! hier muss noch nee prüfung rein das wenn galerie keine bilder hat sie erst garnich erscheint
     $GALERIE_DIR = BASE_DIR . GALLERIES_DIR_NAME . "/";
     $return_array = array();
     if ($Galleries !== false and is_array($Galleries)) {
         $galleries_array = $Galleries;
     } else {
         $galleries_array = getDirAsArray($GALERIE_DIR, "dir");
     }
     foreach ($galleries_array as $gallery) {
         $description = array();
         $gallery_images = getDirAsArray($GALERIE_DIR . $gallery, $this->allowed_pics);
         # Galerie hat keine Bilder also nicht erstellen
         if (count($gallery_images) < 1) {
             continue;
         }
         # Bildbeschreibung soll benutzt werden und texte.conf.php gibts also erzeugen
         if ($with_description === true and count($gallery_images) > 0 and file_exists($GALERIE_DIR . $gallery . "/" . "texte.conf.php")) {
             $tmp_description = new Properties($GALERIE_DIR . $gallery . "/" . "texte.conf.php");
             $description = $tmp_description->toArray();
             unset($tmp_description);
         }
         foreach ($gallery_images as $image) {
             # Bild hat kein Vorschaubild, Vorschaubilder sollen aber benutzt werden
             # dann nicht ins array
             if ($with_preview === true and !file_exists($GALERIE_DIR . $gallery . "/" . PREVIEW_DIR_NAME . "/" . $image)) {
                 continue;
             }
             #echo "$image<br>\n";
             $return_array[$gallery][$image]['preview'] = false;
             # Vorschaubilder sollen benutzt werden und Vorschaubild gibt es
             if ($with_preview === true) {
                 $return_array[$gallery][$image]['preview'] = true;
             }
             $return_array[$gallery][$image]['description'] = false;
             # Bildbeschreibung soll benutzt werden wenn vorhanden ins array
             if ($with_description === true and isset($description[$image])) {
                 $return_array[$gallery][$image]['description'] = $description[$image];
             }
         }
         # hat Galerie keine Bilder dann löschen
         if (isset($return_array[$gallery]) and count($return_array[$gallery]) < 1) {
             unset($return_array[$gallery]);
         }
     }
     return $return_array;
 }
Пример #8
0
 # mod_rewrite test
 if (getRequestValue('moderewrite', 'get') and getRequestValue('moderewrite', 'get') == "ok") {
     echo contend_template(array("home_serverinfo" => array(array('<span id="mod-rewrite-true">' . getLanguageValue("home_mod_rewrite") . '</span>', getLanguageValue("yes")))), array("home_serverinfo" => array("ok")));
     exit;
 }
 require_once BASE_DIR_ADMIN . "filesystem.php";
 if (!is_file(SORT_CAT_PAGE)) {
     $cat_page_sort_array = array();
     $cats = getDirAsArray(CONTENT_DIR_REL, "dir");
     foreach ($cats as $cat) {
         $cat_page_sort_array[$cat] = array();
         if (substr($cat, -EXT_LENGTH) == EXT_LINK) {
             $cat_page_sort_array[$cat] = "null";
             continue;
         }
         $pages = getDirAsArray(CONTENT_DIR_REL . $cat, "file");
         foreach ($pages as $page) {
             $cat_page_sort_array[$cat][$page] = "null";
         }
     }
     $sort_array = var_export($cat_page_sort_array, true);
     if (true != mo_file_put_contents(SORT_CAT_PAGE, "<?php if(!defined('IS_CMS')) die();\n\$cat_page_sort_array = " . $sort_array . ";\n?>")) {
         $message .= returnMessage(false, "Achtung kann SortCatPage nicht Schreiben");
     }
 }
 require_once BASE_DIR_CMS . 'idna_convert.class.php';
 $Punycode = new idna_convert();
 require_once BASE_DIR_CMS . "CatPageClass.php";
 $CatPage = new CatPageClass();
 $GALLERY_CONF = new Properties(BASE_DIR_CMS . CONF_DIR_NAME . "/gallery.conf.php");
 $USER_SYNTAX = new Properties(BASE_DIR_CMS . CONF_DIR_NAME . "/syntax.conf.php");
Пример #9
0
function findPlugins()
{
    $activ_plugins = array();
    $deactiv_plugins = array();
    $plugin_first = array();
    global $page_protect_search;
    // alle Plugins einlesen
    foreach (getDirAsArray(PLUGIN_DIR_REL, "dir") as $plugin) {
        # nach schauen ob das Plugin active ist
        if (file_exists(PLUGIN_DIR_REL . $plugin . "/plugin.conf.php") and file_exists(PLUGIN_DIR_REL . $plugin . "/index.php")) {
            if (false === ($conf_plugin = file_get_contents(PLUGIN_DIR_REL . $plugin . "/plugin.conf.php"))) {
                die("Fatal Error Can't read file: " . $plugin . "/plugin.conf.php");
            }
            $conf_plugin = str_replace($page_protect_search, "", $conf_plugin);
            $conf_plugin = trim($conf_plugin);
            $conf_plugin = unserialize($conf_plugin);
            if (isset($conf_plugin["active"]) and $conf_plugin["active"] == "true") {
                # array fuehlen mit activen Plugin Platzhalter
                $activ_plugins[] = $plugin;
                if (isset($conf_plugin["plugin_first"]) and $conf_plugin["plugin_first"] === "true") {
                    $plugin_first[] = $plugin;
                }
            } else {
                # array fuehlen mit deactivierte Plugin Platzhalter
                $deactiv_plugins[] = $plugin;
            }
            # plugin gibts aber es gibt noch keine plugin.conf.php
        } elseif (file_exists(PLUGIN_DIR_REL . $plugin . "/index.php")) {
            $deactiv_plugins[] = $plugin;
        }
        unset($conf_plugin);
    }
    return array($activ_plugins, $deactiv_plugins, $plugin_first);
}
Пример #10
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;
}
Пример #11
0
 protected function get_file_objects()
 {
     if (ACTION == "gallery" or ACTION == "template") {
         #!!!!!!!!!!! das global machen
         $file_array = getDirAsArray($this->options['upload_dir'], $this->alowed_img_array);
     } else {
         global $CatPage;
         $file_array = $CatPage->get_FileArray($this->options['curent_dir']);
     }
     return array_values(array_filter(array_map(array($this, 'get_file_object'), $file_array)));
 }
Пример #12
0
function updateTemplateCSS($dir)
{
    global $css_new, $css_replace;
    $tmp_css_new = $css_new;
    $css_files = getDirAsArray($dir . 'css', array(".css"), "none");
    if (count($css_files) < 1) {
        return;
    }
    foreach ($css_files as $file) {
        $content = file_get_contents($dir . 'css/' . $file);
        $tmp_content = $content;
        foreach ($tmp_css_new as $key => $value) {
            if (strpos($content, $key) !== false) {
                unset($tmp_css_new[$key]);
            } elseif (count($css_files) == 1) {
                $tmp_content .= $tmp_css_new[$key];
                unset($tmp_css_new[$key]);
            }
        }
        foreach ($css_replace as $key => $value) {
            $tmp_content = str_replace($key, $value, $tmp_content);
        }
        if ($tmp_content != $content) {
            file_put_contents($dir . 'css/' . $file, $tmp_content, LOCK_EX);
        }
    }
    if (isset($tmp_css_new) and count($tmp_css_new) > 0) {
        if (in_array("style.css", $css_files)) {
            $file = 'style.css';
        } else {
            $file = $css_files[0];
        }
        $content = file_get_contents($dir . 'css/' . $file);
        foreach ($tmp_css_new as $key => $value) {
            $content .= $tmp_css_new[$key];
        }
        file_put_contents($dir . 'css/' . $file, $content, LOCK_EX);
    }
}
Пример #13
0
 private function make_DirCatPageArray($dir)
 {
     global $CMS_CONF;
     $draft_modus = false;
     $draft_cat = "";
     if (!IS_ADMIN and getRequestValue('draft') != "true" and $CMS_CONF->get("draftmode") == "true") {
         $draft_modus = true;
         $draft_cat = $CMS_CONF->get("defaultcat");
     }
     $cat_a = array();
     $cat_sort = array();
     $currentdir = getDirAsArray($dir, "dir", "sort_cat_page");
     foreach ($currentdir as $file) {
         if ($draft_modus and $draft_cat != $file) {
             continue;
         }
         if (substr($file, -EXT_LENGTH) == EXT_LINK) {
             $target = "-_blank-";
             if (strpos($file, "-_self-") > 1) {
                 $target = "-_self-";
             }
             $tmp = explode($target, $file);
             $cat_a[$tmp[0]]["_name-"] = $tmp[0];
             $cat_a[$tmp[0]]["_orgname-"] = $cat_a[$tmp[0]]["_name-"];
             $cat_a[$tmp[0]]["_type-"] = EXT_LINK;
             $url = str_replace($this->link_search, $this->link_replace, substr($tmp[1], 0, strlen($tmp[1]) - EXT_LENGTH));
             $cat_a[$tmp[0]]["_link-"] = $url;
             $cat_a[$tmp[0]]["_target-"] = str_replace("-", "", $target);
         } else {
             $cat_a[$file]['_pages-'] = $this->make_DirPageArray($dir . "/" . $file);
             $cat_a[$file]["_name-"] = $file;
             $cat_a[$file]["_orgname-"] = $cat_a[$file]["_name-"];
             $cat_a[$file]["_type-"] = "cat";
             $cat_a[$file]["_files-"] = getDirAsArray($dir . "/" . $file . "/" . CONTENT_FILES_DIR_NAME, "file");
             $cat_a[$file]["_time-"] = filemtime($dir . "/" . $file);
             $cat_a[$file]["_protect-"] = false;
         }
     }
     return $cat_a;
 }
Пример #14
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;
}
Пример #15
0
function userSettings($name)
{
    global $ADMIN_CONF;
    if ($name == "tabs") {
        global $array_tabs;
        $selectarray = $array_tabs;
    } elseif ($name == "admin") {
        $selectarray = makeDefaultConf("basic");
        $selectarray = $selectarray["expert"];
    } elseif ($name == "config") {
        $selectarray = makeDefaultConf("main");
        $selectarray = $selectarray["expert"];
    }
    $test = $ADMIN_CONF->get($name);
    if (!is_array($test)) {
        $test = array();
    }
    if ($name != "plugins" and $name != "template") {
        $select = '<div class="mo-select-div"><select title="' . getLanguageValue("admin_noroot_" . $name) . '" name="' . $name . '[]" multiple="multiple" class="mo-select js-multi js-noroot-' . $name . '">';
        foreach ($selectarray as $key) {
            $select_text = getLanguageValue("admin_user_select_" . $key);
            if ($name == "tabs") {
                $select_text = getLanguageValue($key . "_button");
            }
            $selected = "";
            if (in_array($key, $test)) {
                $selected = ' selected="selected"';
            }
            $select .= '<option value="' . $key . '"' . $selected . '>' . $select_text . '</option>';
        }
        $select .= '</select></div>';
    }
    if ($name == "plugins") {
        $plugins = getDirAsArray(PLUGIN_DIR_REL, "dir", "natcasesort");
        $select = '<div class="mo-select-div"><select title="' . getLanguageValue("admin_noroot_" . $name) . '" name="' . $name . '[]" multiple="multiple" class="mo-select js-multi js-noroot-' . $name . '">';
        $selected = "";
        # Achtung plugin_-_manage ist deshalb so damit die Gefahr das es ein Plugin mit diesen name gibt so klein wie möglich ist
        if (in_array("plugin_-_manage", $test)) {
            $selected = ' selected="selected"';
        }
        $select .= '<option value="plugin_-_manage"' . $selected . '>' . getLanguageValue("plugins_title_manage") . '</option>';
        $select_option = "";
        foreach ($plugins as $plugin) {
            $selected = "";
            if (in_array($plugin, $test)) {
                $selected = ' selected="selected"';
            }
            $select_option .= '<option value="' . $plugin . '"' . $selected . '>' . $plugin . '</option>';
        }
        if (!empty($select_option)) {
            $select .= '<optgroup label="Plugins">' . $select_option . '</optgroup>';
        }
        $select .= '</select></div>';
    }
    if ($name == "template") {
        $select = '<div class="mo-select-div"><select title="' . getLanguageValue("admin_noroot_" . $name) . '" name="' . $name . '[]" multiple="multiple" class="mo-select js-multi js-noroot-' . $name . '">';
        $tmp = array("template_manage" => getLanguageValue("template_title_manage"), "template_edit" => str_replace("{TemplateName}", "", getLanguageValue("template_title_template")), "template_plugin_css" => getLanguageValue("template_title_plugins"));
        foreach ($tmp as $option => $text) {
            $selected = "";
            if (in_array($option, $test)) {
                $selected = ' selected="selected"';
            }
            $select .= '<option value="' . $option . '"' . $selected . '>' . $text . '</option>';
        }
        $select .= '</select></div>';
    }
    return $select;
}