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


PHP admin_setting_configselect::write_setting方法代码示例

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


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

示例1: write_setting

 /**
  * Save a setting
  *
  * @param string $data
  * @return string empty of error string
  */
 public function write_setting($data)
 {
     $validated = $this->validate($data);
     if ($validated !== true) {
         return $validated;
     }
     return parent::write_setting($data);
 }
开发者ID:parksandwildlife,项目名称:learning,代码行数:14,代码来源:adminlib.php

示例2: write_setting

 /**
  * Saves the new settings passed in $data
  *
  * @todo Add vartype handling to ensure $data is an array
  * @param array $data
  * @return mixed string or Array
  */
 public function write_setting($data)
 {
     $error = parent::write_setting($data['value']);
     if (!$error) {
         $value = empty($data['adv']) ? 0 : 1;
         $this->config_write($this->name . '_adv', $value);
     }
     return $error;
 }
开发者ID:raymondAntonio,项目名称:moodle,代码行数:16,代码来源:adminlib.php

示例3: write_setting

 /**
  * Updates the database and save the setting
  *
  * @param string data
  * @return string empty or error message
  */
 public function write_setting($data)
 {
     global $DB, $CFG;
     if ($data == 0) {
         $blogblocks = $DB->get_records_select('block', "name LIKE 'blog_%' AND visible = 1");
         foreach ($blogblocks as $block) {
             $DB->set_field('block', 'visible', 0, array('id' => $block->id));
         }
     } else {
         // reenable all blocks only when switching from disabled blogs
         if (isset($CFG->bloglevel) and $CFG->bloglevel == 0) {
             $blogblocks = $DB->get_records_select('block', "name LIKE 'blog_%' AND visible = 0");
             foreach ($blogblocks as $block) {
                 $DB->set_field('block', 'visible', 1, array('id' => $block->id));
             }
         }
     }
     return parent::write_setting($data);
 }
开发者ID:Alexbado,项目名称:moodle2,代码行数:25,代码来源:adminlib.php

示例4:

 /**
  * Saves the new setting.
  *
  * @param mixed $data
  * @return string empty string or error message
  */
 function write_setting($data)
 {
     global $CFG;
     $previous = $this->get_setting();
     $result = parent::write_setting($data);
     // If saved and the value has changed.
     if (empty($result) && $previous != $data) {
         require_once $CFG->libdir . '/gradelib.php';
         grade_force_site_regrading();
     }
     return $result;
 }
开发者ID:mongo0se,项目名称:moodle,代码行数:18,代码来源:adminlib.php

示例5: write_setting

 /**
  * Save the selected setting
  *
  * @param string $data The selected site
  * @return string empty string or error message
  */
 public function write_setting($data)
 {
     global $CFG;
     set_marsupial_state($data);
     return parent::write_setting($data);
 }
开发者ID:kevin-bruton,项目名称:marsupial,代码行数:12,代码来源:settingslib.php

示例6: write_setting

 public function write_setting($data)
 {
     $error = parent::write_setting($data['value']);
     if (!$error) {
         if (empty($data['fix'])) {
             $ok = $this->config_write('fix_' . $this->name, 0);
         } else {
             $ok = $this->config_write('fix_' . $this->name, 1);
         }
         if (!$ok) {
             $error = get_string('errorsetting', 'admin');
         }
     }
     return $error;
 }
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:15,代码来源:adminlib.php


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