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


PHP MoodleQuickForm::setExpanded方法代码示例

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


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

示例1: definition_inner

 /**
  * definition_inner adds all specific fields to the form.
  *
  * @param MoodleQuickForm $mform (the form being built).
  */
 protected function definition_inner($mform)
 {
     $mform->addElement('header', 'previewareaheader', get_string('previewareaheader', 'qtype_' . $this->qtype()));
     $mform->setExpanded('previewareaheader');
     $mform->addElement('static', 'previewarea', '', get_string('previewareamessage', 'qtype_' . $this->qtype()));
     $mform->registerNoSubmitButton('refresh');
     $mform->addElement('submit', 'refresh', get_string('refresh', 'qtype_' . $this->qtype()));
     $mform->addElement('filepicker', 'bgimage', get_string('bgimage', 'qtype_' . $this->qtype()), null, self::file_picker_options());
     $mform->closeHeaderBefore('dropzoneheader');
     // Add the draggable image fields & drop zones to the form.
     list($itemrepeatsatstart, $imagerepeats) = $this->get_drag_item_repeats();
     $this->definition_draggable_items($mform, $itemrepeatsatstart);
     $this->definition_drop_zones($mform, $imagerepeats);
     $this->add_combined_feedback_fields(true);
     $this->add_interactive_settings(true, true);
 }
开发者ID:pzhu2004,项目名称:moodle,代码行数:21,代码来源:edit_ddtoimage_form_base.php

示例2: add_plugin_grade_elements

 /**
  * Add elements in grading plugin form.
  *
  * @param mixed $grade stdClass|null
  * @param MoodleQuickForm $mform
  * @param stdClass $data
  * @param int $userid - The userid we are grading
  * @return void
  */
 protected function add_plugin_grade_elements($grade, MoodleQuickForm $mform, stdClass $data, $userid)
 {
     foreach ($this->feedbackplugins as $plugin) {
         if ($plugin->is_enabled() && $plugin->is_visible()) {
             $mform->addElement('header', 'header_' . $plugin->get_type(), $plugin->get_name());
             $mform->setExpanded('header_' . $plugin->get_type());
             if (!$plugin->get_form_elements_for_user($grade, $mform, $data, $userid)) {
                 $mform->removeElement('header_' . $plugin->get_type());
             }
         }
     }
 }
开发者ID:helenagarcia90,项目名称:moodle,代码行数:21,代码来源:locallib.php

示例3: definition_prt

 /**
  * Add the form elements defining one PRT.
  * @param string $prtname the name of the PRT.
  * @param MoodleQuickForm $mform the form being assembled.
  * @param int $count the number of times this PRT appears in the text of the question.
  */
 protected function definition_prt($prtname, MoodleQuickForm $mform, $count)
 {
     $mform->addElement('header', $prtname . 'header', stack_string('prtheading', $prtname));
     if ($count == 0) {
         $mform->addElement('static', $prtname . 'prtwarning', '', stack_string('prtwillberemoved', $prtname));
         $mform->addElement('advcheckbox', $prtname . 'prtdeleteconfirm', '', stack_string('prtremovedconfirm'));
         $mform->setDefault($prtname . 'prtdeleteconfirm', 0);
         $mform->setExpanded($prtname . 'header');
     }
     $mform->addElement('text', $prtname . 'value', stack_string('questionvalue'), array('size' => 3));
     $mform->setType($prtname . 'value', PARAM_FLOAT);
     $mform->setDefault($prtname . 'value', 1);
     $mform->addElement('selectyesno', $prtname . 'autosimplify', stack_string('autosimplify'));
     $mform->setDefault($prtname . 'autosimplify', true);
     $mform->addHelpButton($prtname . 'autosimplify', 'autosimplifyprt', 'qtype_stack');
     $mform->addElement('textarea', $prtname . 'feedbackvariables', stack_string('feedbackvariables'), array('rows' => 3, 'cols' => 80));
     $mform->addHelpButton($prtname . 'feedbackvariables', 'feedbackvariables', 'qtype_stack');
     $inputnames = implode(', ', $this->get_inputs_used_by_prt($prtname));
     $mform->addElement('static', $prtname . 'inputsnote', '', stack_string('prtwillbecomeactivewhen', html_writer::tag('b', $inputnames)));
     // Create the section of the form for each node - general bits.
     $graph = $this->get_prt_graph($prtname);
     $mform->addElement('static', $prtname . 'graph', '', stack_abstract_graph_svg_renderer::render($graph, $prtname . 'graphsvg'));
     $nextnodechoices = array('-1' => stack_string('stop'));
     foreach ($graph->get_nodes() as $node) {
         $nextnodechoices[$node->name - 1] = stack_string('nodex', $node->name);
     }
     $deletable = count($graph->get_nodes()) > 1;
     foreach ($graph->get_nodes() as $node) {
         $this->definition_prt_node($prtname, $node->name, $nextnodechoices, $deletable, $mform);
     }
     $mform->addElement('submit', $prtname . 'nodeadd', stack_string('addanothernode'));
     $mform->registerNoSubmitButton($prtname . 'nodeadd');
 }
开发者ID:sanyaade-teachings,项目名称:moodle-qtype_stack,代码行数:39,代码来源:edit_stack_form.php


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