本文整理汇总了PHP中hierarchy::get_entitysetting方法的典型用法代码示例。如果您正苦于以下问题:PHP hierarchy::get_entitysetting方法的具体用法?PHP hierarchy::get_entitysetting怎么用?PHP hierarchy::get_entitysetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hierarchy
的用法示例。
在下文中一共展示了hierarchy::get_entitysetting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function definition_after_data() {
global $DB,$CFG;
$mform = $this->_form;
$formatvalue = $mform->getElementValue('schoolid');
$id = $this->_customdata['id'];
$tools = array();
if ($formatvalue) {
$hierarchy = new hierarchy();
$curricula = new curricula();
$formatvalue = $formatvalue[0];
$tools = $hierarchy->get_records_cobaltselect_menu('local_program', "schoolid=$formatvalue AND visible=1", null, '', 'id,fullname', '--Select--');
$checkentitysetting = array();
$checkentitysetting = $hierarchy->get_entitysetting('CL', $formatvalue);
if ($formatvalue > 0) {
if(array_key_exists($tools))
$newel = $mform->createElement('static', 'programid', get_string('program', 'local_programs'), $hierarchy->cobalt_navigation_msg('No program available yet, Click here ','Create Program',$CFG->wwwroot.'/local/programs/program.php'));
else
$newel = $mform->createElement('select', 'programid', get_string('program', 'local_programs'), $tools);
$mform->insertElementBefore($newel, 'addprogramslisthere');
//$mform->setType('addprogramslisthere', PARAM_RAW);
$mform->addRule('programid', get_string('missingfullname', 'local_programs'), 'required', null, 'client');
$mform->setType('id', PARAM_INT);
/** curriculum settings like credithours are displayed here on selecting the school/university
* get_entitysetting() function exect if credit hours are set at curriculum level
*/
if ($checkentitysetting) {
foreach ($checkentitysetting as $settings) {
$level = "CL";
$level = $mform->createElement('hidden', 'level', $level);
$mform->insertElementBefore($level, 'addsettinglisthere');
if ($settings->entityid == 1) {
$settingheading = $mform->createElement('header', 'moodle', get_string('settingone', 'local_curriculum'));
$mform->insertElementBefore($settingheading, 'addsettinglisthere');
$entityids = 1;
$entitys = $mform->createElement('hidden', 'entityids', $entityids);
$mform->insertElementBefore($entitys, 'addsettinglisthere');
$subentitys = $mform->createElement('hidden', 'subentityidse', $entityids);
$mform->insertElementBefore($subentitys, 'addsettinglisthere');
$credithours = $mform->createElement('text', 'mincrhour', get_string('minch', 'local_curriculum'));
$mform->insertElementBefore($credithours, 'addsettinglisthere');
$mform->addRule('mincrhour', get_string('missingtotalch', 'local_curriculum'), 'required', null, 'client');
$mform->setType('mincrhour', PARAM_RAW);
}
if ($settings->entityid == 2) {
$settingheading = $mform->createElement('header', 'moodle', get_string('settingtwo', 'local_curriculum'));
$mform->insertElementBefore($settingheading, 'addsettinglisthere');
$entity = 2;
$entity = $mform->createElement('hidden', 'entityid', $entity);
$mform->insertElementBefore($entity, 'addsettinglisthere');
$subentity = $mform->createElement('hidden', 'subentityid', $entityids);
$mform->insertElementBefore($subentity, 'addsettinglisthere');
$freshman = $mform->createElement('text', 'mincredithours[0]', get_string('freshmancrhr', 'local_curriculum'));
$mform->insertElementBefore($freshman, 'addsettinglisthere');
$sophomore = $mform->createElement('text', 'mincredithours[1]', get_string('sophomorecrhr', 'local_curriculum'));
$mform->insertElementBefore($sophomore, 'addsettinglisthere');
$junior = $mform->createElement('text', 'mincredithours[2]', get_string('juniorcrhr', 'local_curriculum'));
$mform->insertElementBefore($junior, 'addsettinglisthere');
$senior = $mform->createElement('text', 'mincredithours[3]', get_string('seniorcrhr', 'local_curriculum'));
$mform->insertElementBefore($senior, 'addsettinglisthere');
if ($id < 0) {
$mform->setDefault('mincredithours[0]', NULL);
$mform->setDefault('mincredithours[1]', NULL);
$mform->setDefault('mincredithours[2]', NULL);
$mform->setDefault('mincredithours[3]', NULL);
}
}
}
}
/* * End of the curriculum settings
*
*/
}
}
}