original_string: public function format_line($item) {
          global $OUTPUT;
  
          $grade = $this->fetch_grade_or_default($item, $this->item->id);
          $lockicon = '';
  
          $lockeditem = $lockeditemgrade = 0;
          if (!empty($grade->locked)) {
              $lockeditem = 1;
          }
          if (!empty($grade->grade_item->locked)) {
              $lockeditemgrade = 1;
          }
          // Check both grade and grade item.
          if ($lockeditem || $lockeditemgrade) {
               $lockicon = $OUTPUT->pix_icon('t/locked', 'grade is locked');
          }
  
          $iconstring = get_string('filtergrades', 'gradereport_singleview', $item->get_name());
  
          // Create a fake gradetreeitem so we can call get_element_header().
          // The type logic below is from grade_category->_get_children_recursion().
          $gradetreeitem = array();
          if (in_array($item->itemtype, array('course', 'category'))) {
              $gradetreeitem['type'] = $item->itemtype.'item';
          } else {
              $gradetreeitem['type'] = 'item';
          }
          $gradetreeitem['object'] = $item;
          $gradetreeitem['userid'] = $this->item->id;
  
          $itemlabel = $this->structure->get_element_header($gradetreeitem, true, false, false, false, true);
          $grade->label = $item->get_name();
  
          $line = array(
              $OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', $iconstring)),
              $this->format_icon($item) . $lockicon . $itemlabel,
              $this->category($item),
              new range($item)
          );
          $lineclasses = array(
              "action",
              "gradeitem",
              "category",
              "range"
          );
  
          $outputline = array();
          $i = 0;
          foreach ($line as $key => $value) {
              $cell = new \html_table_cell($value);
              if ($isheader = $i == 1) {
                  $cell->header = $isheader;
                  $cell->scope = "row";
              }
              if (array_key_exists($key, $lineclasses)) {
                  $cell->attributes['class'] = $lineclasses[$key];
              }
              $outputline[] = $cell;
              $i++;
          }
  
          return $this->format_definition($outputline, $grade);
      }
code: public function format_line($item) {
          global $OUTPUT;
  
          $grade = $this->fetch_grade_or_default($item, $this->item->id);
          $lockicon = '';
  
          $lockeditem = $lockeditemgrade = 0;
          if (!empty($grade->locked)) {
              $lockeditem = 1;
          }
          if (!empty($grade->grade_item->locked)) {
              $lockeditemgrade = 1;
          }
          // Check both grade and grade item.
          if ($lockeditem || $lockeditemgrade) {
               $lockicon = $OUTPUT->pix_icon('t/locked', 'grade is locked');
          }
  
          $iconstring = get_string('filtergrades', 'gradereport_singleview', $item->get_name());
  
          // Create a fake gradetreeitem so we can call get_element_header().
          // The type logic below is from grade_category->_get_children_recursion().
          $gradetreeitem = array();
          if (in_array($item->itemtype, array('course', 'category'))) {
              $gradetreeitem['type'] = $item->itemtype.'item';
          } else {
              $gradetreeitem['type'] = 'item';
          }
          $gradetreeitem['object'] = $item;
          $gradetreeitem['userid'] = $this->item->id;
  
          $itemlabel = $this->structure->get_element_header($gradetreeitem, true, false, false, false, true);
          $grade->label = $item->get_name();
  
          $line = array(
              $OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', $iconstring)),
              $this->format_icon($item) . $lockicon . $itemlabel,
              $this->category($item),
              new range($item)
          );
          $lineclasses = array(
              "action",
              "gradeitem",
              "category",
              "range"
          );
  
          $outputline = array();
          $i = 0;
          foreach ($line as $key => $value) {
              $cell = new \html_table_cell($value);
              if ($isheader = $i == 1) {
                  $cell->header = $isheader;
                  $cell->scope = "row";
              }
              if (array_key_exists($key, $lineclasses)) {
                  $cell->attributes['class'] = $lineclasses[$key];
              }
              $outputline[] = $cell;
              $i++;
          }
  
          return $this->format_definition($outputline, $grade);
      }
code_tokens: public function format_line ( $ item ) { global $ OUTPUT ; $ grade = $ this -> fetch_grade_or_default ( $ item , $ this -> item -> id ) ; $ lockicon = '' ; $ lockeditem = $ lockeditemgrade = 0 ; if ( ! empty ( $ grade -> locked ) ) { $ lockeditem = 1 ; } if ( ! empty ( $ grade -> grade_item -> locked ) ) { $ lockeditemgrade = 1 ; } // Check both grade and grade item. if ( $ lockeditem || $ lockeditemgrade ) { $ lockicon = $ OUTPUT -> pix_icon ( 't/locked' , 'grade is locked' ) ; } $ iconstring = get_string ( 'filtergrades' , 'gradereport_singleview' , $ item -> get_name ( ) ) ; // Create a fake gradetreeitem so we can call get_element_header(). // The type logic below is from grade_category->_get_children_recursion(). $ gradetreeitem = array ( ) ; if ( in_array ( $ item -> itemtype , array ( 'course' , 'category' ) ) ) { $ gradetreeitem [ 'type' ] = $ item -> itemtype . 'item' ; } else { $ gradetreeitem [ 'type' ] = 'item' ; } $ gradetreeitem [ 'object' ] = $ item ; $ gradetreeitem [ 'userid' ] = $ this -> item -> id ; $ itemlabel = $ this -> structure -> get_element_header ( $ gradetreeitem , true , false , false , false , true ) ; $ grade -> label = $ item -> get_name ( ) ; $ line = array ( $ OUTPUT -> action_icon ( $ this -> format_link ( 'grade' , $ item -> id ) , new pix_icon ( 't/editstring' , $ iconstring ) ) , $ this -> format_icon ( $ item ) . $ lockicon . $ itemlabel , $ this -> category ( $ item ) , new range ( $ item ) ) ; $ lineclasses = array ( "action" , "gradeitem" , "category" , "range" ) ; $ outputline = array ( ) ; $ i = 0 ; foreach ( $ line as $ key => $ value ) { $ cell = new \ html_table_cell ( $ value ) ; if ( $ isheader = $ i == 1 ) { $ cell -> header = $ isheader ; $ cell -> scope = "row" ; } if ( array_key_exists ( $ key , $ lineclasses ) ) { $ cell -> attributes [ 'class' ] = $ lineclasses [ $ key ] ; } $ outputline [ ] = $ cell ; $ i ++ ; } return $ this -> format_definition ( $ outputline , $ grade ) ; }
docstring: Format each row of the table.
  
  @param grade_item $item
  @return string
docstring_tokens: Format each row of the table .