dyn_trusted.php

Go to the documentation of this file.
00001 <?php
00002 
00003 
00008 class dyn_trusted extends Shop_Config
00009 {
00016     public function render()
00017     {
00018         parent::render();
00019         $this->_aViewData['oxid'] = $this->getConfig()->getShopId();
00020         $aIds = $this->_aViewData["confaarrs"]['iShopID_TrustedShops'];
00021         // compability to old data
00022         if ( $aConfStrs = $this->_aViewData["str"]['iShopID_TrustedShops'] ) {
00023             $aIds = array( 0 => $aConfStrs );
00024         }
00025         
00026         $this->_aViewData["aShopID_TrustedShops"] = $aIds;
00027         $this->_aViewData["alllang"] = oxLang::getInstance()->getLanguageNames();
00028 
00029         return "dyn_trusted.tpl";
00030     }
00031 
00037     public function save()
00038     {
00039         $myConfig = $this->getConfig();
00040         $aConfStrs  = oxConfig::getParameter( "aShopID_TrustedShops");
00041         $blSave = true;
00042         $blNotEmpty = false;
00043         foreach ( $aConfStrs as $sConfStrs) {
00044             if ( $sConfStrs ) {
00045                 $blNotEmpty = true;
00046                 if ( strlen( $sConfStrs ) != 33 || substr( $sConfStrs, 0, 1 ) != 'X' ) {
00047                     $this->_aViewData["errorsaving"] = 1;
00048                     $blSave = false;
00049                     $this->_aViewData["aShopID_TrustedShops"] = null;
00050                 }
00051             }
00052         }
00053         if ( $blNotEmpty && ( count( array_unique( $aConfStrs ) ) < count( $aConfStrs ) ) ) {
00054             $this->_aViewData["errorsaving"] = 1;
00055             $blSave = false;
00056             $this->_aViewData["aShopID_TrustedShops"] = null;
00057         }
00058         
00059         if ( $blSave ) {
00060             $myConfig->saveShopConfVar( "aarr", 'iShopID_TrustedShops', serialize($aConfStrs), $myConfig->getShopId() );
00061         }
00062     }
00063 
00067     public function getViewId()
00068     {
00069         return 'dyn_interface';
00070     }
00071 }

Generated on Tue Apr 21 15:45:43 2009 for OXID eShop CE by  doxygen 1.5.5