Example #1
0
 /**
  * Sets up navigation entries.
  *
  * @param stdClass $instancesnode
  * @param stdClass $instance
  * @return void
  */
 public function add_course_navigation($instancesnode, stdClass $instance)
 {
     if ($instance->enrol !== 'auto') {
         throw new coding_exception('Invalid enrol instance type!');
     }
     $context = context_course::instance($instance->courseid);
     if (has_capability('enrol/auto:config', $context)) {
         $managelink = new moodle_url('/enrol/auto/edit.php', array('courseid' => $instance->courseid, 'id' => $instance->id));
         $instancesnode->add($this->get_instance_name($instance), $managelink, navigation_node::TYPE_SETTING);
     }
 }
Example #2
0
 /**
  * Gets the 'bar' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \stdClass A stdClass instance
  */
 protected function getBarService()
 {
     $a = new \stdClass();
     $a->add($this);
     return $this->services['bar'] = new \stdClass($a);
 }
Example #3
0
 public function addCategory(\TaskBundle\Entity\Category $category)
 {
     $this->categories->add($category);
 }
 /**
  * Set layoutsAssigned
  *
  * @param  \stdClass      $layoutsAssigned
  * @return LayoutCustomer
  */
 public function addLayoutAssigned($layoutsAssigned)
 {
     $this->layoutsAssigned->add($layoutsAssigned);
     return $this;
 }
Example #5
0
/**
 * Adds module specific settings to the navigation block
 * @global stdClass $CFG
 * @param stdClass $navigation
 * @param stdClass $course
 * @param stdClass $module
 * @param stdClass $cm
 */
function pcast_extend_navigation($navigation, $course, $module, $cm)
{
    global $CFG;
    $navigation->add(get_string('standardview', 'pcast'), new moodle_url('/mod/pcast/view.php', array('id' => $cm->id, 'mode' => PCAST_STANDARD_VIEW)));
    $navigation->add(get_string('categoryview', 'pcast'), new moodle_url('/mod/pcast/view.php', array('id' => $cm->id, 'mode' => PCAST_CATEGORY_VIEW)));
    $navigation->add(get_string('dateview', 'pcast'), new moodle_url('/mod/pcast/view.php', array('id' => $cm->id, 'mode' => PCAST_DATE_VIEW)));
    $navigation->add(get_string('authorview', 'pcast'), new moodle_url('/mod/pcast/view.php', array('id' => $cm->id, 'mode' => PCAST_AUTHOR_VIEW)));
}