本文整理汇总了PHP中hierarchy::get_courses_module方法的典型用法代码示例。如果您正苦于以下问题:PHP hierarchy::get_courses_module方法的具体用法?PHP hierarchy::get_courses_module怎么用?PHP hierarchy::get_courses_module使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hierarchy
的用法示例。
在下文中一共展示了hierarchy::get_courses_module方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
//If all the courses are assigned to the plan, Disable the button.
if ($moduleid)
echo $OUTPUT->box(get_string('noteforassignmodule', 'local_curriculum'));
else
echo $OUTPUT->box(get_string('noteforassigndept', 'local_curriculum'));
if ($departmentid) {
$ccourses = $DB->get_records('local_cobaltcourses', array('departmentid' => $departmentid, 'visible' => 1));
$cobaltcourses = array();
foreach ($ccourses as $ccourse) {
$cobaltcourses[$ccourse->id] = format_string($ccourse->fullname);
}
} else {
$cobaltcourses = $hierarchy->get_courses_module($moduleid, $none = true);
}
if (empty($cobaltcourses)) {
//Display message if no courses are available in the selected module.
if ($moduleid)
$record = $DB->get_field('local_module', 'fullname', array('id' => $moduleid));
if ($departmentid)
$record = $DB->get_field('local_department', 'fullname', array('id' => $departmentid));
$linkurl=$CFG->wwwroot.'/local/modules/assigncourse.php?moduleid='.$moduleid;
$linkname=get_string('assigncoursetomodule', 'local_curriculum');
echo $OUTPUT->box($hierarchy->cobalt_navigation_msg(get_string('nocoursesmodule', 'local_curriculum', $record)." Click here to ",$linkname,$linkurl));
}else {
$table = new html_table();
$heading = '<a id="selectall" style="cursor:pointer;">' . get_string('selectall') . '</a>';
示例2: hierarchy
/**
* @method assign_modules
* @todo Assigns all the courses under the module to the plan
* @param int $planid Curriculm plan ID
* @param int $moveto Curriculum id
* @param int $module Module ID.
* */
function assign_modules($planid, $moveto, $module) {
global $DB, $CFG;
$hierarchy = new hierarchy();
$cobaltcourses = $hierarchy->get_courses_module($module, $none = true);
$crs = array();
foreach ($cobaltcourses as $courseid => $coursename) {
$params = array('courseid' => $courseid);
if ($planid) {
$params['planid'] = $planid;
} else {
$params['curriculumid'] = $moveto;
}
if (!$DB->record_exists('local_curriculum_plancourses', $params))
$crs[] = $courseid;
}
return $this->assign_courses($planid, $crs, $moveto, $module);
}