Esempio n. 1
0
 /**
  * Implement the subclass method
  * @param string $module name such as 'core', 'mod_forum' or 'qtype_multichoice'.
  * @param moodle_page $page the page the renderer is outputting content for.
  * @param string $subtype optional subtype such as 'news' resulting to 'mod_forum_news'
  * @return object an object implementing the requested renderer interface.
  */
 public function get_renderer($module, $page, $subtype = null)
 {
     foreach ($this->prefixes as $prefix) {
         if (is_null($subtype)) {
             $classname = $prefix . $module . '_renderer';
         } else {
             $classname = $prefix . $module . '_' . $subtype . '_renderer';
         }
         if (class_exists($classname)) {
             if ($module == 'core') {
                 return new $classname($page);
             } else {
                 return new $classname($page, $this->get_renderer('core', $page));
             }
         }
     }
     return parent::get_renderer($module, $page, $subtype);
 }
Esempio n. 2
0
 public function get_renderer($module, $page, $subtype = null)
 {
     if ($module == 'core') {
         return new custom_corners_core_renderer($page);
     }
     return parent::get_renderer($module, $page, $subtype);
 }