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


PHP hierarchy::get_courses_module方法代碼示例

本文整理匯總了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>';
開發者ID:anilch,項目名稱:Personel,代碼行數:31,代碼來源:assigncourses.php

示例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);
 }
開發者ID:anilch,項目名稱:Personel,代碼行數:24,代碼來源:lib.php


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