Beispiel #1
0
 /**
  * Setup controller tabs
  *
  * This goes through all of the controllers
  * and calls the add_tabs() method to get all
  * the available tabs.
  *
  * @return void
  */
 protected function init_tabs()
 {
     global $CFG;
     $url = $this->new_url();
     $url->remove_params('controller');
     $this->tabs = new mr_html_tabs($url, $this->component);
     $this->tabs->set($this->name, $this->action);
     // Restirct to only files and single depth
     $files = get_directory_list("{$CFG->dirroot}/{$this->plugin}/controller", '', false);
     foreach ($files as $file) {
         $name = pathinfo($file, PATHINFO_FILENAME);
         $this->helper->load->file("controller/{$name}");
         $classname = $this->helper->load->classname("controller/{$name}");
         call_user_func_array(array($classname, 'add_tabs'), array($this, &$this->tabs));
     }
 }