00001 <?php
00002
00007 class Navigation extends oxAdminView
00008 {
00015 public function render()
00016 {
00017 parent::render();
00018
00019 $sItem = oxConfig::getParameter( "item");
00020 if ( !isset( $sItem) || !$sItem ) {
00021 $sItem = "nav_frame.tpl";
00022
00023 $aFavorites = oxConfig::getParameter( "favorites");
00024 if(is_array($aFavorites)) {
00025 oxUtilsServer::getInstance()->setOxCookie('oxidadminfavorites',implode('|',$aFavorites));
00026 }
00027
00028 } else {
00029
00030 $this->_aViewData["menustructure"] = $this->getNavigation()->getDomXml()->documentElement->childNodes;
00031
00032
00033 $sVersion = str_replace( array("EE.","PE."), "", $this->_sShopVersion);
00034 $this->_aViewData["sVersion"] = trim($sVersion);
00035
00036
00037 $aFavorites = explode('|',oxUtilsServer::getInstance()->getOxCookie('oxidadminfavorites'));
00038
00039 if(is_array($aFavorites) && count($aFavorites)) {
00040 $this->_aViewData["menufavorites"] = $this->getNavigation()->getListNodes($aFavorites);
00041 $this->_aViewData["aFavorites"] = $aFavorites;
00042 }
00043
00044
00045 $aHistory = explode('|',oxUtilsServer::getInstance()->getOxCookie('oxidadminhistory'));
00046 if(is_array($aHistory) && count($aHistory)) {
00047 $this->_aViewData["menuhistory"] = $this->getNavigation()->getListNodes($aHistory);
00048 }
00049
00050
00051 $this->_aViewData["blOpenHistory"] = oxConfig::getParameter( 'openHistory' );
00052 }
00053
00054 $oShoplist = oxNew( 'oxshoplist' );
00055 $oBaseShop = $oShoplist->getBaseObject();
00056
00057 $sWhere = '';
00058 $blisMallAdmin = oxSession::getVar( 'malladmin' );
00059 if ( !$blisMallAdmin) {
00060
00061 $sShopID = oxSession::getVar( "actshop" );
00062 $sWhere = "where and oxshops.oxid = '$sShopID'";
00063 }
00064
00065 $oShoplist->selectString( "select ".$oBaseShop->getSelectFields()." from " . $oBaseShop->getViewName() . " $sWhere" );
00066 $this->_aViewData['shoplist'] = $oShoplist;
00067
00068 return $sItem;
00069 }
00070
00076 public function logout()
00077 {
00078 $mySession = $this->getSession();
00079 $myConfig = $this->getConfig();
00080
00081 $oUser = oxNew( "oxuser" );
00082 $oUser->logout();
00083
00084
00085
00086 $sSID = $mySession->getId();
00087
00088
00089 $mySession->destroy();
00090
00091
00092 if ( $myConfig->getConfigParam( 'blAdodbSessionHandler' ) ) {
00093 $sSQL = "delete from oxsessions where SessionID = '$sSID'";
00094 oxDb::getDb()->Execute( $sSQL);
00095 }
00096
00097 oxUtils::getInstance()->redirect( 'index.php' );
00098 }
00099 }