Preview page action
@return void
771667
public function preview($id)
    {
        $this->addCss('/modules/system/assets/css/eventlogs/exception-beautifier.css', 'core');
        $this->addJs('/modules/system/assets/js/eventlogs/exception-beautifier.js', 'core');

        if (in_array(App::environment(), ['dev', 'local'])) {
            $this->addJs('/modules/system/assets/js/eventlogs/exception-beautifier.links.js', 'core');
        }

        return $this->asExtension('FormController')->preview($id);
    }
844511
public function showAction()
    {
        $this->html->h2($this->getTopicTitle());

        $context = $this->_getParam('id', 'gems');
        $this->_upgrades->setContext($context);
        if ($info = $this->_upgrades->getUpgradesInfo($context)) {
            $this->html->table(array('class'=>'browser'))->tr()
                ->th($this->_('Context'))->td($info['context'])
                ->tr()
                ->th($this->_('Level'))->td($info['level']);
            $data = $this->_upgrades->getUpgrades();
            foreach($data as $level => $row) {
                foreach($this->menu->getCurrent()->getChildren() as $menuItem) {
                    if ($menuItem->is('allowed', true)) {
                        $show = true;
                        if ($level <= $info['level'] && $menuItem->is('action','execute-to')) {
                            //When this level is < current level don't allow to execute from current level to this one
                            $show = false;
                        }
                        if ($level <= $info['level'] && $menuItem->is('action','execute-from')) {
                            //When this level is < current level don't allow to execute from current level to this one
                            $show = false;
                        }
                        if ($show) {
                            $row['action'][] = $menuItem->toActionLinkLower($this->getRequest(), $row, array('from'=>$level, 'to'=>$level));
                        }
                    }
                }
                $row['level'] = $level;
                $data[$level] = $row;
            }
            $displayColumns = array('level' => $this->_('Level'),
                                    'info'   => $this->_('Description'),
                                    'action' => $this->_('Action'));
            $this->addSnippet('SelectiveTableSnippet', 'data', $data, 'class', 'browser', 'columns', $displayColumns);
        } else {
            $this->html[] = sprintf($this->_('Context %s not found!'), $context);
        }

        if ($parentItem = $this->menu->getCurrent()->getParent()) {
            $this->html[] = $parentItem->toActionLink($this->getRequest(), $this->_('Cancel'));
        }
    }
864337
public function preview()
	{
		$strPreview = '<div class="widget m12"><div class="tl_checkbox_single_container"><input class="tl_checkbox" value="1" type="checkbox"> <label>' . $GLOBALS['TL_LANG']['tl_pattern']['invisible'][0] . '</label><p title="" class="tl_help tl_tip">' . $GLOBALS['TL_LANG']['tl_pattern']['invisible'][1] . '</p></div></div>';	
		
		if ($this->canChangeStart)
		{
			$strPreview .= '<div class="w50 wizard widget" style="padding-top:10px;"><h3 style="margin: 0;"><label>' . $GLOBALS['TL_LANG']['tl_pattern']['start'][0] . '</label></h3>';
			$strPreview .= '<input class="tl_text" value="" type="text"> ';
			$strPreview .= '<img src="assets/datepicker/images/icon.svg" alt="Page picker" style="cursor:pointer" height="20" width="20">';
			$strPreview .= '<p title="" class="tl_help tl_tip">' . $GLOBALS['TL_LANG']['tl_pattern']['start'][1] . '</p></div>';			
		}

		if ($this->canChangeStop)
		{
			$strPreview .= '<div class="w50 wizard widget" style="padding-top:10px;"><h3 style="margin: 0;"><label>' . $GLOBALS['TL_LANG']['tl_pattern']['stop'][0] . '</label></h3>';
			$strPreview .= '<input class="tl_text" value="" type="text"> ';
			$strPreview .= '<img src="assets/datepicker/images/icon.svg" alt="Page picker" style="cursor:pointer" height="20" width="20">';
			$strPreview .= '<p title="" class="tl_help tl_tip">' . $GLOBALS['TL_LANG']['tl_pattern']['stop'][1] . '</p></div>';	
		}
		
		return $strPreview;
	}
1214174
public function view()
    {
        $this->set('title', $this->title);
        $this->set('buttonText', $this->buttonText);
        $this->set('baseSearchPath', $this->baseSearchPath);
        $this->set('postTo_cID', $this->postTo_cID);

        if ((string) $this->resultsURL !== '') {
            $resultsPage = null;
            $resultsURL = $this->resultsURL;
        } else {
            $resultsPage = $this->postTo_cID ? Page::getById($this->postTo_cID) : null;
            if (is_object($resultsPage) && !$resultsPage->isError()) {
                $resultsURL = $resultsPage->getCollectionPath();
            } else {
                $resultsPage = null;
                $c = Page::getCurrentPage();
                $resultsURL = $c->getCollectionPath();
            }
        }

        $resultsURL = $this->app->make('helper/text')->encodePath($resultsURL);

        $this->set('resultTargetURL', $resultsURL);
        if ($resultsPage !== null) {
            $this->set('resultTarget', $resultsPage);
        } else {
            $this->set('resultTarget', $resultsURL);
        }

        //run query if display results elsewhere not set, or the cID of this page is set
        if ($resultsPage === null && (string) $this->resultsURL === '') {
            if ((string) $this->request->request('query') !== '' || $this->request->request('akID') || $this->request->request('month')) {
                $this->do_search();
            }
        }
    }
518412
public function previewAction()
    {
        //wyszukiwanie wiadomości
        if (null === $mail = (new \Cms\Orm\CmsMailQuery)->findPk($this->id)) {
            $this->getResponse()->redirect('cmsAdmin', 'mail', 'index');
        }
        $this->view->message = $mail->message;
    }
1320802
public function preview()
    {
        $inputs  = Input::all();
        $content = str_replace("&#39;", '"', $inputs['content']);
        $content = $this->variablesAdapter->get($content);

        if( isset($inputs['subject']) ) {
            $subject = str_replace("&#39;", '"', $inputs['subject']);
            $subject = $this->variablesAdapter->get($subject);

            array_set($inputs, 'subject', $subject);
        }

        preg_match_all('/\[\[(.*?)\]\]/', $content, $matches);
        $view = str_replace($matches[0], $matches[1], $content);

        if (array_get($inputs, 'type') === 'email') {
            event('antares.notifier.before_send_email', [&$view]);
        }

        $brandTemplate = BrandOptions::query()->where('brand_id', brand_id())->first();
        $header        = str_replace('</head>', '<style>' . $brandTemplate->styles . '</style></head>', $brandTemplate->header);
        $html          = preg_replace("/<body[^>]*>(.*?)<\/body>/is", '<body>' . $view . '</body>', $header . $brandTemplate->footer);

        array_set($inputs, 'content', $html);

        return $this->presenter->preview($inputs);
    }
632000
public function indexAction()
    {
        $this->di->session();

        $form = new \Anax\HTMLForm\CFormExample();
        $form->setDI($this->di);
        $form->check();

        $this->di->theme->setTitle("Testing CForm with Anax");
        $this->di->views->add('default/page', [
            'title' => "Try out a form using CForm",
            'content' => $form->getHTML()
        ]);
    }
463388
public function indexAction()
    {
        $this->initializeScaffolding();

        $paginator = $this->scaffolding->doPaginate($this->request->get('page', 'int', 1));
        $this->view->page = $paginator->getPaginate();
        $this->view->fields = $this->indexFields;
    }
1021206
public function render() {
        global $controller;        
        
        if(!$this->ctrl) throw new \Exception('Controller not initialised');
        
		$controller = $this->ctrl;
        $this->ctrl->pageHeader();
        
        echo $this->renderContent();
    }
1332592
public function index() {        
        $action = Filter::post('action');        
        if($action == 'update' && Filter::checkCsrf()) $this->update();
        
        Theme::theme(new AdministrationTheme)->init(Globals::getTree());        
        $ctrl = new PageController();
        $ctrl
            ->restrictAccess(Auth::isAdmin())
            ->setPageTitle($this->module->getTitle());

        $view_bag = new ViewBag();
        $view_bag->set('title', $ctrl->getPageTitle());
        $view_bag->set('module', $this->module);
        
        ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render();
    }
317534
public static function previewsOptions()
    {
        static::_initPreviews();

        $options = [];
        foreach (static::$_previews as $value => $info) {
            $options[$value] = $info['label'];
        }

        return $options;
    }
608440
protected function definition_preview() {
        foreach ($this->structure->get_items() as $feedbackitem) {
            $itemobj = feedback_get_item_class($feedbackitem->typ);
            $itemobj->complete_form_element($feedbackitem, $this);
        }
    }
1064327
protected function renderActionHelp()
    {
        $action = $this->actions[$this->actionName];
        //puts name of action
        $this->appendLine($this->getColoredString($action->getDescription(), 'green'));
        $this->appendLine('');

        //puts usage hint
        $this->appendLine('Usage:');
        $this->appendLine($this->getColoredString(sprintf(
            '   %s %s [options]',
            $this->dispatcher->getParam('activeTask'),
            $this->dispatcher->getParam('activeAction')
        ), 'dark_gray'));
        $this->appendLine('');

        //puts available options
        $this->appendLine($this->getColoredString('Options:', 'gray'));
        foreach ($action->getOptions() as $option) {
            $this->appendLine($this->getColoredString(sprintf(
                '   --%s     -%s      %s',
                $option->getName(), $option->getShortName(), $option->getDescription()
            ), 'light_green'));
        }
    }
625073
public function indexAction()
    {
        if ($this->getRequest()->isAjax()) {
            try {
                $this->loadLayout(null, false, false);
                $this->getLayout()->getUpdate()->setCacheId(null);
                $this->getLayout()->getUpdate()->addHandle(strtolower($this->getFullActionName()) . '_AJAX');
            } catch (Exception $e) {
                Mage::logException($e);
                $this->getResponse()->setHeader('Content-Type', 'application/json');
                $this->getResponse()->setBody(Zend_Json::encode(['error' => true, 'message' => $e->getMessage()]));
            }
        }

        $this->loadLayout();
        $this->renderLayout();
    }
1293893
public function render_preview(moodle_page $page) {

        if (!$this->is_form_defined()) {
            throw new coding_exception('It is the caller\'s responsibility to make sure that the form is actually defined');
        }

        $criteria = $this->definition->rubric_criteria;
        $options = $this->get_options();
        $rubric = '';
        if (has_capability('moodle/grade:managegradingforms', $page->context)) {
            $showdescription = true;
        } else {
            if (empty($options['alwaysshowdefinition']))  {
                // ensure we don't display unless show rubric option enabled
                return '';
            }
            $showdescription = $options['showdescriptionstudent'];
        }
        $output = $this->get_renderer($page);
        if ($showdescription) {
            $rubric .= $output->box($this->get_formatted_description(), 'gradingform_rubric-description');
        }
        if (has_capability('moodle/grade:managegradingforms', $page->context)) {
            if (!$options['lockzeropoints']) {
                // Warn about using grade calculation method where minimum number of points is flexible.
                $rubric .= $output->display_rubric_mapping_explained($this->get_min_max_score());
            }
            $rubric .= $output->display_rubric($criteria, $options, self::DISPLAY_PREVIEW, 'rubric');
        } else {
            $rubric .= $output->display_rubric($criteria, $options, self::DISPLAY_PREVIEW_GRADED, 'rubric');
        }

        return $rubric;
    }
724443
public function display()
    {
        if (!$this->visible) {
            return;
        }

        if (!$this->isPreviewDisplayable()) {
            parent::display();
        } else {
            if ($this->link !== null) {
                $tag = new SwatHtmlTag('a');
                if ($this->link_value === null) {
                    $tag->href = $this->link;
                } elseif (is_array($this->link_value)) {
                    $tag->href = vsprintf($this->link, $this->link_value);
                } else {
                    $tag->href = sprintf($this->link, $this->link_value);
                }
            } else {
                $tag = new SwatHtmlTag('span');
            }

            $tag->id = $this->id . '_wrapper';
            $tag->title = $this->title;

            if ($this->show_icon) {
                $tag->class = 'swat-image-preview-display-link';
            } else {
                $tag->class = 'swat-image-preview-display-link-plain';
            }

            $tag->open();
            parent::display();
            $tag->close();

            Swat::displayInlineJavaScript($this->getInlineJavaScript());
        }
    }
146966
def preview
      @post         = Blogo::PreviewPostService.new(blogo_current_user, post_params).preview
      @meta         = {title: @post.title }
      @recent_posts = Blogo::Post.published.limit(Blogo.config.recent_posts) if Blogo.config.recent_posts
      @tags         = Blogo::Tag.all

      render 'blogo/posts/show', layout: 'blogo/blog'
    end