oxnavigationtree.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class OxNavigationTree extends oxSuperCfg
00007 {
00011     protected $_oDom = null;
00012 
00016     protected $_oInitialDom = null;
00017 
00023     protected $_sDynIncludeUrl = null;
00024 
00032     public function init()
00033     {
00034     }
00035 
00045     protected function _cleanEmptyParents($oDom, $sParentXPath, $sChildXPath)
00046     {
00047         $oXPath = new DomXPath( $oDom );
00048         $oNodeList = $oXPath->query( $sParentXPath );
00049 
00050         foreach ( $oNodeList as $oNode ) {
00051             $sId = $oNode->getAttribute( 'id' );
00052             $oChildList = $oXPath->query( "{$sParentXPath}[@id='$sId']/$sChildXPath" );
00053             if (!$oChildList->length) {
00054                 $oNode->parentNode->removeChild( $oNode );
00055             }
00056         }
00057     }
00058 
00066     protected function _addLinks( $oDom )
00067     {
00068         $sURL   = $this->_getAdminUrl();
00069         $oXPath = new DomXPath( $oDom );
00070 
00071         // building
00072         $oNodeList = $oXPath->query( "//SUBMENU[@cl]" );
00073         foreach ( $oNodeList as $oNode ) {
00074             // fetching class
00075             $sCl = $oNode->getAttribute( 'cl' );
00076             $sCl = $sCl?"cl=$sCl":'';
00077 
00078             // fetching params
00079             $sParam = $oNode->getAttribute( 'clparam' );
00080             $sParam = $sParam?"&$sParam":'';
00081 
00082             // setting link
00083             $oNode->setAttribute( 'link', "{$sURL}{$sCl}{$sParam}" );
00084         }
00085     }
00086 
00095     protected function _loadFromFile( $sMenuFile, $oDom )
00096     {
00097         $oDomFile = new DomDocument();
00098         $oDomFile->preserveWhiteSpace = false;
00099         if ( @$oDomFile->load( $sMenuFile ) ) {
00100             $this->_merge( $oDomFile, $oDom );
00101         }
00102     }
00103 
00111     protected function _addDynLinks( $oDom )
00112     {
00113         $myConfig = $this->getConfig();
00114         $myUtilsFile = oxUtilsFile::getInstance();
00115 
00116         $sURL = $this->_getAdminUrl();
00117 
00118         $oXPath = new DomXPath( $oDom );
00119         $oNodeList = $oXPath->query( "//OXMENU[@type='dyn']/MAINMENU/SUBMENU" );
00120         foreach ( $oNodeList as $oNode ) {
00121 
00122             // fetching class
00123             $sCl = $oNode->getAttribute( 'cl' );
00124             $sCl = "cl=dynscreen&menu=$sCl";
00125 
00126             // fetching params
00127             $sParam = $oNode->getAttribute( 'clparam' );
00128             $sParam = $sParam?"&$sParam":'';
00129 
00130             // setting list node if its is not set yet
00131             if ( !$oNode->getAttribute( 'list' ) ) {
00132                 $oNode->setAttribute( 'list', 'dynscreen_list' );
00133                 $oNode->setAttribute( 'listparam', 'menu='.$oNode->getAttribute( 'cl' ) );
00134             }
00135 
00136             // setting link
00137             $oNode->setAttribute( 'link', "{$sURL}{$sCl}{$sParam}" );
00138 
00139             // setting id
00140             $oNode->parentNode->setAttribute( 'id', 'dyn_menu' );
00141 
00142             // setting id to its parent
00143 
00144             // fetching class
00145             $sFile = $oNode->getAttribute( 'cl' );
00146 
00147             // always display the "about" tab no matter what licence
00148             if ( $myUtilsFile->checkFile( "{$this->_sDynIncludeUrl}pages/{$sFile}_about.php" ) ) {
00149                 $oTabElem = new DOMElement( 'TAB' );
00150                 $oNode->appendChild( $oTabElem );
00151                 $oTabElem->setAttribute( 'external', 'true' );
00152                 $oTabElem->setAttribute( 'location', "{$this->_sDynIncludeUrl}pages/{$sFile}_about.php" );
00153                 $oTabElem->setAttribute( 'id', 'dyn_about' );
00154             }
00155 
00156             // checking for technics page
00157             if ( $myUtilsFile->checkFile( "{$this->_sDynIncludeUrl}pages/{$sFile}_technics.php" ) ) {
00158                 $oTabElem = new DOMElement( 'TAB' );
00159                 $oNode->appendChild( $oTabElem );
00160                 $oTabElem->setAttribute( 'external', 'true' );
00161                 $oTabElem->setAttribute( 'location', "{$this->_sDynIncludeUrl}pages/{$sFile}_technics.php" );
00162                 $oTabElem->setAttribute( 'id', 'dyn_interface' );
00163             }
00164 
00165             // checking for setup page
00166             if ( file_exists( $myConfig->getConfigParam( 'sShopDir' ).$myConfig->getConfigParam( 'sAdminDir' )."/{$sFile}.php" ) ) {
00167                 $oTabElem = new DOMElement( 'TAB' );
00168                 $oNode->appendChild( $oTabElem );
00169                 $oTabElem->setAttribute( 'id', 'dyn_interface' );
00170                 $oTabElem->setAttribute( 'cl', $sFile );
00171             }
00172         }
00173     }
00174 
00182     protected function _sessionizeLocalUrls( $oDom )
00183     {
00184         $sURL = $this->_getAdminUrl();
00185 
00186         $oXPath = new DomXPath( $oDom );
00187         $oNodeList = $oXPath->query( "//OXMENU/*[@url]" );
00188         $oStr = getStr();
00189         foreach ( $oNodeList as $oNode ) {
00190             $sLocalUrl = $oNode->getAttribute( 'url' );
00191             if (strpos($sLocalUrl, 'index.php?') === 0) {
00192                 $sLocalUrl = $oStr->preg_replace('#^index.php\?#', $sURL, $sLocalUrl);
00193                 $oNode->setAttribute( 'url', $sLocalUrl );
00194             }
00195         }
00196     }
00197 
00205     protected function _checkRights( $oDom )
00206     {
00207         $oXPath    = new DomXPath( $oDom );
00208         $oNodeList = $oXPath->query( '//*[@rights or @norights]' );
00209 
00210         foreach ( $oNodeList as $oNode ) {
00211             // only allowed modules/user rights or so
00212             if ( ( $sReq = $oNode->getAttribute( 'rights' ) ) ) {
00213                 $aPerm = explode( ',', $sReq );
00214                 foreach ( $aPerm as $sPerm ) {
00215                     if ( $sPerm && !$this->_hasRights( $sPerm ) ) {
00216                         $oNode->parentNode->removeChild( $oNode );
00217                     }
00218                 }
00219                 // not allowed modules/user rights or so
00220             } elseif ( ( $sNoReq = $oNode->getAttribute( 'norights' ) ) ) {
00221                 $aPerm = explode( ',', $sNoReq );
00222                 foreach ( $aPerm as $sPerm ) {
00223                     if ( $sPerm && $this->_hasRights( $sPerm ) ) {
00224                         $oNode->parentNode->removeChild( $oNode );
00225                     }
00226                 }
00227             }
00228         }
00229     }
00230 
00238     protected function _checkGroups( $oDom )
00239     {
00240         $oXPath    = new DomXPath( $oDom );
00241         $oNodeList = $oXPath->query( "//*[@nogroup or @group]" );
00242 
00243         foreach ( $oNodeList as $oNode ) {
00244             // allowed only for groups
00245             if ( ( $sReq = $oNode->getAttribute('group') ) ) {
00246                 $aPerm = explode( ',', $sReq );
00247                 foreach ( $aPerm as $sPerm ) {
00248                     if ( $sPerm && !$this->_hasGroup( $sPerm ) ) {
00249                         $oNode->parentNode->removeChild($oNode);
00250                     }
00251                 }
00252                 // not allowed for groups
00253             } elseif ( ( $sNoReq = $oNode->getAttribute('nogroup') ) ) {
00254                 $aPerm = explode( ',', $sNoReq );
00255                 foreach ( $aPerm as $sPerm ) {
00256                     if ( $sPerm && $this->_hasGroup( $sPerm ) ) {
00257                         $oNode->parentNode->removeChild($oNode);
00258                     }
00259                 }
00260             }
00261         }
00262     }
00263 
00271     protected function _checkDemoShopDenials( $oDom )
00272     {
00273         if (!$this->getConfig()->isDemoShop()) {
00274             // nothing to check for non demo shop
00275             return;
00276         }
00277 
00278         $oXPath    = new DomXPath( $oDom );
00279         $oNodeList = $oXPath->query( "//*[@disableForDemoShop]" );
00280         foreach ( $oNodeList as $oNode ) {
00281             if ( $oNode->getAttribute('disableForDemoShop') ) {
00282                 $oNode->parentNode->removeChild($oNode);
00283             }
00284         }
00285     }
00286 
00295     protected function _copyAttributes( $oDomElemTo, $oDomElemFrom )
00296     {
00297         foreach ( $oDomElemFrom->attributes as $oAttr ) {
00298             $oDomElemTo->setAttribute( $oAttr->nodeName, $oAttr->nodeValue );
00299         }
00300     }
00301 
00313     protected function _mergeNodes( $oDomElemTo, $oDomElemFrom, $oXPathTo, $oDomDocTo, $sQueryStart )
00314     {
00315         foreach ( $oDomElemFrom->childNodes as $oFromNode ) {
00316             if ( $oFromNode->nodeType === XML_ELEMENT_NODE ) {
00317 
00318                 $sFromAttrName = $oFromNode->getAttribute( 'id' );
00319                 $sFromNodeName = $oFromNode->tagName;
00320 
00321                 // find current item
00322                 $sQuery   = "{$sQueryStart}/{$sFromNodeName}[@id='{$sFromAttrName}']";
00323                 $oCurNode = $oXPathTo->query( $sQuery );
00324 
00325                 // if not found - append
00326                 if ( $oCurNode->length == 0 ) {
00327                     $oDomElemTo->appendChild( $oDomDocTo->importNode( $oFromNode, true ) );
00328                 } else {
00329 
00330                     $oCurNode = $oCurNode->item( 0 );
00331 
00332                     // if found copy all attributes and check childnodes
00333                     $this->_copyAttributes( $oCurNode, $oFromNode );
00334 
00335                     if ( $oFromNode->childNodes->length ) {
00336                         $this->_mergeNodes( $oCurNode, $oFromNode, $oXPathTo, $oDomDocTo, $sQuery );
00337                     }
00338                 }
00339             }
00340         }
00341     }
00342 
00351     protected function _merge( $oDomNew, $oDom )
00352     {
00353         $oXPath = new DOMXPath( $oDom );
00354         $this->_mergeNodes( $oDom->documentElement, $oDomNew->documentElement, $oXPath, $oDom, '/OX' );
00355     }
00356 
00366     public function getTabs( $sId, $iAct, $blSetActive = true )
00367     {
00368         $oXPath = new DOMXPath( $this->getDomXml() );
00369         //$oNodeList = $oXPath->query( "//SUBMENU[@cl='$sId' or @list='$sId']/TAB | //SUBMENU/../TAB[@cl='$sId']" );
00370         $oNodeList = $oXPath->query( "//SUBMENU[@cl='$sId']/TAB | //SUBMENU[@list='$sId']/TAB | //SUBMENU/../TAB[@cl='$sId']" );
00371 
00372         $iAct = ( $iAct > $oNodeList->length )?( $oNodeList->length - 1 ):$iAct;
00373 
00374         if ( $blSetActive ) {
00375             foreach ( $oNodeList as $iPos => $oNode ) {
00376                 if ( $iPos == $iAct ) {
00377                     // marking active node
00378                     $oNode->setAttribute( 'active', 1 );
00379                 }
00380             }
00381         }
00382 
00383         return $oNodeList;
00384     }
00385 
00394     public function getActiveTab( $sId, $iAct )
00395     {
00396         $sTab = null;
00397         $oNodeList = $this->getTabs( $sId, $iAct, false );
00398         $iAct = ( $iAct > $oNodeList->length )?( $oNodeList->length - 1 ):$iAct;
00399         if ( $oNodeList->length && ( $oNode = $oNodeList->item( $iAct ) ) ) {
00400             $sTab = $oNode->getAttribute( 'cl' );
00401         }
00402 
00403         return $sTab;
00404     }
00405 
00413     public function getBtn( $sClass )
00414     {
00415         $oButtons = null;
00416         $oXPath = new DOMXPath($this->getDomXml());
00417         $oNodeList = $oXPath->query("//TAB[@cl='$sClass']/../BTN");
00418         if ($oNodeList->length) {
00419             $oButtons = new OxstdClass();
00420             foreach ($oNodeList as $oNode) {
00421                 $sBtnID = $oNode->getAttribute('id');
00422                 $oButtons->$sBtnID = 1;
00423             }
00424         }
00425         return $oButtons;
00426     }
00427 
00433     protected function _getMenuFiles()
00434     {
00435         $myConfig  = $this->getConfig();
00436         $myOxUtlis = oxUtils::getInstance();
00437 
00438         $sFullAdminDir = getShopBasePath() . $myConfig->getConfigParam( 'sAdminDir' );
00439         $sMenuFile = "/menu.xml";
00440 
00441         $sTmpDir = $myConfig->getConfigParam( 'sCompileDir' );
00442         $sDynLang = $this->_getDynMenuLang();
00443         $sLocalDynPath = "{$sTmpDir}{$sDynLang}_dynscreen.xml";
00444 
00445 
00446         // including std file
00447         if ( file_exists( $sFullAdminDir.$sMenuFile ) ) {
00448             $aFilesToLoad[] = $sFullAdminDir.$sMenuFile;
00449         }
00450 
00451         // including custom file
00452         if ( file_exists( "$sFullAdminDir/user.xml" ) ) {
00453             $aFilesToLoad[] = "$sFullAdminDir/user.xml";
00454         }
00455 
00456         // including module files
00457         $sSourceDir = getShopBasePath() . 'modules';
00458         $handle = opendir( $sSourceDir );
00459         while ( false !== ( $sFile = readdir( $handle ) ) ) {
00460             if ( $sFile != '.' && $sFile != '..') {
00461                 $sDir = "$sSourceDir/$sFile";
00462                 if ( is_dir( $sDir ) && file_exists( "$sDir/menu.xml" ) ) {
00463                         $aFilesToLoad[] = "$sDir/menu.xml";
00464                 }
00465             }
00466         }
00467 
00468         $blLoadDynContents = $myConfig->getConfigParam( 'blLoadDynContents' );
00469         $sShopCountry      = $myConfig->getConfigParam( 'sShopCountry' );
00470 
00471         // including dyn menu file
00472         $sDynPath = null;
00473 
00474         if ( $blLoadDynContents ) {
00475             if ( $sShopCountry ) {
00476                 $sRemoteDynUrl = $this->_getDynMenuUrl( $sDynLang, $blLoadDynContents );
00477 
00478                 // loading remote file from server only once
00479                 $blLoadRemote = oxSession::getVar( "loadedremotexml" );
00480 
00481                 // very basic check if its valid xml file
00482                 if ( ( !isset( $blLoadRemote ) || $blLoadRemote ) && ( $sDynPath = $myOxUtlis->getRemoteCachePath( $sRemoteDynUrl, $sLocalDynPath ) ) ) {
00483                     $sDynPath = $this->_checkDynFile( $sDynPath );
00484                 }
00485 
00486                 // caching last load state
00487                 oxSession::setVar( "loadedremotexml", $sDynPath ? true : false );
00488             }
00489         } else {
00490             if ( $sShopCountry ) {
00491                 //non international country
00492             }
00493         }
00494 
00495         // loading dynpages
00496         if ( $sDynPath ) {
00497             $aFilesToLoad[] = $sDynPath;
00498         }
00499         return $aFilesToLoad;
00500     }
00501 
00509     protected function _checkDynFile( $sDynFilePath )
00510     {
00511         $sDynFile = null;
00512         if ( file_exists( $sDynFilePath ) ) {
00513             $sLine = null;
00514             if ( ( $rHandle = @fopen($sDynFilePath, 'r' ) ) ) {
00515                 $sLine = stream_get_line( $rHandle, 100, "?>");
00516                 fclose( $rHandle );
00517 
00518                 // checking xml file header
00519                 if ( $sLine && stripos( $sLine, '<?xml' ) !== false ) {
00520                     $sDynFile = $sDynFilePath;
00521                 }
00522             }
00523 
00524             // cleanup ..
00525             if ( !$sDynFile ) {
00526                 @unlink( $sDynFilePath );
00527             }
00528         }
00529 
00530         return $sDynFile;
00531     }
00532 
00540     protected function _processCachedFile($sCacheContents)
00541     {
00542         $oStr = getStr();
00543         $sNewUrl = htmlentities($this->_getAdminUrl());
00544         $sTok    = preg_quote("stoken=", '@');
00545         $sSearch = $oStr->preg_replace('@'.preg_quote($sTok, '@').'[A-Z0-9]+@i', "{$sTok}[A-Z0-9]+", preg_quote($sNewUrl, '@'));
00546         return $oStr->preg_replace("@$sSearch@i", $sNewUrl, $sCacheContents);
00547 
00548     }
00549 
00555     protected function _getInitialDom()
00556     {
00557         if ( $this->_oInitialDom === null ) {
00558             $myOxUtlis = oxUtils::getInstance();
00559 
00560             if ( is_array( $aFilesToLoad = $this->_getMenuFiles() ) ) {
00561 
00562                 // now checking if xml files are newer than cached file
00563                 $blReload = false;
00564                 $sDynLang = $this->_getDynMenuLang();
00565 
00566                 $sCacheName = 'menu_' . $sDynLang . '_xml';
00567                 $sCacheFile = $myOxUtlis->getCacheFilePath( $sCacheName );
00568                 $sCacheContents = $myOxUtlis->fromFileCache( $sCacheName );
00569                 if ( $sCacheContents && file_exists( $sCacheFile ) && ( $iCacheModTime = filemtime( $sCacheFile ) ) ) {
00570                     foreach ( $aFilesToLoad as $sDynPath ) {
00571                         if ( $iCacheModTime < filemtime( $sDynPath ) ) {
00572                             $blReload = true;
00573                         }
00574                     }
00575                 } else {
00576                     $blReload = true;
00577                 }
00578 
00579                 $this->_oInitialDom = new DOMDocument();
00580                 if ( $blReload ) {
00581                     // fully reloading and building pathes
00582                     $this->_oInitialDom->appendChild( new DOMElement( 'OX' ) );
00583 
00584                     foreach ( $aFilesToLoad as $sDynPath ) {
00585                         $this->_loadFromFile( $sDynPath, $this->_oInitialDom );
00586                     }
00587 
00588                     // adds links to menu items
00589                     $this->_addLinks( $this->_oInitialDom );
00590 
00591                     // adds links to dynamic parts
00592                     $this->_addDynLinks( $this->_oInitialDom );
00593 
00594                     // add session params
00595                     $this->_sessionizeLocalUrls( $this->_oInitialDom );
00596 
00597                     // writing to cache
00598                     $myOxUtlis->toFileCache( $sCacheName, $this->_oInitialDom->saveXML() );
00599                 } else {
00600                     $sCacheContents = $this->_processCachedFile($sCacheContents);
00601                     // loading from cached file
00602                     $this->_oInitialDom->preserveWhiteSpace = false;
00603                     $this->_oInitialDom->loadXML( $sCacheContents );
00604                 }
00605             }
00606         }
00607         return $this->_oInitialDom;
00608     }
00609 
00615     public function getDomXml()
00616     {
00617         if ( $this->_oDom === null ) {
00618             $this->_oDom = clone $this->_getInitialDom();
00619 
00620             // removes items denied by user group
00621             $this->_checkGroups( $this->_oDom );
00622 
00623             // removes items denied by user rights
00624             $this->_checkRights( $this->_oDom );
00625 
00626             // check config params
00627             $this->_checkDemoShopDenials( $this->_oDom );
00628 
00629 
00630             $this->_cleanEmptyParents( $this->_oDom, '//SUBMENU[@id][@list]', 'TAB');
00631             $this->_cleanEmptyParents( $this->_oDom, '//MAINMENU[@id]', 'SUBMENU');
00632         }
00633 
00634         return $this->_oDom;
00635     }
00636 
00644     public function getListNodes( $aNodes )
00645     {
00646         $oXPath = new DOMXPath( $this->getDomXml() );
00647         $oNodeList = $oXPath->query( "//SUBMENU[@cl='".implode("' or @cl='", $aNodes)."']" );
00648 
00649         return ( $oNodeList->length ) ? $oNodeList : null;
00650     }
00651 
00659     public function markNodeActive( $sNodeId )
00660     {
00661         $oXPath = new DOMXPath( $this->getDomXml() );
00662         $oNodeList = $oXPath->query( "//*[@cl='{$sNodeId}' or @list='{$sNodeId}']" );
00663 
00664         if ( $oNodeList->length ) {
00665             foreach ( $oNodeList as $oNode ) {
00666                 // special case for external resources
00667                 $oNode->setAttribute( 'active', 1 );
00668                 $oNode->parentNode->setAttribute( 'active', 1 );
00669             }
00670         }
00671 
00672     }
00673 
00681     public function getListUrl( $sId )
00682     {
00683         $sUrl = null;
00684         $oXPath = new DOMXPath( $this->getDomXml() );
00685         $oNodeList = $oXPath->query( "//SUBMENU[@cl='{$sId}']" );
00686         if ( $oNodeList->length && ( $oNode = $oNodeList->item( 0 ) ) ) {
00687             $sCl = $oNode->getAttribute('list');
00688             $sCl = $sCl?"cl=$sCl":'';
00689 
00690             $sParams = $oNode->getAttribute('listparam');
00691             $sParams = $sParams?"&$sParams":'';
00692 
00693             $sUrl = "{$sCl}{$sParams}";
00694         }
00695         return $sUrl;
00696     }
00697 
00706     public function getEditUrl( $sId, $iActTab )
00707     {
00708         $sUrl = null;
00709         $oXPath = new DOMXPath( $this->getDomXml() );
00710         $oNodeList = $oXPath->query( "//SUBMENU[@cl='{$sId}']/TAB" );
00711 
00712         $iActTab = ( $iActTab > $oNodeList->length )?( $oNodeList->length - 1 ) : $iActTab;
00713         if ( $oNodeList->length && ( $oActTab = $oNodeList->item( $iActTab ) ) ) {
00714             // special case for external resources
00715             if ( $oActTab->getAttribute( 'external' ) ) {
00716                 $sUrl = $oActTab->getAttribute( 'location' );
00717             } else {
00718                 $sCl = $oActTab->getAttribute( 'cl' );
00719                 $sCl = $sCl?"cl={$sCl}":'';
00720 
00721                 $sParams = $oActTab->getAttribute( 'clparam' );
00722                 $sParams = $sParams?"&{$sParams}":'';
00723 
00724                 $sUrl = "{$sCl}{$sParams}";
00725             }
00726         }
00727         return $sUrl;
00728     }
00729 
00735     protected function _getAdminUrl()
00736     {
00737         $myConfig = $this->getConfig();
00738 
00739         if ( ( $sAdminSslUrl = $myConfig->getConfigParam( 'sAdminSSLURL' ) ) ) {
00740             $sURL = trim( $sAdminSslUrl, '/' );
00741         } else {
00742             $sURL = trim( $myConfig->getConfigParam( 'sShopURL' ), '/' ).'/admin';
00743         }
00744         return oxUtilsUrl::getInstance()->appendParamSeparator($this->getSession()->url("{$sURL}/index.php"));
00745     }
00746 
00754     protected function _hasRights( $sRights )
00755     {
00756         return $this->getUser()->oxuser__oxrights->value == $sRights;
00757     }
00758 
00766     protected function _hasGroup( $sGroupId )
00767     {
00768         return $this->getUser()->inGroup( $sGroupId );
00769     }
00770 
00778     public function getClassId( $sClassName )
00779     {
00780         $sClassId = null;
00781 
00782         $oXPath = new DOMXPath( $this->_getInitialDom() );
00783         $oNodeList = $oXPath->query( "//*[@cl='{$sClassName}' or @list='{$sClassName}']" );
00784         if ( $oNodeList->length && ( $oFirstItem = $oNodeList->item( 0 ) ) ) {
00785             $sClassId = $oFirstItem->getAttribute( 'id' );
00786         }
00787 
00788         return $sClassId;
00789     }
00790 
00798     public function getShopVersionNr()
00799     {
00800         $sVersion = "";
00801         if ( ( $sShopId = $this->getConfig()->getShopId() ) ) {
00802             $sVersion = oxDb::getDb()->getOne( "select oxversion from oxshops where oxid = '$sShopId' " );
00803             $sVersion = preg_replace( "/(^[^0-9]+)(.+)$/", "\$2", $sVersion );
00804         }
00805 
00806         return trim( $sVersion );
00807     }
00808 
00809 
00818     protected function _getDynMenuUrl( $iLang, $blLoadDynContents )
00819     {
00820         if ( !$blLoadDynContents ) {
00821             // getting dyn info from oxid server is off, so getting local menu path
00822             $sFullAdminDir = getShopBasePath() . $this->getConfig()->getConfigParam( 'sAdminDir' );
00823             $sUrl = $sFullAdminDir . "/dynscreen_local.xml";
00824         } else {
00825             $oAdminView = oxNew( 'oxadminview' );
00826             $this->_sDynIncludeUrl = $oAdminView->getServiceUrl( $iLang );
00827             $sUrl .= $this->_sDynIncludeUrl . "menue/dynscreen.xml";
00828         }
00829 
00830         return $sUrl;
00831     }
00832 
00838     protected function _getDynMenuLang()
00839     {
00840         $myConfig = $this->getConfig();
00841         $oLang = oxLang::getInstance();
00842 
00843         $iDynLang = $myConfig->getConfigParam( 'iDynInterfaceLanguage' );
00844         $iDynLang = isset( $iDynLang )?$iDynLang:( $oLang->getObjectTplLanguage() );
00845 
00846         $aLanguages = $oLang->getLanguageArray();
00847         $sLangAbr = $aLanguages[$iDynLang]->abbr;
00848 
00849         return $sLangAbr;
00850     }
00851 }

Generated by  doxygen 1.6.2