public function get($secname, $pname, $default = null)
 {
     if (!isset($this->_props)) {
         $this->load();
     }
     return parent::get($secname, $pname, $default);
 }
 public function getDetailed($criterion = null)
 {
     $Properties = new Properties();
     $featured_properties = $this->get($criterion);
     foreach ($featured_properties as &$featured_property) {
         $featured_property = $Properties->get($featured_property->property_id);
     }
     return $featured_properties;
 }
Exemple #3
0
 function testGetBool()
 {
     global $UBAR_GLOB;
     $path = $UBAR_GLOB['UBAR_ROOT'] . "test" . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "sample.properties";
     $pathToPropertiesClass = $UBAR_GLOB['UBAR_ROOT'] . "core" . DIRECTORY_SEPARATOR . "Properties.php";
     $props = new Properties($path);
     // test valid
     $this->assertEquals(TRUE, $props->getBool("sample.boolean"));
     // test unable to convert (other errors covered in test_get()
     try {
         $props->getBool("sample.badboolean");
         $this->fail("Expected exception trying to get property you can't convert to bool.");
     } catch (Exception $e) {
         $value = $props->get("sample.badboolean");
         $expectedMessage = "The property found, " . $value . ", with the key \"sample.badboolean\" could not be converted to a boolean value in the file \"{$path}\".";
         $this->assertEquals($expectedMessage, $e->getMessage());
     }
 }
Exemple #4
0
function gallery()
{
    global $specialchars;
    global $ADMIN_CONF;
    global $CatPage;
    global $GALLERY_CONF;
    if (false !== ($changeart = getRequestValue('changeart', 'post'))) {
        header('content-type: text/html; charset=' . CHARSET . '');
        if ($changeart == "gallery_new") {
            if (false !== ($galleryname = getRequestValue('galleryname', 'post'))) {
                echo newGallery($galleryname);
            }
            exit;
        } elseif ($changeart == "gallery_del") {
            if (false !== ($galleryname = getRequestValue('galleryname', 'post'))) {
                echo deleteGallery($galleryname);
            }
            exit;
        } elseif ($changeart == "gallery_rename") {
            if (false !== ($galleryname = getRequestValue('galleryname', 'post')) and false !== ($gallerynewname = getRequestValue('gallerynewname', 'post'))) {
                echo renameGallery($galleryname, $gallerynewname);
            }
            exit;
        } elseif ($changeart == "gallery_size") {
            if (false !== ($new_global_width = getRequestValue('new_global_width', 'post')) and false !== ($new_global_height = getRequestValue('new_global_height', 'post')) and (ctype_digit($new_global_width) or ctype_digit($new_global_height) or $new_global_width == "auto" or $new_global_height == "auto" or $new_global_width == "" or $new_global_height == "")) {
                $GALLERY_CONF->set("maxwidth", $new_global_width);
                $GALLERY_CONF->set("maxheight", $new_global_height);
                ajax_return("success", true);
            } elseif (false !== ($thumbnail_global_max_width = getRequestValue('thumbnail_global_max_width', 'post')) and false !== ($thumbnail_global_max_height = getRequestValue('thumbnail_global_max_height', 'post')) and (ctype_digit($thumbnail_global_max_width) or ctype_digit($thumbnail_global_max_height or $new_global_width == "" or $new_global_height == ""))) {
                $GALLERY_CONF->set("maxthumbwidth", $thumbnail_global_max_width);
                $GALLERY_CONF->set("maxthumbheight", $thumbnail_global_max_height);
                ajax_return("success", true);
            } else {
                ajax_return("error", true, returnMessage(false, getLanguageValue("properties_error_save")), true, true);
            }
        } elseif ($changeart == "gallery_subtitle") {
            if (false !== ($subtitle = getRequestValue('subtitle', 'post', false)) and false !== ($curent_dir = getRequestValue('curent_dir', 'post')) and false !== ($file = getRequestValue('file', 'post'))) {
                if (!is_file(GALLERIES_DIR_REL . $curent_dir . "/texte.conf.php") and false === newConf(GALLERIES_DIR_REL . $curent_dir . "/texte.conf.php")) {
                    ajax_return("error", true, returnMessage(false, getLanguageValue("gallery_error_subtitle_conf")), true, true);
                }
                $tmp = new Properties(GALLERIES_DIR_REL . $curent_dir . "/texte.conf.php");
                $tmp->set($file, $subtitle);
                ajax_return("success", true);
            }
            exit;
        } elseif ($changeart == "file_rename") {
            if (false !== ($newfile = getRequestValue('newfile', 'post')) and false !== ($orgfile = getRequestValue('orgfile', 'post')) and false !== ($curent_dir = getRequestValue('curent_dir', 'post'))) {
                $dir = GALLERIES_DIR_REL . $curent_dir . "/";
                if (true !== ($error = moveFileDir($dir . $orgfile, $dir . $newfile, true))) {
                    ajax_return("error", true, $error, true, "js-dialog-reload");
                }
                $dir = GALLERIES_DIR_REL . $curent_dir . "/" . PREVIEW_DIR_NAME . "/";
                if (true !== ($error = moveFileDir($dir . $orgfile, $dir . $newfile, true))) {
                    ajax_return("error", true, $error, true, "js-dialog-reload");
                }
                $tmp = new Properties(GALLERIES_DIR_REL . $curent_dir . "/texte.conf.php");
                $tmp->set($newfile, $tmp->get($orgfile));
                $tmp->delete($orgfile);
                ajax_return("success", true);
            }
            exit;
        } elseif ($changeart == "gallery_ftp") {
            changeFromFtp();
        } else {
            exit;
        }
    }
    if (getRequestValue('chancefiles') == "true") {
        require_once BASE_DIR_ADMIN . "jquery/File-Upload/upload.class.php";
        exit;
    }
    $dircontent = getDirAsArray(GALLERIES_DIR_REL, "dir", "sort");
    $pagecontent = "";
    require_once BASE_DIR_ADMIN . "jquery/File-Upload/fileupload.php";
    $pagecontent .= '<ul class="js-gallery mo-ul">';
    foreach ($dircontent as $pos => $currentgalerien) {
        $pagecontent .= '<li class="js-file-dir mo-li ui-widget-content ui-corner-all">';
        $pagecontent .= getFileUpload($currentgalerien, $specialchars->rebuildSpecialChars($currentgalerien, false, true), getLanguageValue("images"));
        $pagecontent .= '</li>';
    }
    $pagecontent .= '</ul>';
    $new_gallery = '<ul class="js-new-gallery mo-ul new-gallery">';
    $new_gallery .= '<li class="js-file-dir mo-li ui-widget-content ui-corner-all">';
    $new_gallery .= getFileUpload($specialchars->rebuildSpecialChars(getLanguageValue("gallery_name_new"), false, true), getLanguageValue("gallery_name_new"), getLanguageValue("images"), " mo-hidden");
    $new_gallery .= '</li>';
    $new_gallery .= '</ul>';
    $max_img = '<input type="text" name="new_global_width" value="' . $GALLERY_CONF->get('maxwidth') . '" size="4" maxlength="4" class="mo-input-digit js-in-digit-auto" /> x <input type="text" name="new_global_height" value="' . $GALLERY_CONF->get('maxheight') . '" size="4" maxlength="4" class="mo-input-digit js-in-digit-auto" /> ' . getLanguageValue("pixels");
    $max_prev_img = '<input type="text" name="thumbnail_global_max_width" value="' . $GALLERY_CONF->get('maxthumbwidth') . '" size="4" maxlength="4" class="mo-input-digit js-in-digit" /> x <input type="text" name="thumbnail_global_max_height" value="' . $GALLERY_CONF->get('maxthumbheight') . '" size="4" maxlength="4" class="mo-input-digit js-in-digit" /> ' . getLanguageValue("pixels");
    $titel = "gallery_help_conf";
    $template[$titel]["toggle"] = true;
    $template[$titel][] = array(getLanguageValue("gallery_scale"), $max_img);
    $template[$titel][] = array(getLanguageValue("gallery_scale_thumbs"), $max_prev_img);
    $ftp_form = '<form action="index.php?action=' . ACTION . '" method="post">';
    $ftp_form .= '<input type="hidden" name="changeart" value="gallery_ftp" />';
    $ftp_form .= '<input type="submit" value="' . getLanguageValue("gallery_text_from_ftp_button") . '" />';
    $ftp_form .= '</form>';
    $template[$titel][] = array(getLanguageValue("gallery_text_from_ftp"), $ftp_form);
    return array(contend_template($template) . $pagecontent, $new_gallery);
}
Exemple #5
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;
}
 /**
  * Main method parses the XML files and creates SQL files.
  *
  * @return void
  * @throws Exception If there is an error parsing the data xml.
  */
 public function main()
 {
     $this->validate();
     $targetDatabase = $this->getTargetDatabase();
     $platform = $this->getPlatformForTargetDatabase();
     // Load the Data XML -> DB Name properties
     $map = new Properties();
     try {
         $map->load($this->getDataDbMap());
     } catch (IOException $ioe) {
         throw new BuildException("Cannot open and process the datadbmap!", $ioe);
     }
     DataModelBuilder::setBuildProperties($this->getPropelProperties());
     // Parse each file in teh data -> db map
     foreach ($map->keys() as $dataXMLFilename) {
         $dataXMLFile = new PhingFile($this->srcDir, $dataXMLFilename);
         // if file exists then proceed
         if ($dataXMLFile->exists()) {
             $dbname = $map->get($dataXMLFilename);
             $db = $this->getDatabase($dbname);
             if (!$db) {
                 throw new BuildException("Cannot find instantiated Database for name '{$dbname}' from datadbmap file.");
             }
             $db->setPlatform($platform);
             $outFile = $this->getMappedFile($dataXMLFilename);
             $this->log("Creating SQL from XML data dump file: " . $dataXMLFile->getAbsolutePath());
             try {
                 $dataXmlParser = new XmlToData($db, $this->dbEncoding);
                 $data = $dataXmlParser->parseFile($dataXMLFile->getAbsolutePath());
             } catch (Exception $e) {
                 throw new Exception("Exception parsing data XML: " . $e->getMessage());
             }
             $fp = fopen($outFile->getAbsolutePath(), 'w');
             $currTable = null;
             foreach ($data as $dataRow) {
                 if ($currTable !== $dataRow->getTable()) {
                     $currTable = $dataRow->getTable();
                     $builder = DataModelBuilder::builderFactory($currTable, 'datasql');
                 }
                 $sql = $builder->buildRowSql($dataRow);
                 fwrite($fp, $sql);
             }
             fclose($fp);
             // Place the generated SQL file(s)
             $p = new Properties();
             if ($this->getSqlDbMap()->exists()) {
                 $p->load($this->getSqlDbMap());
             }
             $p->setProperty($outFile->getName(), $db->getName());
             $p->store($this->getSqlDbMap(), "Sqlfile -> Database map");
         } else {
             $this->log("File '" . $dataXMLFile->getAbsolutePath() . "' in datadbmap does not exist, so skipping it.", PROJECT_MSG_WARN);
         }
     }
     // foreach data xml file
 }
Exemple #7
0
 *
 * @see GlobalConstants::DEV_MODE
 */
if (!isset($UBAR_GLOB['DEV_MODE'])) {
    $UBAR_GLOB['DEV_MODE'] = $props->getBool('DEV_MODE', GlobalConstants::DEV_MODE);
}
/**
 * Define a property appender based on dev mode to simplify the dev mode value
 * retrieval
 */
$UBAR_GLOB['PROP_APPEND'] = $UBAR_GLOB['DEV_MODE'] ? '_DEV_MODE' : '';
/**
 * Define the default locale.
 * @see GlobalConstants::LOCALE_DEFAULT
 */
$UBAR_GLOB['LOCALE_DEFAULT'] = $props->get('LOCALE_DEFAULT', GlobalConstants::LOCALE_DEFAULT);
/**
 * Define display errors flag.
 * @see GlobalConstants::DISPLAY_ERRORS
 */
$UBAR_GLOB['DISPLAY_ERRORS'] = $props->getBool('DISPLAY_ERRORS', GlobalConstants::DISPLAY_ERRORS);
/**
 * Define display html errors (vs plain text).
 * @see GlobalConstants::HTML_ERRORS
 */
$UBAR_GLOB['HTML_ERRORS'] = $props->getBool('HTML_ERRORS', GlobalConstants::HTML_ERRORS);
/**
 * Define error display level. Currently unused.
 * @see GlobalConstants::ERROR_LEVEL
 *
 * @todo switch to int values and make use of this
 /**
  * Main method parses the XML files and creates SQL files.
  *
  * @return void
  * @throws Exception      If there is an error parsing the data xml.
  * @throws BuildException
  */
 public function main()
 {
     $this->validate();
     $targetDatabase = $this->getTargetDatabase();
     $platform = $this->getGeneratorConfig()->getConfiguredPlatform();
     // Load the Data XML -> DB Name properties
     $map = new Properties();
     try {
         $map->load($this->getDataDbMap());
     } catch (IOException $ioe) {
         throw new BuildException("Cannot open and process the datadbmap!", $ioe);
     }
     // Parse each file in the data -> db map
     foreach ($map->keys() as $dataXMLFilename) {
         $dataXMLFile = new PhingFile($this->srcDir, $dataXMLFilename);
         // if file exists then proceed
         if ($dataXMLFile->exists()) {
             $dbname = $map->get($dataXMLFilename);
             $db = $this->getDatabase($dbname);
             if (!$db) {
                 throw new BuildException("Cannot find instantiated Database for name '{$dbname}' from datadbmap file.");
             }
             $db->setPlatform($platform);
             $outFile = $this->getMappedFile($dataXMLFilename);
             $sqlWriter = new FileWriter($outFile);
             $this->log("Creating SQL from XML data dump file: " . $dataXMLFile->getAbsolutePath());
             try {
                 $dataXmlParser = new XmlToDataSQL($db, $this->getGeneratorConfig(), $this->dbEncoding);
                 $dataXmlParser->transform($dataXMLFile, $sqlWriter);
             } catch (Exception $e) {
                 throw new BuildException("Exception parsing data XML: " . $e->getMessage(), $x);
             }
             // Place the generated SQL file(s)
             $p = new Properties();
             if ($this->getSqlDbMap()->exists()) {
                 $p->load($this->getSqlDbMap());
             }
             $p->setProperty($outFile->getName(), $db->getName());
             $p->store($this->getSqlDbMap(), "Sqlfile -> Database map");
         } else {
             $this->log("File '" . $dataXMLFile->getAbsolutePath() . "' in datadbmap does not exist, so skipping it.", Project::MSG_WARN);
         }
     }
     // foreach data xml file
 }
Exemple #9
0
$Punycode = new idna_convert();
require_once BASE_DIR_CMS . "Language.php";
$language = new Language();
setTimeLocale($language);
$activ_plugins = array();
$deactiv_plugins = array();
$plugin_first = array();
# Vorhandene Plugins finden und in array $activ_plugins und $deactiv_plugins einsetzen
# wird für Search und Pluginplatzhaltern verwendet
list($activ_plugins, $deactiv_plugins, $plugin_first) = findPlugins();
require_once BASE_DIR_CMS . "Syntax.php";
require_once BASE_DIR_CMS . "Smileys.php";
$syntax = new Syntax();
$smileys = new Smileys(BASE_DIR_CMS . "smileys");
require_once BASE_DIR_CMS . "Plugin.php";
$tmp_layout = $CMS_CONF->get("cmslayout");
if ($CMS_CONF->get("draftmode") == "true" and $CMS_CONF->get("draftlayout") != "false" and getRequestValue('draft') != "true") {
    $tmp_layout = $CMS_CONF->get("draftlayout");
}
$LAYOUT_DIR = LAYOUT_DIR_NAME . "/" . $tmp_layout;
$TEMPLATE_FILE = $LAYOUT_DIR . "/template.html";
$LAYOUT_DIR_URL = $specialchars->replaceSpecialChars(URL_BASE . $LAYOUT_DIR, true);
if ($CMS_CONF->get("usecmssyntax") == "false") {
    define("USE_CMS_SYNTAX", false);
} else {
    define("USE_CMS_SYNTAX", true);
}
if (getRequestValue('draft') == "true") {
    define("DRAFT", true);
} else {
    define("DRAFT", false);
Exemple #10
0
// Properties Class
require_once BASE_DIR_CMS . "Properties.php";
// Language Class
require_once BASE_DIR_CMS . "Language.php";
require_once BASE_DIR_ADMIN . "filesystem.php";
require_once BASE_DIR_CMS . "SpecialChars.php";
$specialchars = new SpecialChars();
foreach ($LANG_INSTALL as $lang => $tmp) {
    if (!is_file(BASE_DIR_ADMIN . LANGUAGE_DIR_NAME . "/language_" . $lang . ".txt")) {
        unset($LANG_INSTALL[$lang]);
    }
}
if (is_file(BASE_DIR_ADMIN . CONF_DIR_NAME . '/basic.conf.php') and isFileRW(BASE_DIR_ADMIN . CONF_DIR_NAME . '/basic.conf.php')) {
    $ADMIN_CONF = new Properties(BASE_DIR_ADMIN . CONF_DIR_NAME . '/basic.conf.php');
}
if ($ADMIN_CONF !== false and (!isset($_POST['language']) or $_POST['language'] == "false") and is_file(BASE_DIR_ADMIN . LANGUAGE_DIR_NAME . "/language_" . $ADMIN_CONF->get('language') . ".txt")) {
    $LANG_TMP = $ADMIN_CONF->get('language');
}
$LANG = new Language(BASE_DIR_ADMIN . LANGUAGE_DIR_NAME . "/language_" . $LANG_TMP . ".txt");
if (is_file(BASE_DIR_CMS . CONF_DIR_NAME . '/main.conf.php') and isFileRW(BASE_DIR_CMS . CONF_DIR_NAME . '/main.conf.php')) {
    $CMS_CONF = new Properties(BASE_DIR_CMS . CONF_DIR_NAME . '/main.conf.php');
    setTimeLocale($LANG);
}
session_start();
ini_set("default_charset", CHARSET);
header('content-type: text/html; charset=' . strtolower(CHARSET));
$steps = array("help", "language", "chmod_test", "environment", "rewrite", "password", "finish");
$html_check_update = '';
if (is_file("update.php")) {
    require_once "update.php";
    $steps = array("help", "language", "chmod_test", "environment", "rewrite", "password", "update", "finish");
Exemple #11
0
 unset($users_array[$id]);
 # die refresh ajax anfrage
 #!!!!!!!!!!!!!! kann gelöscht werden wenn ich das mit dem neuen multi mode fertig habe
 /*        if(getRequestValue('refresh_session') == "true") {
             $hidden_action = "";
             foreach($users_array as $action) {
                 if($action == "home" or $action == "login") continue;
                 if(in_array($action,$array_tabs))
                     $hidden_action .= ",".$action;
             }
             if(strlen($hidden_action) > 1)
                 $hidden_action = substr($hidden_action,1);
             exit($hidden_action);
         }*/
 # es gab ein redirect
 if (false !== ($tmp = strstr($USERS->get($id), "#"))) {
     $tmp = substr($tmp, 1);
     $message .= returnMessage(false, getLanguageValue("error_multi_user_tab", false, getLanguageValue($tmp . "_button"), MULTI_USER_TIME));
     $USERS->set($id, $tmp);
     # nur reingehen bei click auf eins der tabs
 } elseif (getRequestValue('multi', 'get') and $tmp_action != "home" and in_array($tmp_action, $array_tabs)) {
     if ("freetab" == ($tmp = $USERS->get($id))) {
         $tmp = "home";
     }
     $url = $_SERVER['HTTP_HOST'] . URL_BASE . ADMIN_DIR_NAME . '/index.php?nojs=true&amp;action=' . $tmp . '&amp;multi=true';
     $USERS->set($id, $tmp_action);
     # seite besetzt
     if (in_array($tmp_action, $users_array)) {
         $USERS->set($id, "busy#" . $tmp_action);
         header("Location: http://{$url}");
         exit;
Exemple #12
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;
}
Exemple #13
0
 function getInfo()
 {
     global $ADMIN_CONF;
     global $lang_contact_admin;
     $dir = PLUGIN_DIR_REL . "CONTACT/";
     $language = $ADMIN_CONF->get("language");
     $lang_contact_admin = new Properties($dir . "sprachen/admin_language_" . $language . ".txt", false);
     $info = array("<b>CONTACT</b>", "2.0", $lang_contact_admin->get("config_help_contact"), "mozilo", "", array('{CONTACT}' => $lang_contact_admin->get("toolbar_platzhalter_CONTACT")));
     return $info;
 }
Exemple #14
0
function makeCONTACTSetings($file)
{
    if (is_file($file)) {
        $CONTACT = new Properties($file);
    } else {
        return;
    }
    if (!$CONTACT->get('formularmail')) {
        global $ADMIN_CONF;
        if ($ADMIN_CONF->get('adminmail')) {
            $CONTACT->set('formularmail', str_replace("%40", "@", $ADMIN_CONF->get('adminmail')));
        }
    }
    if (is_file(BASE_DIR . 'update/formular.conf')) {
        $tmp_conf = getTextConf(BASE_DIR . 'update/formular.conf');
        mo_unlink(BASE_DIR . 'update/formular.conf');
        foreach ($tmp_conf as $name => $value) {
            $tmp_set = explode(",", $value);
            $tmp_name = "";
            $tmp_show = "";
            $tmp_mandatory = "";
            if ($tmp_set[count($tmp_set) - 1] and $tmp_set[count($tmp_set) - 1] == "true") {
                $tmp_mandatory = "true";
            }
            if ($tmp_set[count($tmp_set) - 2] and $tmp_set[count($tmp_set) - 2] == "true") {
                $tmp_show = "true";
            }
            if (count($tmp_set) == 3) {
                $tmp_name = $tmp_set[0];
            }
            $CONTACT->set('titel_' . $name, $tmp_name);
            $CONTACT->set('titel_' . $name . '_show', $tmp_show);
            $CONTACT->set('titel_' . $name . '_mandatory', $tmp_mandatory);
        }
    }
    if (is_file(BASE_DIR . 'update/aufgaben.conf')) {
        $tmp_conf = getTextConf(BASE_DIR . 'update/aufgaben.conf');
        mo_unlink(BASE_DIR . 'update/aufgaben.prop');
        $tmp_set = array();
        foreach ($tmp_conf as $name => $value) {
            $tmp_set[] = $name . ' = ' . $value;
        }
        if (count($tmp_set) > 0) {
            $CONTACT->set('contactformcalcs', implode('<br />', $tmp_set));
        }
    }
}
Exemple #15
0
 function getConfig()
 {
     global $ADMIN_CONF;
     global $CatPage;
     if (IS_ADMIN and $this->settings->get("plugin_first") !== "true") {
         $this->settings->set("plugin_first", "true");
     }
     if (file_exists(BASE_DIR . PLUGIN_DIR_NAME . "/MenuSubs/lang/conf_" . $ADMIN_CONF->get("language") . ".txt")) {
         $conf_txt = new Properties(BASE_DIR . PLUGIN_DIR_NAME . "/MenuSubs/lang/conf_" . $ADMIN_CONF->get("language") . ".txt");
     } else {
         $conf_txt = new Properties(BASE_DIR . PLUGIN_DIR_NAME . "/MenuSubs/lang/conf_deDE.txt");
     }
     // Das muß auf jeden Fall geschehen!
     $config = array();
     $descriptions = array("no_menusubs_2" => $conf_txt->get("no_menusubs_2"));
     $cat_array = $CatPage->get_CatArray(false, false, array(EXT_PAGE, EXT_HIDDEN));
     foreach ($cat_array as $cat) {
         if (strpos($cat, "%2F") !== false) {
             continue;
         }
         $descriptions[FILE_START . $cat . FILE_END] = $CatPage->get_HrefText($cat, false);
     }
     $config['menusubs_2'] = array("type" => "select", "description" => $conf_txt->get("menusubs_2"), "descriptions" => $descriptions, "multiple" => "false");
     $config['sitemap_show_menu2'] = array("type" => "checkbox", "description" => $conf_txt->get("sitemap_show_menu2"));
     $config['breadcrumb_delimiter'] = array("type" => "text", "maxlength" => "10", "size" => "10", "description" => 'Trennzeichen der Brotkrümel Einträge. Default ist "»"');
     return $config;
 }
Exemple #16
0
 function getInfo()
 {
     global $ADMIN_CONF;
     global $lang_gallery_admin;
     $dir = PLUGIN_DIR_REL . "Galerie/";
     $language = $ADMIN_CONF->get("language");
     $lang_gallery_admin = new Properties($dir . "sprachen/admin_language_" . $language . ".txt", false);
     //         if(!isset($lang_gallery_admin->properties['readonly'])) {
     //             die($lang_gallery_admin->properties['error']);
     //         }
     $info = array("<b>" . $lang_gallery_admin->get("config_gallery_plugin_name") . "</b> \$Revision: 141 \$", "2.0", $lang_gallery_admin->get("config_gallery_plugin_desc"), "mozilo", "", array('{Galerie|}' => $lang_gallery_admin->get("config_gallery_plugin_name")));
     return $info;
 }
Exemple #17
0
function set_admin_para()
{
    global $ADMIN_CONF;
    $basic = makeDefaultConf("basic");
    unset($basic['expert']);
    foreach ($basic as $type => $type_array) {
        foreach ($basic[$type] as $syntax_name => $dumy) {
            if (false === ($syntax_value = getRequestValue($syntax_name, 'post'))) {
                continue;
            }
            if ($type == 'text') {
                if ($syntax_name == 'adminmail' and $syntax_value != "") {
                    global $specialchars;
                    if (!isMailAddressValid($specialchars->rebuildSpecialChars($syntax_value, false, false))) {
                        return ajax_return("error", false, returnMessage(false, getLanguageValue("admin_error_adminmail")), true, true);
                    }
                }
                if ($ADMIN_CONF->get($syntax_name) != $syntax_value) {
                    $ADMIN_CONF->set($syntax_name, $syntax_value);
                }
                if ($syntax_name == "language") {
                    $LANGUAGE = new Properties(BASE_DIR_ADMIN . "sprachen/language_" . $ADMIN_CONF->get("language") . ".txt");
                    return ajax_return("error", false, returnMessage(true, '<input type="button" value="' . $LANGUAGE->get("admin_messages_change_language") . '" onclick="window.location.href = \'index.php?action=' . ACTION . '\'" />'), getLanguageValue("dialog_title_messages"), true);
                }
            }
            if ($type == 'digit') {
                if ($syntax_name == 'lastbackup') {
                    continue;
                }
                $digit = trim($syntax_value);
                if ($digit != "" and $syntax_name == 'chmodnewfilesatts' and !preg_match("/^[0-7]{3}\$/", $digit)) {
                    return ajax_return("error", false, returnMessage(false, getLanguageValue("admin_error_chmodnewfilesatts")), true, true);
                } elseif ($syntax_name == 'backupmsgintervall' and ($digit == "" or $digit < 0 or $digit > 9999)) {
                    return ajax_return("error", false, returnMessage(false, getLanguageValue("admin_error_backupmsgintervall")), true, true);
                } elseif ($digit != "" and (!ctype_digit($digit) or strlen($digit) > 4)) {
                    return ajax_return("error", false, returnMessage(false, getLanguageValue("admin_error_nodigit_tolong")), true, true);
                }
                if ($ADMIN_CONF->get($syntax_name) != $digit) {
                    $ADMIN_CONF->set($syntax_name, $digit);
                }
            }
            if ($type == 'checkbox') {
                if ($syntax_value != "true" and $syntax_value != "false") {
                    return ajax_return("error", false, returnMessage(false, getLanguageValue("properties_error_save")), true, true);
                }
                # die checkbox hat immer einen anderen wert als der gespeicherte deshalb keine prüfung
                $ADMIN_CONF->set($syntax_name, $syntax_value);
            }
            if ($type == 'userexpert') {
                $ADMIN_CONF->set($syntax_name, $syntax_value);
            }
        }
    }
    return ajax_return("success", false);
}