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


PHP MoodleQuickForm::disable_form_change_checker方法代码示例

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


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

示例1: view_administration


//.........这里部分代码省略.........
                     die;
                 }
                 break;
             case 'grouping':
                 // Show grouping creation form!
                 $selected = optional_param_array('selected', array(), PARAM_INT);
                 $mform = new \mod_grouptool\groupings_creation_form(null, array('id' => $id, 'selected' => $selected));
                 $groups = $DB->get_records_list('groups', 'id', $selected);
                 if ($mform->is_cancelled()) {
                     $bulkaction = null;
                     $selected = array();
                 } else {
                     if ($fromform = $mform->get_data()) {
                         // Some groupings should be created...
                         if ($fromform->target == -2) {
                             // One new grouping per group!
                             foreach ($groups as $group) {
                                 $grouping = new stdClass();
                                 if (!($grouping->id = groups_get_grouping_by_name($this->course->id, $group->name))) {
                                     $grouping = new stdClass();
                                     $grouping->courseid = $this->course->id;
                                     $grouping->name = $group->name;
                                     $grouping->id = groups_create_grouping($grouping);
                                 }
                                 // Insert group!
                                 groups_assign_grouping($grouping->id, $group->id);
                             }
                         } else {
                             if ($fromform->target == -1) {
                                 // One new grouping!
                                 // Create grouping if it doesn't exist...
                                 $grouping = new stdClass();
                                 if (!($grouping->id = groups_get_grouping_by_name($this->course->id, $fromform->name))) {
                                     $grouping = new stdClass();
                                     $grouping->courseid = $this->course->id;
                                     $grouping->name = trim($fromform->name);
                                     $grouping->id = groups_create_grouping($grouping);
                                 }
                                 // Insert groups!
                                 foreach ($groups as $group) {
                                     groups_assign_grouping($grouping->id, $group->id);
                                 }
                             } else {
                                 if ($fromform->target > 0) {
                                     // Existing Grouping!
                                     $grouping = groups_get_grouping($fromform->target);
                                     if ($grouping) {
                                         foreach ($groups as $group) {
                                             groups_assign_grouping($grouping->id, $group->id);
                                         }
                                     }
                                 }
                             }
                         }
                         // ...redirect to show sortlist again!
                         $url = new moodle_url('/mod/grouptool/view.php', array('id' => $this->cm->id, 'tab' => 'group_admin', 'filter' => $filter));
                         $text = $OUTPUT->notification(get_string('groupings_created_and_groups_added', 'grouptool'), 'notifymessage');
                         echo $this->confirm($text, $url);
                     } else {
                         $mform->display();
                     }
                 }
                 break;
         }
     }
     if (!$bulkaction || !$selected || !optional_param('start_bulkaction', 0, PARAM_BOOL)) {
         // Show form!
         $formaction = new moodle_url('/mod/grouptool/view.php', array('id' => $this->cm->id, 'tab' => 'group_admin', 'filter' => $filter));
         $mform = new MoodleQuickForm('bulk', 'post', $formaction, '');
         $mform->addElement('hidden', 'sesskey');
         $mform->setDefault('sesskey', sesskey());
         $sortlist = new \mod_grouptool\output\sortlist($this->course->id, $this->cm, $filter);
         $sortlistcontroller = new \mod_grouptool\output\sortlist_controller($sortlist);
         $mform->addElement('html', $output->render($sortlistcontroller));
         $mform->addElement('html', $output->render($sortlist));
         $actions = array('' => get_string('choose', 'grouptool'), 'activate' => get_string('setactive', 'grouptool'), 'deactivate' => get_string('setinactive', 'grouptool'), 'delete' => get_string('delete'), 'grouping' => get_string('createinsertgrouping', 'grouptool'));
         $grp = array();
         $grp[] =& $mform->createElement('static', 'with_selection', '', get_string('with_selection', 'grouptool'));
         $grp[] =& $mform->createElement('select', 'bulkaction', '', $actions);
         $grp[] =& $mform->createElement('submit', 'start_bulkaction', get_string('start', 'grouptool'));
         $mform->addGroup($grp, 'actiongrp', '', ' ', false);
         $mform->disable_form_change_checker();
         $mform->display();
         switch ($filter) {
             case self::FILTER_ACTIVE:
                 $curfilter = 'active';
                 break;
             case self::FILTER_INACTIVE:
                 $curfilter = 'inactive';
                 break;
             case self::FILTER_ALL:
                 $curfilter = 'all';
                 break;
         }
         $PAGE->requires->yui_module('moodle-mod_grouptool-administration', 'M.mod_grouptool.init_administration', array(array('lang' => current_language(), 'contextid' => $this->context->id, 'filter' => $curfilter, 'filterid' => $filter, 'globalsize' => $this->grouptool->grpsize)));
         $PAGE->requires->strings_for_js(array('active', 'inactive', 'confirm_delete'), 'mod_grouptool');
         $PAGE->requires->string_for_js('ajax_edit_size_help', 'mod_grouptool');
         $PAGE->requires->strings_for_js(array('yes', 'no'), 'moodle');
     }
 }
开发者ID:rimacher,项目名称:moodle-mod_grouptool,代码行数:101,代码来源:locallib.php


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