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


PHP Settings::update方法代码示例

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


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

示例1: load

 public function load($templateName, $generalSettingsInstance = false)
 {
     //set default template as messy
     if (!$templateName) {
         foreach ($this->getAllTemplates() as $tpl) {
             list($template_all) = explode('-', $tpl);
             if ($template_all == 'messy') {
                 $templateName = $tpl;
                 break;
             } else {
                 $templateName = 'default';
             }
         }
         //save in settings
         $settings = new Settings(false);
         $settings->update('template', 'template', array('value' => $templateName));
         $settings->save();
     }
     $this->name = $templateName;
     $tPath = self::$options['TEMPLATES_FULL_SERVER_PATH'] . $this->name;
     if (!file_exists($tPath)) {
         $template = explode('-', $this->name);
         $template = $template[0];
         //try to get same template with different version if not exists
         foreach ($this->getAllTemplates() as $tpl) {
             list($template_all) = explode('-', $tpl);
             if ($template_all == $template) {
                 $this->name = $tpl;
                 break;
                 //default template = messy
             } else {
                 $this->name = 'default';
             }
         }
         $tPath = self::$options['TEMPLATES_FULL_SERVER_PATH'] . $this->name;
     }
     if (file_exists($tPath) && file_exists($tPath . '/template.conf.php')) {
         $this->smarty->template_dir = $tPath;
         $this->smarty->plugins_dir = array('plugins', self::$options['TEMPLATES_FULL_SERVER_PATH'] . '_plugins', $tPath . '/plugins');
         list($this->sectionTypes, $this->settingsDefinition) = (include $tPath . '/template.conf.php');
         $this->templateHTML = @file_get_contents($tPath . '/template.tpl');
         $this->templateFile = $tPath . '/template.tpl';
         $this->settings = new Settings($this->settingsDefinition, $generalSettingsInstance, $this->name);
         // instantiate settings for each section type definition (extend $this->settings)
         reset($this->sectionTypes);
         while (list($tName, $t) = each($this->sectionTypes)) {
             $this->sectionTypes[$tName]['settings'] = new Settings(false, $this->settings, false, isset($t['settings']) ? $t['settings'] : false);
         }
         return true;
     }
     return false;
 }
开发者ID:DhariniJeeva,项目名称:berta,代码行数:52,代码来源:class.bertatemplate.php

示例2: update

 function update()
 {
     $params = $this->input->post();
     $obj = new Settings();
     $obj->update($params);
 }
开发者ID:pojok-webdev,项目名称:pattimura,代码行数:6,代码来源:app_settings.php

示例3: Notifier

<?php

// KioCMS - Kiofol Content Managment System
// modules/guestbook/admin/settings.php
$note = new Notifier();
$err = new Errors();
$save = $_POST['save'] ? true : false;
$form = $save ? $_POST['form'] : $guestbook;
$form['bbcode'] = $save ? $_POST['bbcode'] : $guestbook['bbcode'] ? 1 : 0;
$form['allow_signatures'] = $save ? $_POST['allow_signatures'] : $guestbook['allow_signatures'] ? 1 : 0;
$form['blocks'] = $save ? array_diff($blocks, $_POST['blocks']) : ($guestbook['blocks'] ? explode(',', trim($guestbook['blocks'])) : '');
if ($save) {
    // Errors
    $err->message_max_empty(t('ERROR_MESSAGE_MAX_EMPTY'), !$form['message_max'])->limit_empty(t('ERROR_ERROR_LIMIT_EMPTY'), !$form['limit'])->order_by_empty(t('ERROR_ORDER_BY_EMPTY'), $form['order_by']);
    if (!$err->count()) {
        Settings::update('guestbook');
        Cache::clear('contact.txt');
        $note->success(t('SAVED_SUCCESSFUL'));
        redirect(HREF . 'admin/modules/guestbook/settings');
    } else {
        $note->error($err);
    }
} else {
    $note->error(array(t('MODULE_SETTINGS'), t('REQUIRED_FIELDS')));
}
$tpl = new PHPTAL('modules/guestbook/admin/settings.html');
$tpl->form = $form;
$tpl->note = $note;
$tpl->columns = Settings::formColumns();
$tpl->blocks = Settings::formBlocks();
echo $tpl->execute();
开发者ID:rafalenden,项目名称:KioCMS,代码行数:31,代码来源:settings.php

示例4: t

<?php

// KioCMS - Kiofol Content Managment System
// modules/contact/admin/index.php
$kio->path['admin/modules/contact'] = t('Contact');
$note = new Notifier();
$err = new Error();
$save = $_POST['save'] ? true : false;
$blocks = Settings::getBlocks();
if ($save) {
    $form = $_POST['form'];
    $form['blocks'] = array_diff(array_keys($blocks), (array) $_POST['blocks']);
    $err->receivers_empty($lang2['ERROR_RECEIVERS_EMPTY'], !$form['receivers']);
    $err->receivers_invalid($lang2['ERROR_RECEIVERS_INVALID'], $form['receivers'] && !preg_match('#^\\d+(, *\\d)*$#', $form['receivers']));
    if (!$err->count()) {
        Settings::update('contact');
        Cache::clear('contact.txt');
        $info->positive(t('SAVED_SUCCESSFUL'));
        redirect(HREF . 'admin/modules/contact');
    } else {
        $note->error($err);
    }
} else {
    $form = $cfg->contact;
    $form['blocks'] = explode(', ', $cfg->contact['blocks']);
    $note->info(array($lang_admin['MODULE_SETTINGS'], $lang_system['REQUIRED']));
}
$tpl = new PHPTAL('modules/contact/admin/settings.html');
$tpl->note = $note;
$tpl->form = $form;
$tpl->err = $err;
开发者ID:rafalenden,项目名称:KioCMS,代码行数:31,代码来源:index.php

示例5: remove

 public function remove()
 {
     // Take the data we received and store it.
     Settings::update(['SettingsEvAccessToken' => '', 'SettingsEvUserId' => '', 'SettingsEvTokenExpires' => ''], Settings::get_settings_id());
     return Redirect::to('/?evernote=removed');
 }
开发者ID:cloudmanic,项目名称:evernote-php,代码行数:6,代码来源:auth.php


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