dyn_trusted.php

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

Generated on Thu Feb 19 15:02:20 2009 for OXID eShop CE by  doxygen 1.5.5