info.php

Go to the documentation of this file.
00001 <?php
00002 
00007 class Info extends oxUBase
00008 {
00013     protected $_oDelList = null;
00014 
00019     protected $_oDelSetList = null;
00020 
00026     protected $_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW;
00027 
00032     protected $_oContent = null;
00033 
00044     public function info()
00045     {
00046         // assign template name
00047         $sTplName = oxConfig::getParameter( 'tpl');
00048         $sTplName = $sTplName ? $sTplName : oxSession::getVar( 'infotpl' );
00049 
00050         if ( $sTplName ) {
00051             // security fix so that you cant access files from outside template dir
00052             $sTplName = basename( $sTplName );
00053             oxSession::setVar( 'infotpl', $sTplName );
00054 
00055             $sTplName = 'custom/'.$sTplName;
00056         }
00057 
00058         $this->_sThisTemplate = $sTplName;
00059     }
00060 
00061 
00069     public function render()
00070     {
00071         parent::render();
00072 
00073         if ( !$this->getTemplateName() ) {
00074             //  get default page
00075             $oContent = $this->getContent();
00076             $this->getViewConfig()->setViewConfigParam( 'tpl', $oContent->getId() );
00077             $this->_sThisTemplate = 'page/info/content.tpl';
00078         } else {
00079             $this->getViewConfig()->setViewConfigParam( 'tpl', $this->getTemplateName() );
00080         }
00081 
00082         return $this->_sThisTemplate;
00083     }
00084 
00090     public function getTemplateName()
00091     {
00092         return $this->_sThisTemplate;
00093     }
00094 
00100     public function getContent()
00101     {
00102         if ( $this->_oContent === null ) {
00103             //  get default page
00104             $oContent = oxNew( 'oxcontent' );
00105             $oContent->loadByIdent( 'oximpressum' );
00106             $this->_oContent = $oContent;
00107         }
00108         return $this->_oContent;
00109     }
00110 
00116     public function getDeliveryList()
00117     {
00118         if ( $this->_oDelList === null ) {
00119             $this->_oDelList = oxNew( 'oxdeliverylist' );
00120             $this->_oDelList->getList();
00121         }
00122         return $this->_oDelList;
00123     }
00124 
00130     public function getDeliverySetList()
00131     {
00132         if ( $this->_oDelSetList === null ) {
00133             $this->_oDelSetList = oxNew( 'oxdeliverysetlist' );
00134             $this->_oDelSetList->getList();
00135         }
00136         return $this->_oDelSetList;
00137     }
00138     
00144     public function getParsedContent()
00145     {        
00146         return oxUtilsView::getInstance()->parseThroughSmarty( $this->getContent()->oxcontents__oxcontent->value );        
00147     }
00148 
00154     public function getTitle()
00155     {
00156         $oContent = $this->getContent();
00157         
00158         return $oContent->oxcontents__oxtitle->value;
00159     }
00160 }