original_string: protected function get_icons($element) {
          global $CFG, $USER, $OUTPUT;
  
          if (!$USER->gradeediting[$this->courseid]) {
              return '<div class="grade_icons" />';
          }
  
          // Init all icons
          $editicon = '';
  
          $editable = true;
  
          if ($element['type'] == 'grade') {
              $item = $element['object']->grade_item;
              if ($item->is_course_item() or $item->is_category_item()) {
                  $editable = $this->overridecat;
              }
          }
  
          if ($element['type'] != 'categoryitem' && $element['type'] != 'courseitem' && $editable) {
              $editicon = $this->gtree->get_edit_icon($element, $this->gpr);
          }
  
          $editcalculationicon = '';
          $showhideicon        = '';
          $lockunlockicon      = '';
  
          if (has_capability('moodle/grade:manage', $this->context)) {
              if ($this->get_pref('showcalculations')) {
                  $editcalculationicon = $this->gtree->get_calculation_icon($element, $this->gpr);
              }
  
              if ($this->get_pref('showeyecons')) {
                  $showhideicon = $this->gtree->get_hiding_icon($element, $this->gpr);
              }
  
              if ($this->get_pref('showlocks')) {
                  $lockunlockicon = $this->gtree->get_locking_icon($element, $this->gpr);
              }
  
          }
  
          $gradeanalysisicon   = '';
          if ($this->get_pref('showanalysisicon') && $element['type'] == 'grade') {
              $gradeanalysisicon .= $this->gtree->get_grade_analysis_icon($element['object']);
          }
  
          return $OUTPUT->container($editicon.$editcalculationicon.$showhideicon.$lockunlockicon.$gradeanalysisicon, 'grade_icons');
      }
code: protected function get_icons($element) {
          global $CFG, $USER, $OUTPUT;
  
          if (!$USER->gradeediting[$this->courseid]) {
              return '<div class="grade_icons" />';
          }
  
          // Init all icons
          $editicon = '';
  
          $editable = true;
  
          if ($element['type'] == 'grade') {
              $item = $element['object']->grade_item;
              if ($item->is_course_item() or $item->is_category_item()) {
                  $editable = $this->overridecat;
              }
          }
  
          if ($element['type'] != 'categoryitem' && $element['type'] != 'courseitem' && $editable) {
              $editicon = $this->gtree->get_edit_icon($element, $this->gpr);
          }
  
          $editcalculationicon = '';
          $showhideicon        = '';
          $lockunlockicon      = '';
  
          if (has_capability('moodle/grade:manage', $this->context)) {
              if ($this->get_pref('showcalculations')) {
                  $editcalculationicon = $this->gtree->get_calculation_icon($element, $this->gpr);
              }
  
              if ($this->get_pref('showeyecons')) {
                  $showhideicon = $this->gtree->get_hiding_icon($element, $this->gpr);
              }
  
              if ($this->get_pref('showlocks')) {
                  $lockunlockicon = $this->gtree->get_locking_icon($element, $this->gpr);
              }
  
          }
  
          $gradeanalysisicon   = '';
          if ($this->get_pref('showanalysisicon') && $element['type'] == 'grade') {
              $gradeanalysisicon .= $this->gtree->get_grade_analysis_icon($element['object']);
          }
  
          return $OUTPUT->container($editicon.$editcalculationicon.$showhideicon.$lockunlockicon.$gradeanalysisicon, 'grade_icons');
      }
code_tokens: protected function get_icons ( $ element ) { global $ CFG , $ USER , $ OUTPUT ; if ( ! $ USER -> gradeediting [ $ this -> courseid ] ) { return '<div class="grade_icons" />' ; } // Init all icons $ editicon = '' ; $ editable = true ; if ( $ element [ 'type' ] == 'grade' ) { $ item = $ element [ 'object' ] -> grade_item ; if ( $ item -> is_course_item ( ) or $ item -> is_category_item ( ) ) { $ editable = $ this -> overridecat ; } } if ( $ element [ 'type' ] != 'categoryitem' && $ element [ 'type' ] != 'courseitem' && $ editable ) { $ editicon = $ this -> gtree -> get_edit_icon ( $ element , $ this -> gpr ) ; } $ editcalculationicon = '' ; $ showhideicon = '' ; $ lockunlockicon = '' ; if ( has_capability ( 'moodle/grade:manage' , $ this -> context ) ) { if ( $ this -> get_pref ( 'showcalculations' ) ) { $ editcalculationicon = $ this -> gtree -> get_calculation_icon ( $ element , $ this -> gpr ) ; } if ( $ this -> get_pref ( 'showeyecons' ) ) { $ showhideicon = $ this -> gtree -> get_hiding_icon ( $ element , $ this -> gpr ) ; } if ( $ this -> get_pref ( 'showlocks' ) ) { $ lockunlockicon = $ this -> gtree -> get_locking_icon ( $ element , $ this -> gpr ) ; } } $ gradeanalysisicon = '' ; if ( $ this -> get_pref ( 'showanalysisicon' ) && $ element [ 'type' ] == 'grade' ) { $ gradeanalysisicon .= $ this -> gtree -> get_grade_analysis_icon ( $ element [ 'object' ] ) ; } return $ OUTPUT -> container ( $ editicon . $ editcalculationicon . $ showhideicon . $ lockunlockicon . $ gradeanalysisicon , 'grade_icons' ) ; }
docstring: Given a grade_category, grade_item or grade_grade, this function
  figures out the state of the object and builds then returns a div
  with the icons needed for the grader report.
  
  @param array $element
  @return string HTML
docstring_tokens: Given a grade_category grade_item or grade_grade this function figures out the state of the object and builds then returns a div with the icons needed for the grader report .