00001 <?php 00002 00009 class Help extends oxUBase 00010 { 00015 protected $_sThisTemplate = 'help.tpl'; 00016 00021 protected $_sHelpText = null; 00022 00029 protected $_iViewIndexState = 1; 00030 00040 public function render() 00041 { 00042 $this->_aViewData["helptext"] = $this->getHelpText(); 00043 00044 parent::render(); 00045 00046 return $this->_sThisTemplate; 00047 } 00048 00054 public function getHelpText() 00055 { 00056 if ( $this->_sHelpText === null ) { 00057 $this->_sHelpText = false; 00058 $sLang = oxLang::getInstance()->getTplLanguage(); 00059 $sTpl = basename( oxConfig::getParameter( 'tpl' ) ); 00060 $sHelpPage = $sTpl?$sTpl:oxConfig::getParameter( 'page' ); 00061 00062 $sHelpText = null; 00063 $sHelpPath = getShopBasePath()."help/{$sLang}/{$sHelpPage}.inc.tpl"; 00064 if ( $sHelpPage && is_readable( $sHelpPath ) ) { 00065 $sHelpText = file_get_contents( $sHelpPath ); 00066 } 00067 00068 if ( !$sHelpText ) { 00069 $sHelpPath = getShopBasePath()."help/{$sLang}/default.inc.tpl"; 00070 if ( is_readable( $sHelpPath ) ) { 00071 $sHelpText = file_get_contents( $sHelpPath ); 00072 } 00073 } 00074 00075 if ( $sHelpText ) { 00076 $this->_sHelpText = $sHelpText; 00077 } 00078 } 00079 return $this->_sHelpText; 00080 } 00081 }