本文整理汇总了PHP中Properties::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Properties::set方法的具体用法?PHP Properties::set怎么用?PHP Properties::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Properties
的用法示例。
在下文中一共展示了Properties::set方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gallery
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);
}
示例2: password
function password()
{
$html = "";
$status = false;
$form_errmsg = "";
// buffer für fehlermeldungen
$form_username = "";
// form abgesendet, inhalte prüfen
if (isset($_POST['pw_submit'])) {
if (!isset($_POST['username']) or !isset($_POST['password1']) or !isset($_POST['password2']) or (empty($_POST['username']) or empty($_POST['password1']) or empty($_POST['password2']))) {
$form_errmsg .= getLanguageValue("pw_error_missingvalues") . "<br />";
}
if (empty($form_errmsg)) {
$form_username = $_POST['username'];
}
// username muss mind. 5 zeichen haben
if (strlen($_POST['username']) < 5) {
$form_errmsg .= getLanguageValue("pw_error_tooshortname") . "<br />";
}
// pw-komplexität check
if (strlen($_POST['password1']) < 6 or !preg_match("/[0-9]/", $_POST['password1']) or !preg_match("/[a-z]/", $_POST['password1']) or !preg_match("/[A-Z]/", $_POST['password1'])) {
// pw nicht komplex genug
$form_errmsg .= getLanguageValue("pw_error_newpwerror") . "<br />";
}
// stimmen die eingegebenen pw überein?
if ($_POST['password1'] != $_POST['password2']) {
$form_errmsg .= getLanguageValue("pw_error_newpwmismatch") . "<br />";
}
// keine fehler, dann daten schreiben
if (empty($form_errmsg)) {
$status = true;
require_once BASE_DIR . CMS_DIR_NAME . '/PasswordHash.php';
$t_hasher = new PasswordHash(8, FALSE);
$pw = $t_hasher->HashPassword($_POST['password1']);
$loginpassword = new Properties(BASE_DIR . ADMIN_DIR_NAME . '/' . CONF_DIR_NAME . "/loginpass.conf.php");
$loginpassword->set("name", $_POST['username']);
$loginpassword->set("pw", $pw);
} else {
$form_errmsg = contend_template($form_errmsg, false);
}
}
$html = getLanguageValue("pw_text_login") . '<br /><br />' . getLanguageValue("pw_help") . '<table width="100%" cellspacing="0" border="0" cellpadding="0" class="">' . '<tr><td> </td><td class="mo-in-li-r">' . getLanguageValue("pw_titel_newname") . '</td><td class="mo-in-li-r">' . '<input type="text" class="js-in-pwroot mo-input-text" name="username" value="' . $form_username . '" />' . '</td></tr>' . '<tr><td> </td><td>' . getLanguageValue("pw_titel_newpw") . '</td><td>' . '<input type="password" class="js-in-pwroot mo-input-text" value="' . NULL . '" name="password1" />' . '</td></tr>' . '<tr><td> </td><td>' . getLanguageValue("pw_titel_newpwrepeat") . '</td><td>' . '<input type="password" class="js-in-pwroot mo-input-text" value="" name="password2" />' . '</td></tr>' . '<tr><td> </td><td> </td><td>' . '<input type="submit" name="pw_submit" value="' . getLanguageValue("button_save") . '" />' . '</td></tr>' . "</table>";
$html_ret = contend_template($html, "");
if ($status) {
$form_errmsg = getLanguageValue("admin_messages_change_password");
$form_errmsg .= '<input type="hidden" name="password" value="true" />';
$form_errmsg = contend_template($form_errmsg, true);
} elseif (isset($_POST['password']) and $_POST['password'] == "true") {
$status = true;
$form_errmsg = '<input type="hidden" name="password" value="true" />';
}
$help = contend_template(installHelp("install_password_help"), "");
#$status = true;
return array($status, $help . $form_errmsg . $html_ret);
}
示例3: plugins
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 = "&multi=true";
}
define("PLUGINADMIN_GET_URL", URL_BASE . ADMIN_DIR_NAME . "/index.php?pluginadmin=" . PLUGINADMIN . "&nojs=true&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 = "&multi=true";
}
$html_manage = "";
$plugin_manage = array();
$disabled = '';
if (!function_exists('gzopen')) {
$disabled = ' disabled="disabled"';
//.........这里部分代码省略.........
示例4: foreach
/* 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&action=' . $tmp . '&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;
}
# nur reingehen wenn action home ist oder es noch keine get parameter gibt
} elseif (getRequestValue('multi', 'get') or !getRequestValue('multi', 'get') and !$tmp_action) {
示例5: makeCONTACTSetings
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));
}
}
}