openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

PagePreviewAction.class.php (580B)


      1 <?php
      2 namespace cms\action\page;
      3 use cms\action\Method;
      4 use cms\action\PageAction;
      5 use cms\action\RequestParams;
      6 use cms\generator\link\PreviewLink;
      7 use cms\generator\PageContext;
      8 use cms\generator\Producer;
      9 use util\Html;
     10 
     11 class PagePreviewAction extends PageAction {
     12 
     13 
     14 	/**
     15 	 * Calculates the URL for the page preview
     16 	 */
     17     public function view() {
     18 
     19 	    $this->setModelAndLanguage();
     20 
     21 		$linkFormat = new PreviewLink( $this->createPageContext(Producer::SCHEME_PREVIEW)  );
     22 		$this->setTemplateVar('preview_url',$linkFormat->linkToObject($this->page,$this->page) );
     23     }
     24 
     25 }