00001 <?php
00002
00006 class Navigation extends oxAdminView
00007 {
00014 public function render()
00015 {
00016 parent::render();
00017 $myUtilsServer = oxUtilsServer::getInstance();
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 $myUtilsServer->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 $this->_aViewData['aMessage'] = $this->_doStartUpChecks();
00038
00039
00040 $aFavorites = explode('|',$myUtilsServer->getOxCookie('oxidadminfavorites'));
00041
00042 if(is_array($aFavorites) && count($aFavorites)) {
00043 $this->_aViewData["menufavorites"] = $this->getNavigation()->getListNodes($aFavorites);
00044 $this->_aViewData["aFavorites"] = $aFavorites;
00045 }
00046
00047
00048 $aHistory = explode('|',$myUtilsServer->getOxCookie('oxidadminhistory'));
00049 if(is_array($aHistory) && count($aHistory)) {
00050 $this->_aViewData["menuhistory"] = $this->getNavigation()->getListNodes($aHistory);
00051 }
00052
00053
00054 $this->_aViewData["blOpenHistory"] = oxConfig::getParameter( 'openHistory' );
00055 }
00056
00057 $oShoplist = oxNew( 'oxshoplist' );
00058 $oBaseShop = $oShoplist->getBaseObject();
00059
00060 $sWhere = '';
00061 $blisMallAdmin = oxSession::getVar( 'malladmin' );
00062 if ( !$blisMallAdmin) {
00063
00064 $sShopID = oxSession::getVar( "actshop" );
00065 $sWhere = "where oxshops.oxid = '$sShopID'";
00066 }
00067
00068 $oShoplist->selectString( "select ".$oBaseShop->getSelectFields()." from " . $oBaseShop->getViewName() . " $sWhere" );
00069 $this->_aViewData['shoplist'] = $oShoplist;
00070
00071 return $sItem;
00072 }
00073
00079 public function logout()
00080 {
00081 $mySession = $this->getSession();
00082 $myConfig = $this->getConfig();
00083
00084 $oUser = oxNew( "oxuser" );
00085 $oUser->logout();
00086
00087
00088
00089 $sSID = $mySession->getId();
00090
00091
00092 $mySession->destroy();
00093
00094
00095 if ( $myConfig->getConfigParam( 'blAdodbSessionHandler' ) ) {
00096 $sSQL = "delete from oxsessions where SessionID = '$sSID'";
00097 oxDb::getDb()->Execute( $sSQL);
00098 }
00099
00100
00101 $blDeleteCache = $this->getConfig()->getConfigParam( 'blClearCacheOnLogout' );
00102 if ( $blDeleteCache ) {
00103 $this->resetContentCache( $blDeleteCache );
00104 }
00105
00106 oxUtils::getInstance()->redirect( 'index.php' );
00107 }
00108
00115 protected function _doStartUpChecks()
00116 {
00117 $aMessage = array();
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 $oSysReq = new oxSysRequirements();
00139 if ( !$oSysReq->getSysReqStatus() ) {
00140 $aMessage['warning'] = oxLang::getInstance()->translateString('NAVIGATION_SYSREQ_MESSAGE');
00141 $aMessage['warning'] .= '<a href="?cl=sysreq" target="basefrm">';
00142 $aMessage['warning'] .= oxLang::getInstance()->translateString('NAVIGATION_SYSREQ_MESSAGE2').'</a>';
00143 }
00144
00145
00146 if ( $sVersionNotice = $this->_checkVersion() ) {
00147 $aMessage['message'] .= $sVersionNotice;
00148 }
00149
00150 return $aMessage;
00151 }
00152
00158 protected function _checkVersion()
00159 {
00160 $sVersion = 'CE';
00161
00162 $sQuery = 'http://admin.oxid-esales.com/'.$sVersion.'/onlinecheck.php?getlatestversion';
00163 if ( $sVersion = oxUtilsFile::getInstance()->readRemoteFileAsString( $sQuery ) ) {
00164
00165 if ( version_compare( $this->getConfig()->getVersion(), $sVersion ) == '-1' ) {
00166 return sprintf( oxLang::getInstance()->translateString( 'NAVIGATION_NEWVERSIONAVAILABLE' ), $sVersion );
00167 }
00168 }
00169 }
00170 }