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


PHP admin_setting_configselect::set_updatedcallback方法代码示例

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


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

示例1: array

    $default = '';
    $setting = new admin_setting_configtextarea($name, $title, $description, $default, PARAM_TEXT);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);
    // URL.
    $name = 'theme_lambda/carousel_url_' . $i;
    $title = get_string('carousel_url', 'theme_lambda');
    $description = get_string('carousel_urldesc', 'theme_lambda');
    $default = '';
    $setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);
    // Button Text.
    $name = 'theme_lambda/carousel_btntext_' . $i;
    $title = get_string('carousel_btntext', 'theme_lambda');
    $description = get_string('carousel_btntextdesc', 'theme_lambda');
    $default = '';
    $setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_TEXT);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);
    // Color
    $name = 'theme_lambda/carousel_color_' . $i;
    $title = get_string('carousel_color', 'theme_lambda');
    $description = get_string('carousel_colordesc', 'theme_lambda');
    $default = '0';
    $choices = array('0' => 'green', '1' => 'purple', '2' => 'orange', '3' => 'lightblue', '4' => 'yellow', '5' => 'turquoise');
    $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);
}
$ADMIN->add('theme_lambda', $temp);
开发者ID:sirromas,项目名称:medical,代码行数:31,代码来源:settings.php

示例2: dirname

 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    elisprogram_enrolrolesync
 * @author     Remote-Learner.net Inc
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @copyright  (C) 2008-2013 Remote-Learner.net Inc (http://www.remote-learner.net)
 *
 */
defined('MOODLE_INTERNAL') || die;
require_once dirname(__FILE__) . '/../../../../config.php';
global $CFG;
require_once $CFG->dirroot . '/local/elisprogram/lib/setup.php';
require_once elispm::lib('lib.php');
require_once elispm::file('plugins/enrolrolesync/lib.php');
if ($ADMIN->fulltree) {
    $options = array(0 => get_string('no_default_role', 'local_elisprogram'));
    pm_get_select_roles_for_contexts($options, array(CONTEXT_ELIS_CLASS));
    //setting header
    $settings->add(new admin_setting_heading('elisprogram_enrolrolesync/settings', get_string('enrolment_role_sync_settings', 'elisprogram_enrolrolesync'), ''));
    //student role setting
    $setting = new admin_setting_configselect('elisprogram_enrolrolesync/student_role', get_string('sync_student_role_setting', 'elisprogram_enrolrolesync'), get_string('sync_student_role_help', 'elisprogram_enrolrolesync'), 0, $options);
    $setting->set_updatedcallback('enrolment_role_sync_updatedcallback');
    $settings->add($setting);
    //instructor role setting
    $setting = new admin_setting_configselect('elisprogram_enrolrolesync/instructor_role', get_string('sync_instructor_role_setting', 'elisprogram_enrolrolesync'), get_string('sync_instructor_role_help', 'elisprogram_enrolrolesync'), 0, $options);
    $setting->set_updatedcallback('enrolment_role_sync_updatedcallback');
    $settings->add($setting);
}
开发者ID:jamesmcq,项目名称:elis,代码行数:31,代码来源:settings.php

示例3: array

}
$course = get_site();
$role = get_default_course_role($course);
$defaultroleid = $role->id;
$item = new admin_setting_configcheckbox('block_fn_site_groups_enabled', get_string('fn_site_groups_enabled', 'block_fn_site_groups'), get_string('fn_config_site_groups_enabled', 'block_fn_site_groups'), '0');
$item->set_updatedcallback('fn_sg_set_site_group_mode');
$settings->add($item);
$settings->add(new admin_setting_configselect('block_fn_site_groups_defaultroleid', get_string('fn_site_groups_defaultroleid', 'block_fn_site_groups'), get_string('fn_config_site_groups_defaultroleid', 'block_fn_site_groups'), $defaultroleid, $roles));
$settings->add(new admin_setting_configmulticheckbox('block_fn_site_groups_roles', get_string('fn_site_groups_roles', 'block_fn_site_groups'), get_string('fn_config_site_groups_roles', 'block_fn_site_groups'), '0', $roles));
/// These settings don't actually use the $CFG variable, but are used to manage capabilities.
$caps = role_context_capabilities($gmroleid, $context);
$sgusers = array();
if (!empty($caps['block/fn_site_groups:assignowngroupusers'])) {
    $sgusers[] = 1;
}
if (!empty($caps['block/fn_site_groups:assignallusers'])) {
    $sgusers[] = 2;
}
$CFG->block_fn_site_groups_users = implode(',', $sgusers);
$users = array(1 => get_string('fn_site_groups:assignowngroupusers', 'block_fn_site_groups'), 2 => get_string('fn_site_groups:assignallusers', 'block_fn_site_groups'));
$item = new admin_setting_configmulticheckbox('block_fn_site_groups_users', get_string('fn_site_groups_users', 'block_fn_site_groups'), get_string('fn_config_site_groups_users', 'block_fn_site_groups'), '1', $users);
$item->set_updatedcallback('fn_sg_set_user_capability');
$settings->add($item);
if (!empty($caps['block/fn_site_groups:createnewgroups'])) {
    $CFG->block_fn_site_groups_creategroups = 1;
} else {
    $CFG->block_fn_site_groups_creategroups = 0;
}
$item = new admin_setting_configselect('block_fn_site_groups_creategroups', get_string('fn_site_groups_creategroups', 'block_fn_site_groups'), get_string('fn_config_site_groups_creategroups', 'block_fn_site_groups'), 1, array(0 => get_string('no'), 1 => get_string('yes')));
$item->set_updatedcallback('fn_sg_set_user_capability');
$settings->add($item);
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:settings.php

示例4: add_select

 public function add_select($setting, $default, $options)
 {
     $select = new admin_setting_configselect($this->name_for($setting), $this->title_for($setting), $this->description_for($setting), $default, $options);
     $select->set_updatedcallback('theme_reset_all_caches');
     $this->settingspage->add($select);
 }
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:6,代码来源:simple_theme_settings.class.php

示例5: array

 $settings->add(new admin_setting_heading('learning_plan', get_string('learningplan', 'local_elisprogram'), ''));
 // Turn off learning plan
 $settings->add(new admin_setting_configcheckbox('local_elisprogram/disablecoursecatalog', get_string('learning_plan_setting', 'local_elisprogram'), '', 0));
 // Number of curricula to display before automatically collapsing
 $settings->add(new admin_setting_configtext('local_elisprogram/catalog_collapse_count', get_string('auto_collapse_setting', 'local_elisprogram'), '', 4, PARAM_INT));
 // TBD
 // Enable curriculum expiration
 $setting = new admin_setting_configcheckbox('local_elisprogram/enable_curriculum_expiration', get_string('crlm_expire_setting', 'local_elisprogram'), '', 0);
 //callback to handle updating curriculum assignment expiry times
 $setting->set_updatedcallback('curriculum_expiration_enabled_updatedcallback');
 $settings->add($setting);
 // Calculate curriculum expiration based on the time a student
 $opts = array(CURR_EXPIRE_ENROL_START => get_string('curriculum_expire_enrol_start', 'local_elisprogram'), CURR_EXPIRE_ENROL_COMPLETE => get_string('curriculum_expire_enrol_complete', 'local_elisprogram'));
 $setting = new admin_setting_configselect('local_elisprogram/curriculum_expiration_start', get_string('expire_basis_setting', 'local_elisprogram'), '', CURR_EXPIRE_ENROL_START, $opts);
 //callback to handle updating curriculum assignment expiry times
 $setting->set_updatedcallback('curriculum_expiration_start_updatedcallback');
 $settings->add($setting);
 // TBD
 // Allow students to see completed courses on their dashboard
 $settings->add(new admin_setting_configcheckbox('local_elisprogram/display_completed_courses', get_string('completed_courses_setting', 'local_elisprogram'), get_string('completed_courses_help', 'local_elisprogram'), 1));
 // ***Certificates
 $settings->add(new admin_setting_heading('certificates', get_string('certificates', 'local_elisprogram'), ''));
 // Disable Certificates
 $settings->add(new admin_setting_configcheckbox('local_elisprogram/disablecoursecertificates', get_string('disable_crs_cert', 'local_elisprogram'), get_string('disable_crs_cert_desc', 'local_elisprogram'), 0));
 $settings->add(new admin_setting_configcheckbox('local_elisprogram/disablecertificates', get_string('disable_cert_setting', 'local_elisprogram'), '', 1));
 // Certificate border image
 $borders = function_exists('cm_certificate_get_borders') ? cm_certificate_get_borders() : array('Fancy1-blue.jpg' => 'Fancy1-blue', 'Fancy1-green.jpg' => 'Fancy1-green', 'Fancy2-black.jpg' => 'Fancy2-black', 'Fancy2-brown.jpg' => 'Fancy2-brown', '' => 'None');
 // for testing
 $settings->add(new admin_setting_configselect('local_elisprogram/certificate_border_image', get_string('cert_border_setting', 'local_elisprogram'), get_string('cert_border_help', 'local_elisprogram'), 0, $borders));
 // TBD
 // Certificate seal image
开发者ID:jamesmcq,项目名称:elis,代码行数:31,代码来源:settings.php


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