コード例 #1
0
 /**
  * Constructs with item details.
  *
  * @param \stdClass $course Optional course param (otherwise uses $SITE)
  * @param int $userid Userid for modinfo (if used)
  */
 public function __construct($course = null, $userid = 0)
 {
     global $SITE;
     if (!$course) {
         $course = $SITE;
     }
     parent::__construct($course, true, null);
     $this->userid = $userid;
 }
コード例 #2
0
ファイル: info_module.php プロジェクト: adonm/learning
 /**
  * Constructs with item details.
  *
  * @param \cm_info $cm Course-module object
  */
 public function __construct(\cm_info $cm)
 {
     parent::__construct($cm->get_course(), $cm->visible, $cm->availability);
     $this->cm = $cm;
 }
コード例 #3
0
 /**
  * Constructs with item details.
  *
  * @param \section_info $section Section object
  */
 public function __construct(\section_info $section)
 {
     parent::__construct($section->modinfo->get_course(), $section->visible, $section->availability);
     $this->section = $section;
 }