Beispiel #1
0
 public function box($contents, $classes = 'generalbox', $id = null, $attributes = array()) {
     if (isset($attributes['data-rel']) && $attributes['data-rel'] === 'fatalerror') {
         return html_writer::div($contents, 'alert alert-danger', $attributes);
     }
     return parent::box($contents, $classes, $id, $attributes);
 }
 /**
  * Make the formatted HTML ouput.
  *
  * Also adds the required javascript call to the page output.
  *
  * @param core_renderer $output
  * @return string HTML
  */
 protected function formatted_contents($output)
 {
     // based of code in admin_tree
     global $PAGE;
     // TODO change this when there is a proper way for blocks to get stuff into head.
     static $eventattached;
     if ($eventattached === null) {
         $eventattached = true;
     }
     if (!$this->content) {
         $this->content = new stdClass();
         $this->content->items = array();
     }
     $this->get_required_javascript();
     $this->get_content();
     $content = $output->tree_block_contents($this->content->items, array('class' => 'block_tree list'));
     if (isset($this->id) && !is_numeric($this->id)) {
         $content = $output->box($content, 'block_tree_box', $this->id);
     }
     return $content;
 }