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         $aConfStrs = oxConfig::getParameter( "aShopID_TrustedShops" );
00040         $blSave = true;
00041         $blNotEmpty = false;
00042         foreach ( $aConfStrs as $sConfStrs ) {
00043             if ( $sConfStrs ) {
00044                 $blNotEmpty = true;
00045                 if ( strlen( $sConfStrs ) != 33 || substr( $sConfStrs, 0, 1 ) != 'X' ) {
00046                     $blSave = false;
00047                 }
00048             }
00049         }
00050 
00051         $aTSIds = array_filter( $aConfStrs );
00052         if ( $blNotEmpty && ( count( array_unique( $aTSIds ) ) < count( $aTSIds ) ) ) {
00053             $blSave = false;
00054         }
00055 
00056         if ( $blSave ) {
00057             $myConfig = $this->getConfig();
00058             $myConfig->saveShopConfVar( "aarr", 'iShopID_TrustedShops', $aConfStrs, $myConfig->getShopId() );
00059         } else {
00060             // displaying error..
00061             $this->_aViewData["errorsaving"] = 1;
00062             $this->_aViewData["aShopID_TrustedShops"] = null;
00063         }
00064     }
00065 
00071     public function getViewId()
00072     {
00073         return 'dyn_interface';
00074     }
00075 }

Generated by  doxygen 1.6.2