Print the view tour page.

@param   int         $tourid     The ID of the tour to display.
16646
protected function view_tour($tourid) {
        global $PAGE;
        $tour = helper::get_tour($tourid);

        $PAGE->navbar->add($tour->get_name(), $tour->get_view_link());

        $this->header($tour->get_name());
        echo \html_writer::span(get_string('viewtour_info', 'tool_usertours', [
                'tourname'  => $tour->get_name(),
                'path'      => $tour->get_pathmatch(),
            ]));
        echo \html_writer::div(get_string('viewtour_edit', 'tool_usertours', [
                'editlink'  => $tour->get_edit_link()->out(),
                'resetlink' => $tour->get_reset_link()->out(),
            ]));

        $table = new table\step_list($tourid);
        foreach ($tour->get_steps() as $step) {
            $table->add_data_keyed($table->format_row($step));
        }

        $table->finish_output();
        $this->print_edit_step_link($tourid);

        // JS for Step management.
        $PAGE->requires->js_call_amd('tool_usertours/managesteps', 'setup');

        $this->footer();
    }
304809
function(id) {
      var t = this;

      // Is there a tour running already?
      if (t.tourView) {
        t.tourView.stop();
      }

      // Load the Tour and start it
      var tour = new UI.Tour({id:id});
      tour.fetch(function(err){
        if (err) {
          alert("Error: Cannot open tour id: " + id);
          console.error(e);
          return;
        }

        // Go to the first page
        var pages = tour.get('pages');
        if (!pages.length) {
          alert('No pages in tour: ' + tour.get('title'));
          return;
        }

        // Save the current tour, and navigate to it
        localStorage.currentTour = JSON.stringify(tour);
        t.navigateTo(pages[0].url);
      });
    }
1171253
public function view($id = null) {
		$cell = $this->Cells->get($id, [
			'contain' => []
		]);
		$this->set('cell', $cell);
	}
1314428
public function display($replicator_id)
    {
        $widget = $this->getClonedWidget($replicator_id);
        // substitute the replicator_id into the content block's contents
        $widget->content = str_replace('%s', $replicator_id, $widget->content);
        $widget->display();
    }
526151
public function preview($id = null)
    {
        $photo = $this->Photos->findPendingById($id)
            ->select(['id', 'album_id', 'filename'])
            ->contain([$this->Photos->Albums->getAlias() => ['fields' => ['id', 'title', 'slug']]])
            ->firstOrFail();

        $this->set(compact('photo'));
        $this->render('view');
    }
951620
public static function data_for_user_evidence_page($id) {
        global $PAGE;
        $params = self::validate_parameters(self::data_for_user_evidence_page_parameters(),
            array('id' => $id));

        $userevidence = api::read_user_evidence($id);
        self::validate_context($userevidence->get_context());
        $output = $PAGE->get_renderer('tool_lp');

        $renderable = new \tool_lp\output\user_evidence_page($userevidence);
        return $renderable->export_for_template($output);
    }
697290
public static function get_edit_tour_link($tourid = null) {
        $link = new \moodle_url('/admin/tool/usertours/configure.php');

        if ($tourid) {
            $link->param('action', manager::ACTION_EDITTOUR);
            $link->param('id', $tourid);
        } else {
            $link->param('action', manager::ACTION_NEWTOUR);
        }

        return $link;
    }
1100644
public function render($postId)
    {
        $meta = $this->metabox->getMeta($postId);

        $this->getField()->getManager()->renderPreview(
            Arr::get($meta, $this->path)
        );
    }
446278
public function show($id)
    {
        try
        {
            $throttle = $this->users->getUserThrottle($id);
            $user = $throttle->getUser();
            $permissions = $user->getMergedPermissions();

            return View::make(Config::get('cpanel::views.users_show'))
                ->with('user',$user)
                ->with('groups',$user->getGroups())
                ->with('permissions',$permissions)
                ->with('throttle',$throttle);
        }
        catch ( UserNotFoundException $e)
        {
            return Redirect::route('cpanel.users.index')
                ->with('error', $e->getMessage());
        }
    }
863491
public function view($id = null) {
		$country = $this->Countries->get($id);

		$this->set(compact('country'));
	}
888839
protected function delete_tour($tourid) {
        require_sesskey();

        $tour = tour::instance($tourid);
        $tour->remove();

        redirect(helper::get_list_tour_link());
    }
949731
protected function export_tour($id) {
        $tour = tour::instance($id);

        // Grab the full data record.
        $export = $tour->to_record();

        // Remove the id.
        unset($export->id);

        // Set the version.
        $export->version = get_config('tool_usertours', 'version');

        // Step export.
        $export->steps = [];
        foreach ($tour->get_steps() as $step) {
            $record = $step->to_record();
            unset($record->id);
            unset($record->tourid);

            $export->steps[] = $record;
        }

        $exportstring = json_encode($export);

        $filename = 'tour_export_' . $tour->get_id() . '_' . time() . '.json';

        // Force download.
        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
        header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0');
        header('Expires: ' . gmdate('D, d M Y H:i:s', 0) . 'GMT');
        header('Pragma: no-cache');
        header('Accept-Ranges: none');
        header('Content-disposition: attachment; filename=' . $filename);
        header('Content-length: ' . strlen($exportstring));
        header('Content-type: text/calendar; charset=utf-8');

        echo $exportstring;
        die;
    }
1141378
public function show($id)
    {
        $scheduler = Scheduler::findOrFail($id);

        return view('eyewitness::scheduler.show')->withEye(app(Eye::class))
                                                 ->withScheduler($scheduler)
                                                 ->withHistories($scheduler->history()->simplePaginate(config('eyewitness.pagination_size', 50)))
                                                 ->withTransformer(new ChartTransformer);
    }
598697
public function preview_onConvertGuest($recordId)
    {
        $model = $this->formFindModelObject($recordId);

        // Convert user and send notification
        $model->convertToRegistered(post('send_registration_notification', false));

        // Remove user from guest group
        if ($group = UserGroup::getGuestGroup()) {
            $model->groups()->remove($group);
        }

        // Add user to new group
        if (
            ($groupId = post('new_group')) &&
            ($group = UserGroup::find($groupId))
        ) {
            $model->groups()->add($group);
        }

        Flash::success(Lang::get('rainlab.user::lang.users.convert_guest_success'));

        if ($redirect = $this->makeRedirect('update-close', $model)) {
            return $redirect;
        }
    }
516069
public function view($id = null) {
        $cmsTermTaxonomy = $this->CmsTermTaxonomy->get($id, [
            'contain' => ['CmsTerm', 'CmsTermRelation']
        ]);
        $this->set('cmsTermTaxonomy', $cmsTermTaxonomy);
        $this->set('_serialize', ['cmsTermTaxonomy']);
    }
759486
public function actionView(string $id)
    {
        $model = $this->findModel($id);

        return $this->render('view', ['model' => $model]);
    }
127102
public function show($id)
    {
        $lists      = $this->mailjet->getAllLists();
        $newsletter = $this->newsletter->find($id);

        return view('newsletter::Backend.template.show')->with(['newsletter' => $newsletter, 'lists' => $lists]);
    }