original_string: public function extend_navigation(global_navigation $navigation, navigation_node $node=null) {
          if (has_capability('moodle/grade:managegradingforms', $this->get_context())) {
              // No need for preview if user can manage forms, he will have link to manage.php in settings instead.
              return;
          }
          if ($this->is_form_defined() && ($options = $this->get_options()) && !empty($options['alwaysshowdefinition'])) {
              $node->add(get_string('gradingof', 'gradingform_guide', get_grading_manager($this->get_areaid())->get_area_title()),
                      new moodle_url('/grade/grading/form/'.$this->get_method_name().'/preview.php',
                          array('areaid' => $this->get_areaid())), settings_navigation::TYPE_CUSTOM);
          }
      }
code: public function extend_navigation(global_navigation $navigation, navigation_node $node=null) {
          if (has_capability('moodle/grade:managegradingforms', $this->get_context())) {
              // No need for preview if user can manage forms, he will have link to manage.php in settings instead.
              return;
          }
          if ($this->is_form_defined() && ($options = $this->get_options()) && !empty($options['alwaysshowdefinition'])) {
              $node->add(get_string('gradingof', 'gradingform_guide', get_grading_manager($this->get_areaid())->get_area_title()),
                      new moodle_url('/grade/grading/form/'.$this->get_method_name().'/preview.php',
                          array('areaid' => $this->get_areaid())), settings_navigation::TYPE_CUSTOM);
          }
      }
code_tokens: public function extend_navigation ( global_navigation $ navigation , navigation_node $ node = null ) { if ( has_capability ( 'moodle/grade:managegradingforms' , $ this -> get_context ( ) ) ) { // No need for preview if user can manage forms, he will have link to manage.php in settings instead. return ; } if ( $ this -> is_form_defined ( ) && ( $ options = $ this -> get_options ( ) ) && ! empty ( $ options [ 'alwaysshowdefinition' ] ) ) { $ node -> add ( get_string ( 'gradingof' , 'gradingform_guide' , get_grading_manager ( $ this -> get_areaid ( ) ) -> get_area_title ( ) ) , new moodle_url ( '/grade/grading/form/' . $ this -> get_method_name ( ) . '/preview.php' , array ( 'areaid' => $ this -> get_areaid ( ) ) ) , settings_navigation :: TYPE_CUSTOM ) ; } }
docstring: Extends the module navigation
  
  This function is called when the context for the page is an activity module with the
  FEATURE_ADVANCED_GRADING and there is an area with the active grading method set to the given plugin.
  
  @param global_navigation $navigation {@link global_navigation}
  @param navigation_node $node {@link navigation_node}
  @return void
docstring_tokens: Extends the module navigation