本文整理汇总了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);
}