original_string: protected function import_tour() {
          global $PAGE;
          $PAGE->navbar->add(get_string('importtour', 'tool_usertours'), helper::get_import_tour_link());
  
          $form = new forms\importtour();
  
          if ($form->is_cancelled()) {
              redirect(helper::get_list_tour_link());
          } else if ($form->get_data()) {
              // Importing a tour.
              $tourconfigraw = $form->get_file_content('tourconfig');
              $tour = self::import_tour_from_json($tourconfigraw);
  
              redirect($tour->get_view_link());
          } else {
              $this->header();
              $form->display();
              $this->footer();
          }
      }
code: protected function import_tour() {
          global $PAGE;
          $PAGE->navbar->add(get_string('importtour', 'tool_usertours'), helper::get_import_tour_link());
  
          $form = new forms\importtour();
  
          if ($form->is_cancelled()) {
              redirect(helper::get_list_tour_link());
          } else if ($form->get_data()) {
              // Importing a tour.
              $tourconfigraw = $form->get_file_content('tourconfig');
              $tour = self::import_tour_from_json($tourconfigraw);
  
              redirect($tour->get_view_link());
          } else {
              $this->header();
              $form->display();
              $this->footer();
          }
      }
code_tokens: protected function import_tour ( ) { global $ PAGE ; $ PAGE -> navbar -> add ( get_string ( 'importtour' , 'tool_usertours' ) , helper :: get_import_tour_link ( ) ) ; $ form = new forms \ importtour ( ) ; if ( $ form -> is_cancelled ( ) ) { redirect ( helper :: get_list_tour_link ( ) ) ; } else if ( $ form -> get_data ( ) ) { // Importing a tour. $ tourconfigraw = $ form -> get_file_content ( 'tourconfig' ) ; $ tour = self :: import_tour_from_json ( $ tourconfigraw ) ; redirect ( $ tour -> get_view_link ( ) ) ; } else { $ this -> header ( ) ; $ form -> display ( ) ; $ this -> footer ( ) ; } }
docstring: Handle tour import.
docstring_tokens: Handle tour import .