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


PHP Settings::set方法代码示例

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


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

示例1: createComponentAddSetting

 protected function createComponentAddSetting()
 {
     $form = new Form();
     $form->addText('key', 'Klíč')->setRequired('Zadejte klíč nastavení');
     $form->addText('value', 'Hodnota')->setRequired('Zadejte hodnotu nastavení');
     $form->addSubmit('send', 'Zapsat');
     $form->onSuccess[] = function (Form $f) {
         try {
             $val = $f->values;
             $this->settings->set($val->key, $val->value);
             $this->settings->push();
             //Write
             $this->logger->log('System', 'edit', "%user% změnila(a) nastavení");
             $msg = $this->flashMessage("Nastavení bylo zapsáno", 'success');
             $msg->title = 'Yehet!';
             $msg->icon = 'check';
             $this->redirect('this');
         } catch (\PDOException $e) {
             \Nette\Diagnostics\Debugger::log($e);
             $msg = $this->flashMessage("Něco se podělalo. Zkuste to prosím později.", 'danger');
             $msg->title = 'Oh shit!';
             $msg->icon = 'warning';
         }
     };
     return $form;
 }
开发者ID:sg3tester,项目名称:songator,代码行数:26,代码来源:SystemPresenter.php

示例2: updateAction

 public function updateAction()
 {
     Settings::load();
     $languages = Config::get()->languages->list;
     $start_pages = array();
     foreach ($languages as $language_id => $language) {
         $start_page = 0;
         if (isset($_POST['start-page-' . $language_id])) {
             $start_page = $this->sanitizeInteger($_POST['start-page-' . $language_id]);
         }
         $start_pages[$language_id] = $start_page;
     }
     Settings::set('startPages', $start_pages);
     $error_pages = array();
     foreach ($languages as $language_id => $language) {
         $error_page = 0;
         if (isset($_POST['error-page-' . $language_id])) {
             $error_page = $this->sanitizeInteger($_POST['error-page-' . $language_id]);
         }
         $error_pages[$language_id] = $error_page;
     }
     Settings::set('errorPages', $error_pages);
     $use_cache = $this->sanitizeBoolean(Request::postParam('use-cache', false));
     Settings::set('useCache', $use_cache);
     $cache_lifetime = $this->sanitizeInteger(Request::postParam('cache-lifetime', 0));
     Settings::set('cacheLifetime', $cache_lifetime);
     Settings::save();
     $this->success();
 }
开发者ID:pixelproduction,项目名称:PixelManagerCMS,代码行数:29,代码来源:Settings.php

示例3: save

 public static function save(\contact\Resource\ContactInfo\Map $map)
 {
     $values = self::getValues($map);
     foreach ($values as $key => $val) {
         \Settings::set('contact', $key, $val);
     }
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:7,代码来源:Map.php

示例4: loadSettings

 private static function loadSettings()
 {
     global $simpleORMSetting;
     foreach ($simpleORMSetting as $key => $value) {
         Settings::set($key, $value);
     }
 }
开发者ID:codegooglecom,项目名称:phpsimpleorm,代码行数:7,代码来源:SimpleORM_Util.php

示例5: __construct

	public function __construct()
	{
		$supported_lang	= Settings::get('supported_languages');

		$cufon_enabled	= $supported_lang[CURRENT_LANGUAGE]['direction'] !== 'rtl';
		$cufon_font		= 'qk.font.js';

		// Translators, only if the default font is incompatible with the chars of your
		// language generate a new font (link: <http://cufon.shoqolate.com/generate/>) and add
		// your case in switch bellow. Important: use a licensed font and harmonic with design

		switch (CURRENT_LANGUAGE)
		{
			case 'zh':
				$cufon_enabled	= FALSE;
				break;
			case 'ar':
				$cufon_enabled = FALSE;
				break;
			case 'he':
				$cufon_enabled	= TRUE;
			case 'ru':
				$cufon_font		= 'times.font.js';
				break;
		}

		Settings::set('theme_default', compact('cufon_enabled', 'cufon_font'));
	}
开发者ID:relinkus,项目名称:ManageFan,代码行数:28,代码来源:theme.php

示例6: execute

 function execute()
 {
     $data = $_POST;
     Settings::load('connection');
     foreach ($data as $key => $value) {
         Settings::set($key, $value, 'connection', false);
     }
     Settings::save('connection');
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:9,代码来源:connectionSettingsSave.action.php

示例7: postSettings

 public function postSettings()
 {
     $newAccountInformation = strip_tags(filter_input(INPUT_POST, 'newAccountInformation', FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_ENCODE_AMP), PHPWS_ALLOWED_TAGS);
     \Settings::set('tailgate', 'new_account_information', $newAccountInformation);
     $reply_to = filter_input(INPUT_POST, 'replyTo', FILTER_SANITIZE_EMAIL);
     if (empty($reply_to)) {
         throw new \Exception('Badly formed or empty email address');
     }
     \Settings::set('tailgate', 'reply_to', $reply_to);
 }
开发者ID:AppStateESS,项目名称:tailgate,代码行数:10,代码来源:Settings.php

示例8: save

 public static function save(PhysicalAddressResource $physical_address)
 {
     \Settings::set('contact', 'building', $physical_address->getBuilding());
     \Settings::set('contact', 'room_number', $physical_address->getRoomNumber());
     \Settings::set('contact', 'post_box', $physical_address->getPostBox());
     \Settings::set('contact', 'street', $physical_address->getStreet());
     \Settings::set('contact', 'city', $physical_address->getCity());
     \Settings::set('contact', 'state', $physical_address->getState());
     \Settings::set('contact', 'zip', $physical_address->getZip());
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:10,代码来源:PhysicalAddress.php

示例9: ajax_set_api_user_keys

 public function ajax_set_api_user_keys()
 {
     if (!$this->input->is_ajax_request()) {
         exit('Trickery is afoot.');
     }
     $status = (bool) (int) $this->input->post('status');
     // Update the setting
     Settings::set('api_user_keys', $status);
     echo json_encode(array('status' => $status));
 }
开发者ID:KosBeg,项目名称:paybay,代码行数:10,代码来源:admin.php

示例10: post

 public function post(\Request $request)
 {
     $cmd = $request->shiftCommand();
     switch ($cmd) {
         case 'toggleAllow':
             \Settings::set('pulse', 'allow_web_access', (\Settings::get('pulse', 'allow_web_access') - 1) * -1);
             $response = new \Http\SeeOtherResponse(\Server::getSiteUrl() . 'pulse/admin/');
             break;
     }
     return $response;
     exit;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:12,代码来源:PulseAdminController.php

示例11: settings

 protected function settings()
 {
     if (!$this->session->status()) {
         return $this->_response("Authentication Required", 401);
     }
     $settings = new Settings();
     if ($this->method == 'GET') {
         return $settings->get();
     } else {
         if ($this->method == 'PUT') {
             if ($this->data) {
                 return $settings->set($this->data);
             }
         }
     }
     return "";
 }
开发者ID:asjs-dev,项目名称:lab.coop,代码行数:17,代码来源:API.php

示例12: actionAdd

 public function actionAdd()
 {
     $action = 'site';
     if (count($_GET)) {
         foreach ($_GET as $key => $param) {
             $action = $key;
             break;
         }
     }
     if (!empty($_POST)) {
         $category = $_POST['category'] == 'add_new' ? $_POST['category_value'] : $_POST['category'];
         Settings::set($category, $_POST['key'], $_POST['value'], $_POST['hint'], $_POST['type']);
         $this->redirect(array('/admin/settings/' . $category));
     }
     $dataProvider = array('action' => $action);
     Yii::app()->clientScript->registerCoreScript('jquery');
     $this->render('add', $dataProvider);
 }
开发者ID:awecode,项目名称:awecms,代码行数:18,代码来源:SettingsController.php

示例13: die

        $grrSettings['ldap_champ_nom'] = $_POST['ldap_champ_nom'];
        if ($_POST['ldap_champ_prenom'] == '') {
            $_POST['ldap_champ_prenom'] = "sn";
        }
        if (!Settings::set("ldap_champ_prenom", $_POST['ldap_champ_prenom'])) {
            echo "Erreur lors de l'enregistrement de ldap_champ_prenom !<br />";
        }
        $grrSettings['ldap_champ_prenom'] = $_POST['ldap_champ_prenom'];
        if ($_POST['ldap_champ_email'] == '') {
            $_POST['ldap_champ_email'] = "sn";
        }
        if (!Settings::set("ldap_champ_email", $_POST['ldap_champ_email'])) {
            echo "Erreur lors de l'enregistrement de ldap_champ_email !<br />";
        }
        $grrSettings['ldap_champ_email'] = $_POST['ldap_champ_email'];
        if (!Settings::set("se3_liste_groupes_autorises", $_POST['se3_liste_groupes_autorises'])) {
            echo "Erreur lors de l'enregistrement de se3_liste_groupes_autorises !<br />";
        }
        $grrSettings['se3_liste_groupes_autorises'] = $_POST['se3_liste_groupes_autorises'];
    }
}
//Chargement des valeurs de la table settingS
if (!Settings::load()) {
    die("Erreur chargement settings");
}
if (isset($_POST['submit'])) {
    if (isset($_POST['login']) && isset($_POST['password'])) {
        $sql = "select upper(login) login, password, prenom, nom, statut from " . TABLE_PREFIX . "_utilisateurs where login = '" . $_POST['login'] . "' and password = md5('" . $_POST['password'] . "') and etat != 'inactif' and statut='administrateur' ";
        $res_user = grr_sql_query($sql);
        $num_row = grr_sql_count($res_user);
        if ($num_row == 1) {
开发者ID:nicolas-san,项目名称:GRRV4,代码行数:31,代码来源:admin_config_ldap.php

示例14: edit

 /**
  * Edit an existing settings item
  *
  * @return void
  */
 public function edit()
 {
     if (PYRO_DEMO) {
         $this->session->set_flashdata('notice', lang('global:demo_restrictions'));
         redirect('admin/settings');
     }
     $settings = $this->settings_m->get_many_by(array('is_gui' => 1));
     // Create dynamic validation rules
     foreach ($settings as $setting) {
         $this->validation_rules[] = array('field' => $setting->slug . (in_array($setting->type, array('select-multiple', 'checkbox')) ? '[]' : ''), 'label' => 'lang:settings:' . $setting->slug, 'rules' => 'trim' . ($setting->is_required ? '|required' : '') . ($setting->type !== 'textarea' ? '|max_length[255]' : ''));
     }
     // Set the validation rules
     $this->form_validation->set_rules($this->validation_rules);
     // Got valid data?
     if ($this->form_validation->run()) {
         $settings_stored = array();
         // Loop through again now we know it worked
         foreach ($settings as $setting) {
             $new_value = $this->input->post($setting->slug, false);
             // Store arrays as CSV
             if (is_array($new_value)) {
                 $new_value = implode(',', $new_value);
             }
             // Only update passwords if not placeholder value
             if ($setting->type === 'password' and $new_value === 'XXXXXXXXXXXX') {
                 continue;
             }
             // Dont update if its the same value
             if ($new_value != $setting->value) {
                 Settings::set($setting->slug, $new_value);
                 $settings_stored[$setting->slug] = $new_value;
             }
         }
         // Fire an event. Yay! We know when settings are updated.
         Events::trigger('settings_updated', $settings_stored);
         // Success...
         $this->session->set_flashdata('success', lang('settings:save_success'));
     } elseif (validation_errors()) {
         $this->session->set_flashdata('error', validation_errors());
     }
     redirect('admin/settings');
 }
开发者ID:blekedeg,项目名称:lbhpers,代码行数:47,代码来源:admin.php

示例15: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->load->helper('module_helper');
     // Redirect the not authorized user to the login panel. See /application/config/connect.php
     Connect()->restrict_type_redirect = array('uri' => config_item('admin_url') . '/user/login', 'flash_msg' => 'You have been denied access to %s', 'flash_use_lang' => false, 'flash_var' => 'error');
     //	$this->output->enable_profiler(true);
     // PHP standard session is mandatory for FileManager authentication
     // and other external lib
     //		session_start();
     // Librairies
     $this->connect = Connect::get_instance();
     // Current user
     $this->template['current_user'] = $this->connect->get_current_user();
     // Set the admin theme as current theme
     Theme::set_theme('admin');
     /*
      * Admin languages : Depending on installed translations in /application/languages/
      * The Admin translations are only stored in the translation file /application/languages/xx/admin_lang.php
      *
      */
     // Set admin lang codes array
     Settings::set('admin_languages', $this->settings_model->get_admin_langs());
     Settings::set('displayed_admin_languages', explode(',', Settings::get('displayed_admin_languages')));
     // Set Router's found language code as current language
     Settings::set('current_lang', config_item('language_abbr'));
     // Load the current language translations file
     $this->lang->load('admin', Settings::get_lang());
     /*
      * Modules config
      *
      */
     $this->get_modules_config();
     // Including all modules languages files
     require APPPATH . 'config/modules.php';
     $this->modules = $modules;
     foreach ($this->modules as $module) {
         $lang_file = MODPATH . $module . '/language/' . Settings::get_lang() . '/' . strtolower($module) . '_lang.php';
         if (is_file($lang_file)) {
             include $lang_file;
             $this->lang->language = array_merge($this->lang->language, $lang);
             unset($lang);
         }
     }
     /*
      * Loads all Module's addons
      *
      */
     $this->_get_modules_addons();
     // Load all modules lang files
     /*
     Look how to make Modules translations available in javascript 
     Notice : $yhis->lang object is transmitted to JS through load->view('javascript_lang')
      
     		if ( ! empty($lang_files))
     		{
     			foreach($lang_files as $l)
     			{
     				if (is_file($l))
     				{
     //					$logical_name = substr($l, strripos($l, '/') +1);
     //					$logical_name = str_replace('_lang.php', '', $logical_name);
     //					$this->lang->load($logical_name, Settings::get_lang());
     
     					include $l;
     					$this->lang->language = array_merge($this->lang->language, $lang);
     					unset($lang);
     
     				}
     			}
     		}
     */
     /*
      * Settings
      *
      */
     // @TODO : Remove this thing from the global CMS. Not more mandatory, but necessary for compatibility with historical version
     // Available menus
     // Each menu was a root node in which you can put several pages, wich are composing a menu.
     // Was never really implemented in ionize historical version, but already used as : menus[0]...
     Settings::set('menus', config_item('menus'));
     // Don't want to cache this content
     $this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
     $this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
     $this->output->set_header("Pragma: no-cache");
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:90,代码来源:MY_Controller.php


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