shop_license.php

Go to the documentation of this file.
00001 <?php
00002 
00008 class Shop_License extends Shop_Config
00009 {
00014     protected $_sThisTemplate = "shop_license.tpl";
00015 
00016 
00023     public function render()
00024     {
00025         $myConfig   = $this->getConfig();
00026         if ($myConfig->isDemoShop()) {
00027             throw oxNew( "oxSystemComponentException", "license" );
00028         }
00029 
00030         parent::render();
00031 
00032         $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
00033         if ( $soxId != "-1" && isset( $soxId ) ) {
00034             // load object
00035             $oShop = oxNew( "oxshop" );
00036             $oShop->load( $soxId );
00037             $this->_aViewData["edit"] =  $oShop;
00038         }
00039 
00040         $this->_aViewData["version"] = $myConfig->getVersion();
00041 
00042 
00043 
00044         if (!$this->_canUpdate()) {
00045             $this->_aViewData['readonly'] = true;
00046         }
00047 
00048         return $this->_sThisTemplate;
00049     }
00050 
00051 
00057     protected function _canUpdate()
00058     {
00059         $myConfig = $this->getConfig();
00060 
00061         $blIsMallAdmin = oxSession::getVar( 'malladmin' );
00062         if (!$blIsMallAdmin) {
00063             return false;
00064         }
00065 
00066         if ($myConfig->isDemoShop()) {
00067             return false;
00068         }
00069 
00070         return true;
00071     }
00072 }