本文整理汇总了PHP中admin_setting_configtext类的典型用法代码示例。如果您正苦于以下问题:PHP admin_setting_configtext类的具体用法?PHP admin_setting_configtext怎么用?PHP admin_setting_configtext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了admin_setting_configtext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: add_text
public function add_text($setting, $default = '')
{
$text = new admin_setting_configtext($this->name_for($setting), $this->title_for($setting), $this->description_for($setting), $default);
$text->set_updatedcallback('theme_reset_all_caches');
$this->settingspage->add($text);
}
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:6,代码来源:simple_theme_settings.class.php
示例2: admin_setting_special_backupsaveto
function admin_setting_special_backupsaveto()
{
$name = 'backup_sche_destination';
$visiblename = get_string('saveto');
$description = get_string('backupsavetohelp');
parent::admin_setting_configtext($name, $visiblename, $description, '');
}
开发者ID:veritech,项目名称:pare-project,代码行数:7,代码来源:adminlib.php
示例3: add_texts
public function add_texts($setting, $instance, $default = '')
{
$text = new admin_setting_configtext($this->name_for($setting . $instance), $this->title_for($setting, $instance), $this->description_for($setting), $default);
$text->set_updatedcallback('theme_reset_all_caches');
return $text;
}
开发者ID:nadavkav,项目名称:moodle-accessibility,代码行数:6,代码来源:simple_theme_settings.class.php
示例4: array
$timezone = 0;
} else {
if ($timezone > 0) {
$timezone = $timezone - 24;
}
}
$options = array();
for ($i = 0; $i <= 23; $i++) {
$options[($i - $timezone) % 24] = gmdate('H:i', $i * HOURSECS);
}
$settings->add(new admin_setting_configmultiselect('hotpot_enablecron', get_string('enablecron', 'mod_hotpot'), get_string('configenablecron', 'mod_hotpot'), array(), $options));
// enable embedding of swf media objects inhotpot quizzes (default=1)
$settings->add(new admin_setting_configcheckbox('hotpot_enableswf', get_string('enableswf', 'mod_hotpot'), get_string('configenableswf', 'mod_hotpot'), 1));
// enable obfuscation of javascript in html files (default=1)
$settings->add(new admin_setting_configcheckbox('hotpot_enableobfuscate', get_string('enableobfuscate', 'mod_hotpot'), get_string('configenableobfuscate', 'mod_hotpot'), 1));
$options = array(hotpot::BODYSTYLES_BACKGROUND => get_string('bodystylesbackground', 'mod_hotpot'), hotpot::BODYSTYLES_COLOR => get_string('bodystylescolor', 'mod_hotpot'), hotpot::BODYSTYLES_FONT => get_string('bodystylesfont', 'mod_hotpot'), hotpot::BODYSTYLES_MARGIN => get_string('bodystylesmargin', 'mod_hotpot'));
$settings->add(new admin_setting_configmultiselect('hotpot_bodystyles', get_string('bodystyles', 'mod_hotpot'), get_string('configbodystyles', 'mod_hotpot'), array(), $options));
// hotpot navigation frame height (default=85)
$settings->add(new admin_setting_configtext('hotpot_frameheight', get_string('frameheight', 'mod_hotpot'), get_string('configframeheight', 'mod_hotpot'), 85, PARAM_INT, 4));
// lock hotpot navigation frame so it is not scrollable (default=0)
$settings->add(new admin_setting_configcheckbox('hotpot_lockframe', get_string('lockframe', 'mod_hotpot'), get_string('configlockframe', 'mod_hotpot'), 0));
// store raw xml details of HotPot quiz attempts (default=1)
$str = get_string('cleardetails', 'mod_hotpot');
$url = new moodle_url('/mod/hotpot/tools/clear_details.php', array('sesskey' => sesskey()));
$link = html_writer::link($url, $str, array('class' => 'small', 'style' => 'white-space: nowrap', 'onclick' => "this.target='_blank'")) . "\n";
$settings->add(new admin_setting_configcheckbox('hotpot_storedetails', get_string('storedetails', 'mod_hotpot'), get_string('configstoredetails', 'mod_hotpot') . ' ' . $link, 0));
// maximum duration of a single calendar event (default=5 mins)
$setting = new admin_setting_configtext('hotpot_maxeventlength', get_string('maxeventlength', 'mod_hotpot'), get_string('configmaxeventlength', 'mod_hotpot'), 5, PARAM_INT, 4);
$setting->set_updatedcallback('hotpot_refresh_events');
$settings->add($setting);
unset($i, $link, $options, $setting, $str, $timezone, $datetime, $url);
开发者ID:OctaveBabel,项目名称:moodle-itop,代码行数:31,代码来源:settings.php
示例5: defined
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the form for editing activity results block instances.
*
* @package block_activity_results
* @copyright 2016 Stephen Bourget
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
// Default high scores.
$setting = new admin_setting_configtext('block_activity_results/config_showbest', new lang_string('defaulthighestgrades', 'block_activity_results'), new lang_string('defaulthighestgrades_desc', 'block_activity_results'), 3, PARAM_INT);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$settings->add($setting);
// Default low scores.
$setting = new admin_setting_configtext('block_activity_results/config_showworst', new lang_string('defaultlowestgrades', 'block_activity_results'), new lang_string('defaultlowestgrades_desc', 'block_activity_results'), 0, PARAM_INT);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$settings->add($setting);
// Default group display.
$yesno = array(0 => get_string('no'), 1 => get_string('yes'));
$setting = new admin_setting_configselect('block_activity_results/config_usegroups', new lang_string('defaultshowgroups', 'block_activity_results'), new lang_string('defaultshowgroups_desc', 'block_activity_results'), 0, $yesno);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$settings->add($setting);
// Default privacy settings.
$nameoptions = array(B_ACTIVITYRESULTS_NAME_FORMAT_FULL => get_string('config_names_full', 'block_activity_results'), B_ACTIVITYRESULTS_NAME_FORMAT_ID => get_string('config_names_id', 'block_activity_results'), B_ACTIVITYRESULTS_NAME_FORMAT_ANON => get_string('config_names_anon', 'block_activity_results'));
$setting = new admin_setting_configselect('block_activity_results/config_nameformat', new lang_string('defaultnameoptions', 'block_activity_results'), new lang_string('defaultnameoptions_desc', 'block_activity_results'), B_ACTIVITYRESULTS_NAME_FORMAT_FULL, $nameoptions);
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
$settings->add($setting);
// Default grade display settings.
$gradeoptions = array(B_ACTIVITYRESULTS_GRADE_FORMAT_PCT => get_string('config_format_percentage', 'block_activity_results'), B_ACTIVITYRESULTS_GRADE_FORMAT_FRA => get_string('config_format_fraction', 'block_activity_results'), B_ACTIVITYRESULTS_GRADE_FORMAT_ABS => get_string('config_format_absolute', 'block_activity_results'));
$setting = new admin_setting_configselect('block_activity_results/config_gradeformat', new lang_string('defaultgradedisplay', 'block_activity_results'), new lang_string('defaultgradedisplay_desc', 'block_activity_results'), B_ACTIVITYRESULTS_GRADE_FORMAT_PCT, $gradeoptions);
开发者ID:evltuma,项目名称:moodle,代码行数:31,代码来源:settings.php
示例6: array
<?php
// This file defines settingpages and externalpages under the "appearance" category
$capabilities = array('moodle/my:configsyspages', 'moodle/tag:manage');
if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
// speedup for non-admins, add all caps used on this page
$ADMIN->add('appearance', new admin_category('themes', new lang_string('themes')));
// "themesettings" settingpage
$temp = new admin_settingpage('themesettings', new lang_string('themesettings', 'admin'));
$setting = new admin_setting_configtext('themelist', new lang_string('themelist', 'admin'), new lang_string('configthemelist', 'admin'), '', PARAM_NOTAGS);
$setting->set_force_ltr(true);
$temp->add($setting);
$setting = new admin_setting_configcheckbox('themedesignermode', new lang_string('themedesignermode', 'admin'), new lang_string('configthemedesignermode', 'admin'), 0);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$temp->add(new admin_setting_configcheckbox('allowuserthemes', new lang_string('allowuserthemes', 'admin'), new lang_string('configallowuserthemes', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('allowcoursethemes', new lang_string('allowcoursethemes', 'admin'), new lang_string('configallowcoursethemes', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('allowcategorythemes', new lang_string('allowcategorythemes', 'admin'), new lang_string('configallowcategorythemes', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', new lang_string('allowthemechangeonurl', 'admin'), new lang_string('configallowthemechangeonurl', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', new lang_string('allowuserblockhiding', 'admin'), new lang_string('configallowuserblockhiding', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('allowblockstodock', new lang_string('allowblockstodock', 'admin'), new lang_string('configallowblockstodock', 'admin'), 1));
$temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'), new lang_string('configcustommenuitems', 'admin'), '', PARAM_RAW, '50', '10'));
$temp->add(new admin_setting_configtextarea('customusermenuitems', new lang_string('customusermenuitems', 'admin'), new lang_string('configcustomusermenuitems', 'admin'), 'grades,grades|/grade/report/mygrades.php|grades
messages,message|/message/index.php|message
preferences,moodle|/user/preferences.php|preferences', PARAM_RAW, '50', '10'));
$temp->add(new admin_setting_configcheckbox('enabledevicedetection', new lang_string('enabledevicedetection', 'admin'), new lang_string('configenabledevicedetection', 'admin'), 1));
$temp->add(new admin_setting_devicedetectregex('devicedetectregex', new lang_string('devicedetectregex', 'admin'), new lang_string('devicedetectregex_desc', 'admin'), ''));
$ADMIN->add('themes', $temp);
$ADMIN->add('themes', new admin_externalpage('themeselector', new lang_string('themeselector', 'admin'), $CFG->wwwroot . '/theme/index.php'));
// settings for each theme
foreach (core_component::get_plugin_list('theme') as $theme => $themedir) {
开发者ID:EsdrasCaleb,项目名称:moodle,代码行数:31,代码来源:appearance.php
示例7: dirname
require_once dirname(__FILE__) . '/lib.php';
// Start of "scheduling" section
$settings->add(new admin_setting_heading('dhexport_version1elis/scheduling', get_string('exportfilesheading', 'dhexport_version1elis'), ''));
// Export filename settings
$settings->add(new admin_setting_configtext('dhexport_version1elis/export_path', get_string('export_path', 'dhexport_version1elis'), get_string('config_export_path', 'dhexport_version1elis'), '/datahub/dhexport_version1elis'));
$settings->add(new admin_setting_configtext('dhexport_version1elis/export_file', get_string('export_file', 'dhexport_version1elis'), get_string('config_export_file', 'dhexport_version1elis'), 'export_version1elis.csv'));
// Timestamp export file
$settings->add(new admin_setting_configcheckbox('dhexport_version1elis/export_file_timestamp', get_string('export_file_timestamp_label', 'dhexport_version1elis'), get_string('config_export_file_timestamp', 'dhexport_version1elis'), 1));
// Start of "logging" section
$settings->add(new admin_setting_heading('dhexport_version1elis/logging', get_string('logging', 'dhexport_version1elis'), ''));
// Log file location
$settings->add(new admin_setting_configtext('dhexport_version1elis/logfilelocation', get_string('logfilelocation', 'dhexport_version1elis'), get_string('configlogfilelocation', 'dhexport_version1elis'), RLIP_DEFAULT_LOG_PATH));
// Email notification
$settings->add(new admin_setting_configtext('dhexport_version1elis/emailnotification', get_string('emailnotification', 'dhexport_version1elis'), get_string('configemailnotification', 'dhexport_version1elis'), ''));
/**
* Time period settings
*/
// Header
$headerstring = get_string('timeperiodheader', 'dhexport_version1elis');
$settings->add(new admin_setting_heading('dhexport_version1elis_timeperiod', $headerstring, ''));
// Checkbox for enabling
$displaystring = get_string('nonincremental', 'dhexport_version1elis');
$infostring = get_string('confignonincremental', 'dhexport_version1elis');
$settings->add(new admin_setting_configcheckbox('dhexport_version1elis/nonincremental', $displaystring, $infostring, 0));
// Time delta
$displaystring = get_string('incrementaldelta', 'dhexport_version1elis');
$infostring = get_string('configincrementaldelta', 'dhexport_version1elis');
$setting = new admin_setting_configtext('dhexport_version1elis/incrementaldelta', $displaystring, $infostring, '1d');
// Callback to sanitize time delta
$setting->set_updatedcallback('rlipexport_version1elis_incrementaldelta_updatedcallback');
$settings->add($setting);
开发者ID:jamesmcq,项目名称:elis,代码行数:31,代码来源:settings.php
示例8: get_string
$title = get_string("activateSlideshow", 'theme_archaius');
$description = get_string('activateSlideshowdesc', 'theme_archaius');
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$setting->set_updatedcallback('theme_reset_all_caches');
$slideshow_options->add($setting);
//Activate pause/play Slideshow
$name = "theme_archaius/activatePausePlaySlideshow";
$title = get_string("activatePausePlaySlideshow", 'theme_archaius');
$description = get_string('activatePausePlaySlideshowdesc', 'theme_archaius');
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$setting->set_updatedcallback('theme_reset_all_caches');
$slideshow_options->add($setting);
// Slideshow Timeout
$name = 'theme_archaius/slideshowTimeout';
$title = get_string('slideshowTimeout', 'theme_archaius');
$description = get_string('slideshowTimeoutdesc', 'theme_archaius');
$default = 1500;
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_INT);
$setting->set_updatedcallback('theme_reset_all_caches');
$slideshow_options->add($setting);
// Slideshow height
$name = 'theme_archaius/slideshowheight';
$title = get_string('slideshowheight', 'theme_archaius');
$description = get_string('slideshowheightdesc', 'theme_archaius');
$default = 200;
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_RAW);
$setting->set_updatedcallback('theme_reset_all_caches');
$slideshow_options->add($setting);
//Add options to admin tree
$ADMIN->add('theme_archaius', $slideshow_options);
}
开发者ID:beyondkeysystem,项目名称:moodle-theme_archaius,代码行数:31,代码来源:archaius_slideshow_settings.php
示例9: kaltura_admin_setting_configtext
function kaltura_admin_setting_configtext($name, $visiblename, $description, $defaultsetting, $mandatory = true, $paramtype = PARAM_RAW, $size = null)
{
$this->mandatory = $mandatory;
parent::admin_setting_configtext($name, $visiblename, $description, $defaultsetting, $paramtype, $size);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:5,代码来源:settingslib.php
示例10: get_string
$setting->set_updatedcallback('theme_reset_all_caches');
$generalsettings->add($setting);
// Caption text.
$name = 'theme_essentials/slide' . $i . 'caption';
$title = get_string('slidecaption', 'theme_essential');
$description = get_string('slidecaptiondesc', 'theme_essential');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$generalsettings->add($setting);
// URL.
$name = 'theme_essentials/slide' . $i . 'url';
$title = get_string('slideurl', 'theme_essential');
$description = get_string('slideurldesc', 'theme_essential');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$generalsettings->add($setting);
// URL target.
$name = 'theme_essentials/slide' . $i . 'target';
$title = get_string('slideurltarget', 'theme_essential');
$description = get_string('slideurltargetdesc', 'theme_essential');
$target1 = get_string('slideurltargetself', 'theme_essential');
$target2 = get_string('slideurltargetnew', 'theme_essential');
$target3 = get_string('slideurltargetparent', 'theme_essential');
$default = '_blank';
$choices = array('_self' => $target1, '_blank' => $target2, '_parent' => $target3);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$generalsettings->add($setting);
}
开发者ID:uwidcit,项目名称:Moodle-Themes,代码行数:31,代码来源:settings.php
示例11: admin_setting_configtext
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// This is the descriptor for icon eight
$name = 'theme_pioneer/navicon8info';
$heading = get_string('navicon8', 'theme_pioneer');
$information = get_string('navicondesc', 'theme_pioneer');
$setting = new admin_setting_heading($name, $heading, $information);
$temp->add($setting);
$name = 'theme_pioneer/nav8icon';
$title = get_string('navicon', 'theme_pioneer');
$description = get_string('navicondesc', 'theme_pioneer');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_pioneer/nav8buttontext';
$title = get_string('naviconbuttontext', 'theme_pioneer');
$description = get_string('naviconbuttontextdesc', 'theme_pioneer');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$name = 'theme_pioneer/nav8buttonurl';
$title = get_string('naviconbuttonurl', 'theme_pioneer');
$description = get_string('naviconbuttonurldesc', 'theme_pioneer');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$ADMIN->add('theme_pioneer', $temp);
开发者ID:kennibc,项目名称:moodle-theme_pioneer,代码行数:31,代码来源:iconnavigation.php
示例12: 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
示例13: __construct
/**
* @param string $name
* @param string $visiblename
* @param string $description
* @param mixed $defaultsetting string or array
* @param mixed $paramtype
*/
public function __construct($name, $visiblename, $description, $defaultsetting, $paramtype = PARAM_RAW, $cols = '60', $rows = '8', $filearea = 'bcumarketingimages')
{
$this->rows = $rows;
$this->cols = $cols;
$this->filearea = $filearea;
parent::__construct($name, $visiblename, $description, $defaultsetting, $paramtype);
editors_head_setup();
}
开发者ID:Gavinthisisit,项目名称:Moodle,代码行数:15,代码来源:admin_confightmleditor.php
示例14: config_write
public function config_write($name, $value)
{
if ($value === '') {
// We do not want empty values in config table,
// delete it instead.
$value = null;
}
return parent::config_write($name, $value);
}
开发者ID:evltuma,项目名称:moodle,代码行数:9,代码来源:adminlib.php
示例15: validate
public function validate($data)
{
global $PAGE;
// Don't force the plugin to be fully set up when installing.
if ($PAGE->pagelayout === 'maintenance' && strlen($data) === 0) {
return true;
}
return parent::validate($data);
}
开发者ID:Dextirpe,项目名称:moodle-mod_turnitintooltwo,代码行数:9,代码来源:settingslib.php
示例16: __construct
/**
* Config text constructor
*
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting'
* for ones in config_plugins.
* @param string $visiblename localised
* @param string $description long localised info
* @param string $defaultsetting
* @param mixed $paramtype int means PARAM_XXX type, string is a allowed format in regex
* @param int $size default field size
*/
public function __construct($name, $visiblename, $description, $defaultsetting, $paramtype = PARAM_RAW_TRIMMED, $size = null)
{
$this->paramtype = $paramtype;
if (!is_null($size)) {
$this->size = $size;
} else {
$this->size = $paramtype === PARAM_INT ? 5 : 30;
}
parent::__construct($name, $visiblename, $description, $defaultsetting);
}
开发者ID:mpetrowi,项目名称:moodle-mod_collaborate,代码行数:21,代码来源:trimmed_configtext.php
示例17: validate
/**
* Validate data.
*
* @param string $data
* @return mixed True on success, else error message
*/
public function validate($data)
{
$result = parent::validate($data);
if ($result !== true) {
return $result;
}
if ((int) $data < 1) {
return get_string('awaittimeerror', 'realtimequiz');
}
return true;
}
开发者ID:OctaveBabel,项目名称:moodle-itop,代码行数:17,代码来源:adminlib.php
示例18: validate
/**
* Validate data.
*
* This ensures that key ID is specified if URL is provided
*
* @param string $data
* @return mixed True on success, else error message.
*/
public function validate($data)
{
$result = parent::validate($data);
if ($result !== true) {
return $result;
}
$url = get_config('filter_cloudfront_signurl', 'distributionurl');
if ($url != '' && empty($data)) {
return get_string('errornokeyid', 'filter_cloudfront_signurl');
}
return true;
}
开发者ID:altrome,项目名称:moodle-filter_cloudfront_signurl,代码行数:20,代码来源:adminlib.php
示例19:
/**
* Set the cron field for the gdata block record
* to the number of sections set in this setting.
*
* @return boolean
**/
function config_write($name, $value)
{
global $DB;
if (empty($value)) {
$cron = 0;
} else {
$cron = $value * MINSECS;
}
if ($DB->set_field('block', 'cron', $cron, array('name' => 'gdata'))) {
return parent::config_write($name, $value);
}
return false;
}
开发者ID:stefanotirati,项目名称:moodle-google-apps,代码行数:19,代码来源:settings.php
示例20: validate
/**
* Validate data before storage
* @param string data
* @return mixed true if ok string if error found
*/
public function validate($data)
{
$validated = parent::validate($data);
// Pass parent validation first.
if ($validated == true) {
$matches = preg_match($this->regex, $data);
if ($matches === false) {
$validated = 'preg_match() error.';
} else {
if ($matches == 0) {
$validated = '\'' . $data . '\'' . $this->error;
}
}
}
return $validated;
}
开发者ID:lucisgit,项目名称:moodle-theme_essential,代码行数:21,代码来源:essential_admin_setting_configtext.php
注:本文中的admin_setting_configtext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论