00001 <?php
00002
00006 class OxNavigationTree extends oxSuperCfg
00007 {
00011 protected $_oDom = null;
00012
00016 protected $_oInitialDom = null;
00017
00023 protected $_sDynIncludeUrl = null;
00024
00029 protected $_aSupportedExpathXmlEncodings = array( 'utf-8', 'utf-16', 'iso-8859-1', 'us-ascii' );
00030
00038 public function init()
00039 {
00040 }
00041
00051 protected function _cleanEmptyParents($oDom, $sParentXPath, $sChildXPath)
00052 {
00053 $oXPath = new DomXPath( $oDom );
00054 $oNodeList = $oXPath->query( $sParentXPath );
00055
00056 foreach ( $oNodeList as $oNode ) {
00057 $sId = $oNode->getAttribute( 'id' );
00058 $oChildList = $oXPath->query( "{$sParentXPath}[@id='$sId']/$sChildXPath" );
00059 if (!$oChildList->length) {
00060 $oNode->parentNode->removeChild( $oNode );
00061 }
00062 }
00063 }
00064
00072 protected function _addLinks( $oDom )
00073 {
00074 $sURL = 'index.php?';
00075 $oXPath = new DomXPath( $oDom );
00076
00077
00078 $oNodeList = $oXPath->query( "//SUBMENU[@cl]" );
00079 foreach ( $oNodeList as $oNode ) {
00080
00081 $sCl = $oNode->getAttribute( 'cl' );
00082 $sCl = $sCl?"cl=$sCl":'';
00083
00084
00085 $sParam = $oNode->getAttribute( 'clparam' );
00086 $sParam = $sParam?"&$sParam":'';
00087
00088
00089 $oNode->setAttribute( 'link', "{$sURL}{$sCl}{$sParam}" );
00090 }
00091 }
00092
00101 protected function _loadFromFile( $sMenuFile, $oDom )
00102 {
00103 $blMerge = false;
00104 $oDomFile = new DomDocument();
00105 $oDomFile->preserveWhiteSpace = false;
00106 if ( !@$oDomFile->load( $sMenuFile ) ) {
00107 $blMerge = true;
00108 } elseif ( is_readable( $sMenuFile ) && ( $sXml = @file_get_contents( $sMenuFile ) ) ) {
00109
00110
00111 if ( getStr()->preg_match( "/encoding\=(.*)\?>/", $sXml, $aMatches ) !== 0 ) {
00112 if ( isset( $aMatches[1] ) ) {
00113 $sCurrEncoding = trim( $aMatches[1], "\"" );
00114 if ( !in_array( strtolower( $sCurrEncoding ), $this->_aSupportedExpathXmlEncodings ) ) {
00115 $sXml = str_replace( $aMatches[1], "\"UTF-8\"", $sXml );
00116 $sXml = iconv( $sCurrEncoding, "UTF-8", $sXml );
00117 }
00118 }
00119 }
00120
00121
00122 if ( @$oDomFile->loadXml( $sXml ) ) {
00123 $blMerge = true;
00124 }
00125 }
00126
00127 if ( $blMerge ) {
00128 $this->_merge( $oDomFile, $oDom );
00129 }
00130 }
00131
00139 protected function _addDynLinks( $oDom )
00140 {
00141 $myConfig = $this->getConfig();
00142 $myUtilsFile = oxUtilsFile::getInstance();
00143
00144 $sURL = 'index.php?';
00145
00146 $oXPath = new DomXPath( $oDom );
00147 $oNodeList = $oXPath->query( "//OXMENU[@type='dyn']/MAINMENU/SUBMENU" );
00148 foreach ( $oNodeList as $oNode ) {
00149
00150
00151 $sCl = $oNode->getAttribute( 'cl' );
00152 $sCl = "cl=dynscreen&menu=$sCl";
00153
00154
00155 $sParam = $oNode->getAttribute( 'clparam' );
00156 $sParam = $sParam?"&$sParam":'';
00157
00158
00159 if ( !$oNode->getAttribute( 'list' ) ) {
00160 $oNode->setAttribute( 'list', 'dynscreen_list' );
00161 $oNode->setAttribute( 'listparam', 'menu='.$oNode->getAttribute( 'cl' ) );
00162 }
00163
00164
00165 $oNode->setAttribute( 'link', "{$sURL}{$sCl}{$sParam}" );
00166
00167
00168 $oNode->parentNode->setAttribute( 'id', 'dyn_menu' );
00169
00170
00171
00172
00173 $sFile = $oNode->getAttribute( 'cl' );
00174
00175
00176 if ( $myUtilsFile->checkFile( "{$this->_sDynIncludeUrl}pages/{$sFile}_about.php" ) ) {
00177 $oTabElem = new DOMElement( 'TAB' );
00178 $oNode->appendChild( $oTabElem );
00179 $oTabElem->setAttribute( 'external', 'true' );
00180 $oTabElem->setAttribute( 'location', "{$this->_sDynIncludeUrl}pages/{$sFile}_about.php" );
00181 $oTabElem->setAttribute( 'id', 'dyn_about' );
00182 }
00183
00184
00185 if ( $myUtilsFile->checkFile( "{$this->_sDynIncludeUrl}pages/{$sFile}_technics.php" ) ) {
00186 $oTabElem = new DOMElement( 'TAB' );
00187 $oNode->appendChild( $oTabElem );
00188 $oTabElem->setAttribute( 'external', 'true' );
00189 $oTabElem->setAttribute( 'location', "{$this->_sDynIncludeUrl}pages/{$sFile}_technics.php" );
00190 $oTabElem->setAttribute( 'id', 'dyn_interface' );
00191 }
00192
00193
00194 if ( file_exists( $myConfig->getConfigParam( 'sShopDir' ).$myConfig->getConfigParam( 'sAdminDir' )."/{$sFile}.php" ) ) {
00195 $oTabElem = new DOMElement( 'TAB' );
00196 $oNode->appendChild( $oTabElem );
00197 $oTabElem->setAttribute( 'id', 'dyn_interface' );
00198 $oTabElem->setAttribute( 'cl', $sFile );
00199 }
00200 }
00201 }
00202
00210 protected function _sessionizeLocalUrls( $oDom )
00211 {
00212 $sURL = $this->_getAdminUrl();
00213 $oXPath = new DomXPath( $oDom );
00214 $oStr = getStr();
00215 foreach (array('url', 'link') as $sAttrType) {
00216 foreach ( $oXPath->query( "//OXMENU//*[@$sAttrType]" ) as $oNode ) {
00217 $sLocalUrl = $oNode->getAttribute( $sAttrType );
00218 if (strpos($sLocalUrl, 'index.php?') === 0) {
00219 $sLocalUrl = $oStr->preg_replace('#^index.php\?#', $sURL, $sLocalUrl);
00220 $oNode->setAttribute( $sAttrType, $sLocalUrl );
00221 }
00222 }
00223 }
00224 }
00225
00233 protected function _checkRights( $oDom )
00234 {
00235 $oXPath = new DomXPath( $oDom );
00236 $oNodeList = $oXPath->query( '//*[@rights or @norights]' );
00237
00238 foreach ( $oNodeList as $oNode ) {
00239
00240 if ( ( $sReq = $oNode->getAttribute( 'rights' ) ) ) {
00241 $aPerm = explode( ',', $sReq );
00242 foreach ( $aPerm as $sPerm ) {
00243 if ( $sPerm && !$this->_hasRights( $sPerm ) ) {
00244 $oNode->parentNode->removeChild( $oNode );
00245 }
00246 }
00247
00248 } elseif ( ( $sNoReq = $oNode->getAttribute( 'norights' ) ) ) {
00249 $aPerm = explode( ',', $sNoReq );
00250 foreach ( $aPerm as $sPerm ) {
00251 if ( $sPerm && $this->_hasRights( $sPerm ) ) {
00252 $oNode->parentNode->removeChild( $oNode );
00253 }
00254 }
00255 }
00256 }
00257 }
00258
00266 protected function _checkGroups( $oDom )
00267 {
00268 $oXPath = new DomXPath( $oDom );
00269 $oNodeList = $oXPath->query( "//*[@nogroup or @group]" );
00270
00271 foreach ( $oNodeList as $oNode ) {
00272
00273 if ( ( $sReq = $oNode->getAttribute('group') ) ) {
00274 $aPerm = explode( ',', $sReq );
00275 foreach ( $aPerm as $sPerm ) {
00276 if ( $sPerm && !$this->_hasGroup( $sPerm ) ) {
00277 $oNode->parentNode->removeChild($oNode);
00278 }
00279 }
00280
00281 } elseif ( ( $sNoReq = $oNode->getAttribute('nogroup') ) ) {
00282 $aPerm = explode( ',', $sNoReq );
00283 foreach ( $aPerm as $sPerm ) {
00284 if ( $sPerm && $this->_hasGroup( $sPerm ) ) {
00285 $oNode->parentNode->removeChild($oNode);
00286 }
00287 }
00288 }
00289 }
00290 }
00291
00299 protected function _checkDemoShopDenials( $oDom )
00300 {
00301 if (!$this->getConfig()->isDemoShop()) {
00302
00303 return;
00304 }
00305
00306 $oXPath = new DomXPath( $oDom );
00307 $oNodeList = $oXPath->query( "//*[@disableForDemoShop]" );
00308 foreach ( $oNodeList as $oNode ) {
00309 if ( $oNode->getAttribute('disableForDemoShop') ) {
00310 $oNode->parentNode->removeChild($oNode);
00311 }
00312 }
00313 }
00314
00323 protected function _copyAttributes( $oDomElemTo, $oDomElemFrom )
00324 {
00325 foreach ( $oDomElemFrom->attributes as $oAttr ) {
00326 $oDomElemTo->setAttribute( $oAttr->nodeName, $oAttr->nodeValue );
00327 }
00328 }
00329
00341 protected function _mergeNodes( $oDomElemTo, $oDomElemFrom, $oXPathTo, $oDomDocTo, $sQueryStart )
00342 {
00343 foreach ( $oDomElemFrom->childNodes as $oFromNode ) {
00344 if ( $oFromNode->nodeType === XML_ELEMENT_NODE ) {
00345
00346 $sFromAttrName = $oFromNode->getAttribute( 'id' );
00347 $sFromNodeName = $oFromNode->tagName;
00348
00349
00350 $sQuery = "{$sQueryStart}/{$sFromNodeName}[@id='{$sFromAttrName}']";
00351 $oCurNode = $oXPathTo->query( $sQuery );
00352
00353
00354 if ( $oCurNode->length == 0 ) {
00355 $oDomElemTo->appendChild( $oDomDocTo->importNode( $oFromNode, true ) );
00356 } else {
00357
00358 $oCurNode = $oCurNode->item( 0 );
00359
00360
00361 $this->_copyAttributes( $oCurNode, $oFromNode );
00362
00363 if ( $oFromNode->childNodes->length ) {
00364 $this->_mergeNodes( $oCurNode, $oFromNode, $oXPathTo, $oDomDocTo, $sQuery );
00365 }
00366 }
00367 }
00368 }
00369 }
00370
00379 protected function _merge( $oDomNew, $oDom )
00380 {
00381 $oXPath = new DOMXPath( $oDom );
00382 $this->_mergeNodes( $oDom->documentElement, $oDomNew->documentElement, $oXPath, $oDom, '/OX' );
00383 }
00384
00394 public function getTabs( $sId, $iAct, $blSetActive = true )
00395 {
00396 $oXPath = new DOMXPath( $this->getDomXml() );
00397
00398 $oNodeList = $oXPath->query( "//SUBMENU[@cl='$sId']/TAB | //SUBMENU[@list='$sId']/TAB | //SUBMENU/../TAB[@cl='$sId']" );
00399
00400 $iAct = ( $iAct > $oNodeList->length )?( $oNodeList->length - 1 ):$iAct;
00401
00402 if ( $blSetActive ) {
00403 foreach ( $oNodeList as $iPos => $oNode ) {
00404 if ( $iPos == $iAct ) {
00405
00406 $oNode->setAttribute( 'active', 1 );
00407 }
00408 }
00409 }
00410
00411 return $oNodeList;
00412 }
00413
00422 public function getActiveTab( $sId, $iAct )
00423 {
00424 $sTab = null;
00425 $oNodeList = $this->getTabs( $sId, $iAct, false );
00426 $iAct = ( $iAct > $oNodeList->length )?( $oNodeList->length - 1 ):$iAct;
00427 if ( $oNodeList->length && ( $oNode = $oNodeList->item( $iAct ) ) ) {
00428 $sTab = $oNode->getAttribute( 'cl' );
00429 }
00430
00431 return $sTab;
00432 }
00433
00441 public function getBtn( $sClass )
00442 {
00443 $oButtons = null;
00444 $oXPath = new DOMXPath($this->getDomXml());
00445 $oNodeList = $oXPath->query("//TAB[@cl='$sClass']/../BTN");
00446 if ($oNodeList->length) {
00447 $oButtons = new OxstdClass();
00448 foreach ($oNodeList as $oNode) {
00449 $sBtnID = $oNode->getAttribute('id');
00450 $oButtons->$sBtnID = 1;
00451 }
00452 }
00453 return $oButtons;
00454 }
00455
00461 protected function _getMenuFiles()
00462 {
00463 $myConfig = $this->getConfig();
00464 $myOxUtlis = oxUtils::getInstance();
00465
00466 $sFullAdminDir = getShopBasePath() . $myConfig->getConfigParam( 'sAdminDir' );
00467 $sMenuFile = "/menu.xml";
00468
00469 $sTmpDir = $myConfig->getConfigParam( 'sCompileDir' );
00470 $sDynLang = $this->_getDynMenuLang();
00471 $sLocalDynPath = "{$sTmpDir}{$sDynLang}_dynscreen.xml";
00472
00473
00474
00475 if ( file_exists( $sFullAdminDir.$sMenuFile ) ) {
00476 $aFilesToLoad[] = $sFullAdminDir.$sMenuFile;
00477 }
00478
00479
00480 if ( file_exists( "$sFullAdminDir/user.xml" ) ) {
00481 $aFilesToLoad[] = "$sFullAdminDir/user.xml";
00482 }
00483
00484
00485 $sPath = getShopBasePath();
00486 $oModulelist = oxNew('oxmodulelist');
00487 $aActiveModuleInfo = $oModulelist->getActiveModuleInfo();
00488 if (is_array($aActiveModuleInfo)) {
00489 foreach ( $aActiveModuleInfo as $sModulePath ) {
00490 $sFullPath = $sPath. "modules/" . $sModulePath;
00491
00492 if ( is_dir( $sFullPath ) ) {
00493
00494 $sMenuFile = $sFullPath . "/menu.xml";
00495 if ( file_exists( $sMenuFile ) && is_readable( $sMenuFile ) ) {
00496 $aFilesToLoad[] = $sMenuFile;
00497 }
00498 }
00499 }
00500 }
00501
00502 $blLoadDynContents = $myConfig->getConfigParam( 'blLoadDynContents' );
00503 $sShopCountry = $myConfig->getConfigParam( 'sShopCountry' );
00504
00505
00506 $sDynPath = null;
00507
00508 if ( $blLoadDynContents ) {
00509 if ( $sShopCountry ) {
00510 $sRemoteDynUrl = $this->_getDynMenuUrl( $sDynLang, $blLoadDynContents );
00511
00512
00513 $blLoadRemote = oxSession::getVar( "loadedremotexml" );
00514
00515
00516 if ( ( !isset( $blLoadRemote ) || $blLoadRemote ) && ( $sDynPath = $myOxUtlis->getRemoteCachePath( $sRemoteDynUrl, $sLocalDynPath ) ) ) {
00517 $sDynPath = $this->_checkDynFile( $sDynPath );
00518 }
00519
00520
00521 oxSession::setVar( "loadedremotexml", $sDynPath ? true : false );
00522 }
00523 } else {
00524 if ( $sShopCountry ) {
00525
00526 }
00527 }
00528
00529
00530 if ( $sDynPath ) {
00531 $aFilesToLoad[] = $sDynPath;
00532 }
00533 return $aFilesToLoad;
00534 }
00535
00543 protected function _checkDynFile( $sDynFilePath )
00544 {
00545 $sDynFile = null;
00546 if ( file_exists( $sDynFilePath ) ) {
00547 $sLine = null;
00548 if ( ( $rHandle = @fopen($sDynFilePath, 'r' ) ) ) {
00549 $sLine = stream_get_line( $rHandle, 100, "?>");
00550 fclose( $rHandle );
00551
00552
00553 if ( $sLine && stripos( $sLine, '<?xml' ) !== false ) {
00554 $sDynFile = $sDynFilePath;
00555 }
00556 }
00557
00558
00559 if ( !$sDynFile ) {
00560 @unlink( $sDynFilePath );
00561 }
00562 }
00563
00564 return $sDynFile;
00565 }
00566
00579 protected function _processCachedFile( $sCacheContents )
00580 {
00581 return $sCacheContents;
00582 }
00583
00589 protected function _getInitialDom()
00590 {
00591 if ( $this->_oInitialDom === null ) {
00592 $myOxUtlis = oxUtils::getInstance();
00593
00594 if ( is_array( $aFilesToLoad = $this->_getMenuFiles() ) ) {
00595
00596
00597 $blReload = false;
00598 $sDynLang = $this->_getDynMenuLang();
00599
00600 $sCacheName = 'menu_' . $sDynLang . '_xml';
00601 $sCacheFile = $myOxUtlis->getCacheFilePath( $sCacheName );
00602 $sCacheContents = $myOxUtlis->fromFileCache( $sCacheName );
00603 if ( $sCacheContents && file_exists( $sCacheFile ) && ( $iCacheModTime = filemtime( $sCacheFile ) ) ) {
00604 foreach ( $aFilesToLoad as $sDynPath ) {
00605 if ( $iCacheModTime < filemtime( $sDynPath ) ) {
00606 $blReload = true;
00607 }
00608 }
00609 } else {
00610 $blReload = true;
00611 }
00612
00613 $this->_oInitialDom = new DOMDocument();
00614 if ( $blReload ) {
00615
00616 $this->_oInitialDom->appendChild( new DOMElement( 'OX' ) );
00617
00618 foreach ( $aFilesToLoad as $sDynPath ) {
00619 $this->_loadFromFile( $sDynPath, $this->_oInitialDom );
00620 }
00621
00622
00623 $this->_addLinks( $this->_oInitialDom );
00624
00625
00626 $this->_addDynLinks( $this->_oInitialDom );
00627
00628
00629 $myOxUtlis->toFileCache( $sCacheName, $this->_oInitialDom->saveXML() );
00630 } else {
00631 $sCacheContents = $this->_processCachedFile($sCacheContents);
00632
00633 $this->_oInitialDom->preserveWhiteSpace = false;
00634 $this->_oInitialDom->loadXML( $sCacheContents );
00635 }
00636
00637
00638 $this->_sessionizeLocalUrls( $this->_oInitialDom );
00639 }
00640 }
00641 return $this->_oInitialDom;
00642 }
00643
00649 public function getDomXml()
00650 {
00651 if ( $this->_oDom === null ) {
00652 $this->_oDom = clone $this->_getInitialDom();
00653
00654
00655 $this->_checkGroups( $this->_oDom );
00656
00657
00658 $this->_checkRights( $this->_oDom );
00659
00660
00661 $this->_checkDemoShopDenials( $this->_oDom );
00662
00663
00664 $this->_cleanEmptyParents( $this->_oDom, '//SUBMENU[@id][@list]', 'TAB');
00665 $this->_cleanEmptyParents( $this->_oDom, '//MAINMENU[@id]', 'SUBMENU');
00666 }
00667
00668 return $this->_oDom;
00669 }
00670
00678 public function getListNodes( $aNodes )
00679 {
00680 $oXPath = new DOMXPath( $this->getDomXml() );
00681 $oNodeList = $oXPath->query( "//SUBMENU[@cl='".implode("' or @cl='", $aNodes)."']" );
00682
00683 return ( $oNodeList->length ) ? $oNodeList : null;
00684 }
00685
00693 public function markNodeActive( $sNodeId )
00694 {
00695 $oXPath = new DOMXPath( $this->getDomXml() );
00696 $oNodeList = $oXPath->query( "//*[@cl='{$sNodeId}' or @list='{$sNodeId}']" );
00697
00698 if ( $oNodeList->length ) {
00699 foreach ( $oNodeList as $oNode ) {
00700
00701 $oNode->setAttribute( 'active', 1 );
00702 $oNode->parentNode->setAttribute( 'active', 1 );
00703 }
00704 }
00705
00706 }
00707
00715 public function getListUrl( $sId )
00716 {
00717 $sUrl = null;
00718 $oXPath = new DOMXPath( $this->getDomXml() );
00719 $oNodeList = $oXPath->query( "//SUBMENU[@cl='{$sId}']" );
00720 if ( $oNodeList->length && ( $oNode = $oNodeList->item( 0 ) ) ) {
00721 $sCl = $oNode->getAttribute('list');
00722 $sCl = $sCl?"cl=$sCl":'';
00723
00724 $sParams = $oNode->getAttribute('listparam');
00725 $sParams = $sParams?"&$sParams":'';
00726
00727 $sUrl = "{$sCl}{$sParams}";
00728 }
00729 return $sUrl;
00730 }
00731
00740 public function getEditUrl( $sId, $iActTab )
00741 {
00742 $sUrl = null;
00743 $oXPath = new DOMXPath( $this->getDomXml() );
00744 $oNodeList = $oXPath->query( "//SUBMENU[@cl='{$sId}']/TAB" );
00745
00746 $iActTab = ( $iActTab > $oNodeList->length )?( $oNodeList->length - 1 ) : $iActTab;
00747 if ( $oNodeList->length && ( $oActTab = $oNodeList->item( $iActTab ) ) ) {
00748
00749 if ( $oActTab->getAttribute( 'external' ) ) {
00750 $sUrl = $oActTab->getAttribute( 'location' );
00751 } else {
00752 $sCl = $oActTab->getAttribute( 'cl' );
00753 $sCl = $sCl?"cl={$sCl}":'';
00754
00755 $sParams = $oActTab->getAttribute( 'clparam' );
00756 $sParams = $sParams?"&{$sParams}":'';
00757
00758 $sUrl = "{$sCl}{$sParams}";
00759 }
00760 }
00761 return $sUrl;
00762 }
00763
00769 protected function _getAdminUrl()
00770 {
00771 $myConfig = $this->getConfig();
00772
00773 if ( ( $sAdminSslUrl = $myConfig->getConfigParam( 'sAdminSSLURL' ) ) ) {
00774 $sURL = trim( $sAdminSslUrl, '/' );
00775 } else {
00776 $sURL = trim( $myConfig->getConfigParam( 'sShopURL' ), '/' ).'/admin';
00777 }
00778 return oxUtilsUrl::getInstance()->processUrl("{$sURL}/index.php", false);
00779 }
00780
00788 protected function _hasRights( $sRights )
00789 {
00790 return $this->getUser()->oxuser__oxrights->value == $sRights;
00791 }
00792
00800 protected function _hasGroup( $sGroupId )
00801 {
00802 return $this->getUser()->inGroup( $sGroupId );
00803 }
00804
00812 public function getClassId( $sClassName )
00813 {
00814 $sClassId = null;
00815
00816 $oXPath = new DOMXPath( $this->_getInitialDom() );
00817 $oNodeList = $oXPath->query( "//*[@cl='{$sClassName}' or @list='{$sClassName}']" );
00818 if ( $oNodeList->length && ( $oFirstItem = $oNodeList->item( 0 ) ) ) {
00819 $sClassId = $oFirstItem->getAttribute( 'id' );
00820 }
00821
00822 return $sClassId;
00823 }
00824
00832 public function getShopVersionNr()
00833 {
00834 $sVersion = "";
00835 if ( ( $sShopId = $this->getConfig()->getShopId() ) ) {
00836 $sVersion = oxDb::getDb()->getOne( "select oxversion from oxshops where oxid = '$sShopId' ", false, false );
00837 $sVersion = preg_replace( "/(^[^0-9]+)(.+)$/", "\$2", $sVersion );
00838 }
00839
00840 return trim( $sVersion );
00841 }
00842
00843
00852 protected function _getDynMenuUrl( $iLang, $blLoadDynContents )
00853 {
00854 if ( !$blLoadDynContents ) {
00855
00856 $sFullAdminDir = getShopBasePath() . $this->getConfig()->getConfigParam( 'sAdminDir' );
00857 $sUrl = $sFullAdminDir . "/dynscreen_local.xml";
00858 } else {
00859 $oAdminView = oxNew( 'oxadminview' );
00860 $this->_sDynIncludeUrl = $oAdminView->getServiceUrl( $iLang );
00861 $sUrl .= $this->_sDynIncludeUrl . "menue/dynscreen.xml";
00862 }
00863
00864 return $sUrl;
00865 }
00866
00872 protected function _getDynMenuLang()
00873 {
00874 $myConfig = $this->getConfig();
00875 $oLang = oxLang::getInstance();
00876
00877 $iDynLang = $myConfig->getConfigParam( 'iDynInterfaceLanguage' );
00878 $iDynLang = isset( $iDynLang )?$iDynLang:( $oLang->getTplLanguage() );
00879
00880 $aLanguages = $oLang->getLanguageArray();
00881 $sLangAbr = $aLanguages[$iDynLang]->abbr;
00882
00883 return $sLangAbr;
00884 }
00885 }