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


PHP workshop::available_dimension_weights_list方法代碼示例

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


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

示例1: definition_inner

 /**
  * Define the elements to be displayed at the form
  *
  * Called by the parent::definition()
  *
  * @return void
  */
 protected function definition_inner(&$mform)
 {
     $norepeats = $this->_customdata['norepeats'];
     // number of dimensions to display
     $descriptionopts = $this->_customdata['descriptionopts'];
     // wysiwyg fields options
     $current = $this->_customdata['current'];
     // current data to be set
     $mform->addElement('hidden', 'norepeats', $norepeats);
     $mform->setType('norepeats', PARAM_INT);
     // value not to be overridden by submitted value
     $mform->setConstants(array('norepeats' => $norepeats));
     for ($i = 0; $i < $norepeats; $i++) {
         $mform->addElement('header', 'dimension' . $i, get_string('dimensionnumber', 'workshopform_accumulative', $i + 1));
         $mform->addElement('hidden', 'dimensionid__idx_' . $i);
         $mform->setType('dimensionid__idx_' . $i, PARAM_INT);
         $mform->addElement('editor', 'description__idx_' . $i . '_editor', get_string('dimensiondescription', 'workshopform_accumulative'), '', $descriptionopts);
         // todo replace modgrade with an advanced element (usability issue discussed with Olli)
         $mform->addElement('modgrade', 'grade__idx_' . $i, get_string('dimensionmaxgrade', 'workshopform_accumulative'), null, true);
         $mform->setDefault('grade__idx_' . $i, 10);
         $mform->addElement('select', 'weight__idx_' . $i, get_string('dimensionweight', 'workshopform_accumulative'), workshop::available_dimension_weights_list());
         $mform->setDefault('weight__idx_' . $i, 1);
     }
     $mform->registerNoSubmitButton('noadddims');
     $mform->addElement('submit', 'noadddims', get_string('addmoredimensions', 'workshopform_accumulative', workshop_accumulative_strategy::ADDDIMS));
     $mform->closeHeaderBefore('noadddims');
     $this->set_data($current);
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:35,代碼來源:edit_form.php


注:本文中的workshop::available_dimension_weights_list方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。