Exemplo n.º 1
0
 /**
  * Returns rendered widget.
  *
  * Add another error catching layer for
  * rendering reports.
  *
  * @param renderable $widget instance with renderable interface
  * @return string
  */
 public function render(renderable $widget)
 {
     try {
         return parent::render($widget);
     } catch (coding_exception $e) {
         if ($widget instanceof mr_report_abstract) {
             return $this->render_mr_report_abstract($widget);
         }
         // Re-throw original error
         throw $e;
     }
 }
Exemplo n.º 2
0
 /**
  * Override render method.
  *
  * @return string
  */
 public function render(renderable $renderable, $options = array())
 {
     if ($renderable instanceof block_xp_rule_base) {
         return $this->render_block_xp_rule($renderable, $options);
     } else {
         if ($renderable instanceof block_xp_ruleset) {
             return $this->render_block_xp_ruleset($renderable, $options);
         }
     }
     return parent::render($renderable);
 }