original_string: public function get_content_for_output($output) {
          global $CFG;
  
          $bc = new block_contents($this->html_attributes());
          $bc->attributes['data-block'] = $this->name();
          $bc->blockinstanceid = $this->instance->id;
          $bc->blockpositionid = $this->instance->blockpositionid;
  
          if ($this->instance->visible) {
              $bc->content = $this->formatted_contents($output);
              if (!empty($this->content->footer)) {
                  $bc->footer = $this->content->footer;
              }
          } else {
              $bc->add_class('invisible');
          }
  
          if (!$this->hide_header()) {
              $bc->title = $this->title;
          }
  
          if (empty($bc->title)) {
              $bc->arialabel = new lang_string('pluginname', get_class($this));
              $this->arialabel = $bc->arialabel;
          }
  
          if ($this->page->user_is_editing()) {
              $bc->controls = $this->page->blocks->edit_controls($this);
          } else {
              // we must not use is_empty on hidden blocks
              if ($this->is_empty() && !$bc->controls) {
                  return null;
              }
          }
  
          if (empty($CFG->allowuserblockhiding)
                  || (empty($bc->content) && empty($bc->footer))
                  || !$this->instance_can_be_collapsed()) {
              $bc->collapsible = block_contents::NOT_HIDEABLE;
          } else if (get_user_preferences('block' . $bc->blockinstanceid . 'hidden', false)) {
              $bc->collapsible = block_contents::HIDDEN;
          } else {
              $bc->collapsible = block_contents::VISIBLE;
          }
  
          if ($this->instance_can_be_docked() && !$this->hide_header()) {
              $bc->dockable = true;
          }
  
          $bc->annotation = ''; // TODO MDL-19398 need to work out what to say here.
  
          return $bc;
      }
code: public function get_content_for_output($output) {
          global $CFG;
  
          $bc = new block_contents($this->html_attributes());
          $bc->attributes['data-block'] = $this->name();
          $bc->blockinstanceid = $this->instance->id;
          $bc->blockpositionid = $this->instance->blockpositionid;
  
          if ($this->instance->visible) {
              $bc->content = $this->formatted_contents($output);
              if (!empty($this->content->footer)) {
                  $bc->footer = $this->content->footer;
              }
          } else {
              $bc->add_class('invisible');
          }
  
          if (!$this->hide_header()) {
              $bc->title = $this->title;
          }
  
          if (empty($bc->title)) {
              $bc->arialabel = new lang_string('pluginname', get_class($this));
              $this->arialabel = $bc->arialabel;
          }
  
          if ($this->page->user_is_editing()) {
              $bc->controls = $this->page->blocks->edit_controls($this);
          } else {
              // we must not use is_empty on hidden blocks
              if ($this->is_empty() && !$bc->controls) {
                  return null;
              }
          }
  
          if (empty($CFG->allowuserblockhiding)
                  || (empty($bc->content) && empty($bc->footer))
                  || !$this->instance_can_be_collapsed()) {
              $bc->collapsible = block_contents::NOT_HIDEABLE;
          } else if (get_user_preferences('block' . $bc->blockinstanceid . 'hidden', false)) {
              $bc->collapsible = block_contents::HIDDEN;
          } else {
              $bc->collapsible = block_contents::VISIBLE;
          }
  
          if ($this->instance_can_be_docked() && !$this->hide_header()) {
              $bc->dockable = true;
          }
  
          $bc->annotation = ''; // TODO MDL-19398 need to work out what to say here.
  
          return $bc;
      }
code_tokens: public function get_content_for_output ( $ output ) { global $ CFG ; $ bc = new block_contents ( $ this -> html_attributes ( ) ) ; $ bc -> attributes [ 'data-block' ] = $ this -> name ( ) ; $ bc -> blockinstanceid = $ this -> instance -> id ; $ bc -> blockpositionid = $ this -> instance -> blockpositionid ; if ( $ this -> instance -> visible ) { $ bc -> content = $ this -> formatted_contents ( $ output ) ; if ( ! empty ( $ this -> content -> footer ) ) { $ bc -> footer = $ this -> content -> footer ; } } else { $ bc -> add_class ( 'invisible' ) ; } if ( ! $ this -> hide_header ( ) ) { $ bc -> title = $ this -> title ; } if ( empty ( $ bc -> title ) ) { $ bc -> arialabel = new lang_string ( 'pluginname' , get_class ( $ this ) ) ; $ this -> arialabel = $ bc -> arialabel ; } if ( $ this -> page -> user_is_editing ( ) ) { $ bc -> controls = $ this -> page -> blocks -> edit_controls ( $ this ) ; } else { // we must not use is_empty on hidden blocks if ( $ this -> is_empty ( ) && ! $ bc -> controls ) { return null ; } } if ( empty ( $ CFG -> allowuserblockhiding ) || ( empty ( $ bc -> content ) && empty ( $ bc -> footer ) ) || ! $ this -> instance_can_be_collapsed ( ) ) { $ bc -> collapsible = block_contents :: NOT_HIDEABLE ; } else if ( get_user_preferences ( 'block' . $ bc -> blockinstanceid . 'hidden' , false ) ) { $ bc -> collapsible = block_contents :: HIDDEN ; } else { $ bc -> collapsible = block_contents :: VISIBLE ; } if ( $ this -> instance_can_be_docked ( ) && ! $ this -> hide_header ( ) ) { $ bc -> dockable = true ; } $ bc -> annotation = '' ; // TODO MDL-19398 need to work out what to say here. return $ bc ; }
docstring: Return a block_contents object representing the full contents of this block.
  
  This internally calls ->get_content(), and then adds the editing controls etc.
  
  You probably should not override this method, but instead override
  {@link html_attributes()}, {@link formatted_contents()} or {@link get_content()},
  {@link hide_header()}, {@link (get_edit_controls)}, etc.
  
  @return block_contents a representation of the block, for rendering.
  @since Moodle 2.0.
docstring_tokens: Return a block_contents object representing the full contents of this block .