当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPWS_Settings::reset方法代码示例

本文整理汇总了PHP中PHPWS_Settings::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Settings::reset方法的具体用法?PHP PHPWS_Settings::reset怎么用?PHP PHPWS_Settings::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPWS_Settings的用法示例。


在下文中一共展示了PHPWS_Settings::reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postSettings

 function postSettings()
 {
     isset($_POST['enable']) ? PHPWS_Settings::set('whatsnew', 'enable', 1) : PHPWS_Settings::set('whatsnew', 'enable', 0);
     isset($_POST['homeonly']) ? PHPWS_Settings::set('whatsnew', 'homeonly', 1) : PHPWS_Settings::set('whatsnew', 'homeonly', 0);
     if (!empty($_POST['title'])) {
         PHPWS_Settings::set('whatsnew', 'title', strip_tags(PHPWS_Text::parseInput($_POST['title'])));
     } else {
         PHPWS_Settings::reset('whatsnew', 'title');
     }
     if (!empty($_POST['text'])) {
         PHPWS_Settings::set('whatsnew', 'text', PHPWS_Text::parseInput($_POST['text']));
     } else {
         PHPWS_Settings::set('whatsnew', 'text', null);
     }
     $cache_timeout = (int) $_POST['cache_timeout'];
     if ((int) $cache_timeout <= 7200) {
         PHPWS_Settings::set('whatsnew', 'cache_timeout', $cache_timeout);
     } else {
         PHPWS_Settings::reset('whatsnew', 'cache_timeout');
     }
     $qty_items = (int) $_POST['qty_items'];
     if ((int) $qty_items <= 50) {
         PHPWS_Settings::set('whatsnew', 'qty_items', $qty_items);
     } else {
         PHPWS_Settings::reset('whatsnew', 'qty_items');
     }
     isset($_POST['show_summaries']) ? PHPWS_Settings::set('whatsnew', 'show_summaries', 1) : PHPWS_Settings::set('whatsnew', 'show_summaries', 0);
     isset($_POST['show_dates']) ? PHPWS_Settings::set('whatsnew', 'show_dates', 1) : PHPWS_Settings::set('whatsnew', 'show_dates', 0);
     isset($_POST['show_source_modules']) ? PHPWS_Settings::set('whatsnew', 'show_source_modules', 1) : PHPWS_Settings::set('whatsnew', 'show_source_modules', 0);
     if (isset($_POST['exclude'])) {
         PHPWS_Settings::set('whatsnew', 'exclude', $_POST['exclude']);
     }
     if (isset($errors)) {
         $this->message = implode('<br />', $errors);
         return false;
     } else {
         PHPWS_Cache::remove('whatsnew_cache_key');
         if (PHPWS_Settings::save('whatsnew')) {
             return true;
         } else {
             return false;
         }
     }
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:44,代码来源:Whatsnew.php

示例2: postSettings

 public static function postSettings()
 {
     if (isset($_POST['show_recent'])) {
         PHPWS_Settings::set('blog', 'show_recent', $_POST['show_recent']);
     }
     isset($_POST['captcha_submissions']) ? PHPWS_Settings::set('blog', 'captcha_submissions', 1) : PHPWS_Settings::set('blog', 'captcha_submissions', 0);
     isset($_POST['home_page_display']) ? PHPWS_Settings::set('blog', 'home_page_display', 1) : PHPWS_Settings::set('blog', 'home_page_display', 0);
     isset($_POST['allow_anonymous_submits']) ? PHPWS_Settings::set('blog', 'allow_anonymous_submits', 1) : PHPWS_Settings::set('blog', 'allow_anonymous_submits', 0);
     isset($_POST['logged_users_only']) ? PHPWS_Settings::set('blog', 'logged_users_only', 1) : PHPWS_Settings::set('blog', 'logged_users_only', 0);
     isset($_POST['show_posted_date']) ? PHPWS_Settings::set('blog', 'show_posted_date', 1) : PHPWS_Settings::set('blog', 'show_posted_date', 0);
     isset($_POST['show_posted_by']) ? PHPWS_Settings::set('blog', 'show_posted_by', 1) : PHPWS_Settings::set('blog', 'show_posted_by', 0);
     if (isset($_POST['view_only']) && is_array($_POST['view_only'])) {
         $view_only = implode(':', $_POST['view_only']);
     } else {
         $view_only = null;
     }
     PHPWS_Settings::set('blog', 'view_only', $view_only);
     if (isset($_POST['simple_image'])) {
         PHPWS_Settings::set('blog', 'simple_image', 1);
         isset($_POST['mod_folders_only']) ? PHPWS_Settings::set('blog', 'mod_folders_only', 1) : PHPWS_Settings::set('blog', 'mod_folders_only', 0);
         if (!empty($_POST['max_width'])) {
             $max_width = (int) $_POST['max_width'];
             if ($max_width >= 50 && $max_width <= 2048) {
                 PHPWS_Settings::set('blog', 'max_width', $max_width);
             }
         }
         if (!empty($_POST['max_height'])) {
             $max_height = (int) $_POST['max_height'];
             if ($max_height >= 50 && $max_height <= 2048) {
                 PHPWS_Settings::set('blog', 'max_height', $max_height);
             }
         }
     } else {
         PHPWS_Settings::set('blog', 'simple_image', 0);
     }
     $past_limit = (int) $_POST['past_entries'];
     if ((int) $past_limit >= 0) {
         PHPWS_Settings::set('blog', 'past_entries', $past_limit);
     } else {
         PHPWS_Settings::reset('blog', 'past_entries');
     }
     $blog_limit = (int) $_POST['blog_limit'];
     if ((int) $blog_limit > 0) {
         PHPWS_Settings::set('blog', 'blog_limit', $blog_limit);
     } else {
         PHPWS_Settings::reset('blog', 'blog_limit');
     }
     PHPWS_Settings::set('blog', 'comment_script', $_POST['comment_script']);
     PHPWS_Settings::save('blog');
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:50,代码来源:Blog_Admin.php


注:本文中的PHPWS_Settings::reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。