當前位置: 首頁>>代碼示例>>PHP>>正文


PHP admin_setting_configtext::write_setting方法代碼示例

本文整理匯總了PHP中admin_setting_configtext::write_setting方法的典型用法代碼示例。如果您正苦於以下問題:PHP admin_setting_configtext::write_setting方法的具體用法?PHP admin_setting_configtext::write_setting怎麽用?PHP admin_setting_configtext::write_setting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在admin_setting_configtext的用法示例。


在下文中一共展示了admin_setting_configtext::write_setting方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: write_setting

 public function write_setting($data)
 {
     // your custom validation logic here
     if ($data == '') {
         $data = random_string(60);
     }
     return parent::write_setting($data);
 }
開發者ID:Roemke,項目名稱:resop,代碼行數:8,代碼來源:admin_settings.php

示例2: write_setting

 public function write_setting($data)
 {
     // Trim any spaces to avoid spaces typo.
     $data = trim($data);
     if ($data === '') {
         // Override parent behaviour and set to default if empty string.
         $data = $this->get_defaultsetting();
     }
     return parent::write_setting($data);
 }
開發者ID:lucisgit,項目名稱:moodle-theme_essential,代碼行數:10,代碼來源:essential_admin_setting_configinteger.php

示例3: 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

示例4: write_setting

 /**
  * Save the selected setting
  *
  * @param string $data The selected site
  * @return string empty string or error message
  */
 public function write_setting($data)
 {
     if ($data === '') {
         $data = (int) $this->defaultsetting;
     } else {
         $data = $data;
     }
     return parent::write_setting($data);
 }
開發者ID:Alexbado,項目名稱:moodle2,代碼行數:15,代碼來源:adminlib.php

示例5: write_setting

 /**
  * Save the new setting
  *
  * @param string $data The new setting
  * @return bool
  */
 public function write_setting($data)
 {
     $return = parent::write_setting($data);
     get_string_manager()->reset_caches();
     return $return;
 }
開發者ID:eamador,項目名稱:moodle-course-custom-fields,代碼行數:12,代碼來源:adminlib.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_configtext::write_setting方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。