예제 #1
0
 /**
  * Handle tour import.
  */
 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();
         }
     }
 }
예제 #2
0
파일: importtour.php 프로젝트: dg711/moodle
 /**
  * Create the import tour form.
  */
 public function __construct()
 {
     parent::__construct(\tool_usertours\helper::get_import_tour_link());
 }