original_string: protected function helper_sortable_heading($text, $sortid = null, $sortby = null, $sorthow = null) {
          $out = html_writer::tag('span', $text, array('class' => 'text'));
  
          if (!is_null($sortid)) {
              if ($sortby !== $sortid || $sorthow !== 'ASC') {
                  $url = new moodle_url($this->page->url);
                  $url->params(array('sort' => $sortid, 'dir' => 'ASC'));
                  $out .= $this->output->action_icon($url,
                          new pix_icon('t/sort_asc', get_string('sortbyx', 'core', s($text)), null, array('class' => 'iconsort')));
              }
              if ($sortby !== $sortid || $sorthow !== 'DESC') {
                  $url = new moodle_url($this->page->url);
                  $url->params(array('sort' => $sortid, 'dir' => 'DESC'));
                  $out .= $this->output->action_icon($url,
                          new pix_icon('t/sort_desc', get_string('sortbyxreverse', 'core', s($text)), null, array('class' => 'iconsort')));
              }
          }
          return $out;
      }
code: protected function helper_sortable_heading($text, $sortid = null, $sortby = null, $sorthow = null) {
          $out = html_writer::tag('span', $text, array('class' => 'text'));
  
          if (!is_null($sortid)) {
              if ($sortby !== $sortid || $sorthow !== 'ASC') {
                  $url = new moodle_url($this->page->url);
                  $url->params(array('sort' => $sortid, 'dir' => 'ASC'));
                  $out .= $this->output->action_icon($url,
                          new pix_icon('t/sort_asc', get_string('sortbyx', 'core', s($text)), null, array('class' => 'iconsort')));
              }
              if ($sortby !== $sortid || $sorthow !== 'DESC') {
                  $url = new moodle_url($this->page->url);
                  $url->params(array('sort' => $sortid, 'dir' => 'DESC'));
                  $out .= $this->output->action_icon($url,
                          new pix_icon('t/sort_desc', get_string('sortbyxreverse', 'core', s($text)), null, array('class' => 'iconsort')));
              }
          }
          return $out;
      }
code_tokens: protected function helper_sortable_heading ( $ text , $ sortid = null , $ sortby = null , $ sorthow = null ) { $ out = html_writer :: tag ( 'span' , $ text , array ( 'class' => 'text' ) ) ; if ( ! is_null ( $ sortid ) ) { if ( $ sortby !== $ sortid || $ sorthow !== 'ASC' ) { $ url = new moodle_url ( $ this -> page -> url ) ; $ url -> params ( array ( 'sort' => $ sortid , 'dir' => 'ASC' ) ) ; $ out .= $ this -> output -> action_icon ( $ url , new pix_icon ( 't/sort_asc' , get_string ( 'sortbyx' , 'core' , s ( $ text ) ) , null , array ( 'class' => 'iconsort' ) ) ) ; } if ( $ sortby !== $ sortid || $ sorthow !== 'DESC' ) { $ url = new moodle_url ( $ this -> page -> url ) ; $ url -> params ( array ( 'sort' => $ sortid , 'dir' => 'DESC' ) ) ; $ out .= $ this -> output -> action_icon ( $ url , new pix_icon ( 't/sort_desc' , get_string ( 'sortbyxreverse' , 'core' , s ( $ text ) ) , null , array ( 'class' => 'iconsort' ) ) ) ; } } return $ out ; }
docstring: Renders a text with icons to sort by the given column
  
  This is intended for table headings.
  
  @param string $text    The heading text
  @param string $sortid  The column id used for sorting
  @param string $sortby  Currently sorted by (column id)
  @param string $sorthow Currently sorted how (ASC|DESC)
  
  @return string
docstring_tokens: Renders a text with icons to sort by the given column