original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Make the formatted HTML ouput.
  
  Also adds the required javascript call to the page output.
  
  @param core_renderer $output
  @return string HTML
docstring_tokens: Make the formatted HTML ouput .