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


PHP navigation_node::make_active方法代碼示例

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


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

示例1: load_activity

 /**
  * Loads the navigation structure for the given activity into the activities node.
  *
  * This method utilises a callback within the modules lib.php file to load the
  * content specific to activity given.
  *
  * The callback is a method: {modulename}_extend_navigation()
  * Examples:
  *  * {@see forum_extend_navigation()}
  *  * {@see workshop_extend_navigation()}
  *
  * @param cm_info|stdClass $cm
  * @param stdClass $course
  * @param navigation_node $activity
  * @return bool
  */
 protected function load_activity($cm, stdClass $course, navigation_node $activity)
 {
     global $CFG, $DB;
     // make sure we have a $cm from get_fast_modinfo as this contains activity access details
     if (!$cm instanceof cm_info) {
         $modinfo = get_fast_modinfo($course);
         $cm = $modinfo->get_cm($cm->id);
     }
     $activity->make_active();
     $file = $CFG->dirroot . '/mod/' . $cm->modname . '/lib.php';
     $function = $cm->modname . '_extend_navigation';
     if (file_exists($file)) {
         require_once $file;
         if (function_exists($function)) {
             $activtyrecord = $DB->get_record($cm->modname, array('id' => $cm->instance), '*', MUST_EXIST);
             $function($activity, $course, $activtyrecord, $cm);
             return true;
         }
     }
     $activity->nodetype = navigation_node::NODETYPE_LEAF;
     return false;
 }
開發者ID:nigeldaley,項目名稱:moodle,代碼行數:38,代碼來源:navigationlib.php

示例2: load_activity

 /**
  * Loads the navigation structure for the given activity into the activities node.
  *
  * This method utilises a callback within the modules lib.php file to load the
  * content specific to activity given.
  *
  * The callback is a method: {modulename}_extend_navigation()
  * Examples:
  *  * {@link forum_extend_navigation()}
  *  * {@link workshop_extend_navigation()}
  *
  * @param cm_info|stdClass $cm
  * @param stdClass $course
  * @param navigation_node $activity
  * @return bool
  */
 protected function load_activity($cm, stdClass $course, navigation_node $activity)
 {
     global $CFG, $DB;
     // make sure we have a $cm from get_fast_modinfo as this contains activity access details
     if (!$cm instanceof cm_info) {
         $modinfo = get_fast_modinfo($course);
         $cm = $modinfo->get_cm($cm->id);
     }
     $activity->nodetype = navigation_node::NODETYPE_LEAF;
     $activity->make_active();
     $file = $CFG->dirroot . '/mod/' . $cm->modname . '/lib.php';
     $function = $cm->modname . '_extend_navigation';
     if (file_exists($file)) {
         require_once $file;
         if (function_exists($function)) {
             $activtyrecord = $DB->get_record($cm->modname, array('id' => $cm->instance), '*', MUST_EXIST);
             $function($activity, $course, $activtyrecord, $cm);
         }
     }
     // Allow the active advanced grading method plugin to append module navigation
     $featuresfunc = $cm->modname . '_supports';
     if (function_exists($featuresfunc) && $featuresfunc(FEATURE_ADVANCED_GRADING)) {
         require_once $CFG->dirroot . '/grade/grading/lib.php';
         $gradingman = get_grading_manager($cm->context, $cm->modname);
         $gradingman->extend_navigation($this, $activity);
     }
     return $activity->has_children();
 }
開發者ID:saurabh947,項目名稱:MoodleLearning,代碼行數:44,代碼來源:navigationlib.php

示例3: load_activity

 /**
  * Loads the navigation structure for the given activity into the activities node.
  *
  * This method utilises a callback within the modules lib.php file to load the
  * content specific to activity given.
  *
  * The callback is a method: {modulename}_extend_navigation()
  * Examples:
  *  * {@see forum_extend_navigation()}
  *  * {@see workshop_extend_navigation()}
  *
  * @param stdClass $cm
  * @param stdClass $course
  * @param navigation_node $activity
  * @return bool
  */
 protected function load_activity(stdClass $cm, stdClass $course, navigation_node $activity)
 {
     global $CFG, $DB;
     $activity->make_active();
     $file = $CFG->dirroot . '/mod/' . $cm->modname . '/lib.php';
     $function = $cm->modname . '_extend_navigation';
     if (file_exists($file)) {
         require_once $file;
         if (function_exists($function)) {
             $activtyrecord = $DB->get_record($cm->modname, array('id' => $cm->instance), '*', MUST_EXIST);
             $function($activity, $course, $activtyrecord, $cm);
             return true;
         }
     }
     $activity->nodetype = navigation_node::NODETYPE_LEAF;
     return false;
 }
開發者ID:vuchannguyen,項目名稱:web,代碼行數:33,代碼來源:navigationlib.php


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