Exemple #1
0
 /**
  * Actions after save
  *
  * @return Mage_Adminhtml_Model_System_Config_Backend_Customer_Show_Customer
  */
 protected function _afterSave()
 {
     $result = parent::_afterSave();
     $valueConfig = array('' => array('is_required' => 0, 'is_visible' => 0), 'opt' => array('is_required' => 0, 'is_visible' => 1), '1' => array('is_required' => 0, 'is_visible' => 1), 'req' => array('is_required' => 1, 'is_visible' => 1));
     $value = $this->getValue();
     if (isset($valueConfig[$value])) {
         $data = $valueConfig[$value];
     } else {
         $data = $valueConfig[''];
     }
     if ($this->getScope() == 'websites') {
         $website = Mage::app()->getWebsite($this->getWebsiteCode());
         $dataFieldPrefix = 'scope_';
     } else {
         $website = null;
         $dataFieldPrefix = '';
     }
     foreach ($this->_getAttributeObjects() as $attributeObject) {
         if ($website) {
             $attributeObject->setWebsite($website);
             $attributeObject->load($attributeObject->getId());
         }
         $attributeObject->setData($dataFieldPrefix . 'is_required', $data['is_required']);
         $attributeObject->setData($dataFieldPrefix . 'is_visible', $data['is_visible']);
         $attributeObject->save();
     }
     return $result;
 }
 protected function _afterSave()
 {
     if ($this->isValueChanged()) {
         Mage::getModel('enterprise_giftcardaccount/pool')->cleanupFree();
     }
     parent::_afterSave();
 }
 /**
  * Cleanup blocks HTML cache if value has been changed
  *
  * @return Enterprise_WebsiteRestriction_Model_System_Config_Backend_Active
  */
 protected function _afterSave()
 {
     if ($this->isValueChanged()) {
         Mage::dispatchEvent('clean_cache_by_tags', array('tags' => array(Mage_Core_Model_Store::CACHE_TAG, Mage_Cms_Model_Block::CACHE_TAG)));
     }
     return parent::_afterSave();
 }
Exemple #4
0
 /**
  * After save call
  * Invalidate catalog search index if engine was changed
  *
  * @return Enterprise_Search_Model_Adminhtml_System_Config_Backend_Engine
  */
 protected function _afterSave()
 {
     parent::_afterSave();
     if ($this->isValueChanged()) {
         Mage::getSingleton('index/indexer')->getProcessByCode('catalogsearch_fulltext')->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX);
     }
     return $this;
 }
Exemple #5
0
 /**
  * Prepare and store cron settings after save
  *
  * @return Mage_Tax_Model_Config_Notification
  */
 protected function _afterSave()
 {
     if ($this->isValueChanged()) {
         $this->_resetNotificationFlag(Mage_Tax_Model_Config::XML_PATH_TAX_NOTIFICATION_DISCOUNT);
         $this->_resetNotificationFlag(Mage_Tax_Model_Config::XML_PATH_TAX_NOTIFICATION_PRICE_DISPLAY);
     }
     return parent::_afterSave();
 }
 /**
  * Check to see if user has enabled the configuration, if not, warn them they have not
  *
  * @return Mage_Core_Model_Abstract|void
  */
 protected function _afterSave()
 {
     $enabled = $this->getValue();
     if ($enabled == null || $enabled == 0) {
         Mage::getSingleton('core/session')->addNotice(Mage::helper('blueacorn_optimizely')->__('You have not enabled the Optimizely Extension. No data will appear on the frontend. Please enable to activate frontend Javascript output.'));
     }
     return parent::_afterSave();
 }
Exemple #7
0
 public function _afterSave()
 {
     $key = Mage::getStoreConfig('payment/mtgox/key');
     $secret = $this->getValue();
     if (!Mage::helper('mtgoxbitcoin')->isValidConnection($key, $secret)) {
         Mage::getConfig()->saveConfig('payment/mtgox/active', 0);
     }
     return parent::_afterSave();
 }
Exemple #8
0
 public function _afterSave()
 {
     $key = $this->getValue();
     $secret = Mage::getStoreConfig('payment/mtgox/secret');
     if (!Mage::helper('mtgoxbitcoin')->isValidConnection($key, $secret)) {
         Mage::getConfig()->saveConfig('payment/mtgox/active', 0);
         Mage::getSingleton('adminhtml/session')->addError('The MtGox payment module has been disabled since the API settings are invalid.');
     }
     return parent::_afterSave();
 }
Exemple #9
0
 /**
  * Check and process robots file
  *
  * @return Mage_Backend_Model_Config_Backend_Admin_Robots
  */
 protected function _afterSave()
 {
     if ($this->getValue()) {
         $file = $this->_getRobotsTxtFilePath();
         $fileIo = $this->_getFileObject();
         $fileIo->open(array('path' => $fileIo->getDestinationFolder($file)));
         $fileIo->write($file, $this->getValue());
     }
     return parent::_afterSave();
 }
Exemple #10
0
 /**
  * Cron settings after save
  * @return void
  */
 protected function _afterSave()
 {
     $cronExprString = '';
     $time = explode(',', Mage::getModel('core/config_data')->load('paypal/fetch_reports/time', 'path')->getValue());
     if (Mage::getModel('core/config_data')->load('paypal/fetch_reports/active', 'path')->getValue()) {
         $interval = Mage::getModel('core/config_data')->load(self::CRON_MODEL_PATH_INTERVAL, 'path')->getValue();
         $cronExprString = "{$time[1]} {$time[0]} */{$interval} * *";
     }
     Mage::getModel('core/config_data')->load(self::CRON_STRING_PATH, 'path')->setValue($cronExprString)->setPath(self::CRON_STRING_PATH)->save();
     return parent::_afterSave();
 }
 /**
  * public function save()
  *     {
  *         $fax = $this->getValue(); //get the value from our config
  *         $fax = preg_replace('#[^0-9]#','',$fax); //strip non numeric
  *         if(strlen($fax) < 10)   //exit if we're less than 10 digits long
  *         {
  *             Mage::throwException("Fax Numbers need 10 digits. For American Numbers. Programming examples are horribly US-ethnocentric sometimes.");  
  *             //exit("Fax Numbers need 10 digits. For American Numbers. Programming examples are often horribly US-ethnocentric.");
  *         }
  *  
  *         return parent::save();  //call original save method so whatever happened 
  *                                 //before still happens (the value saves)
  *     }
  */
 public function _afterSave()
 {
     $fax = $this->getValue();
     //get the value from our config
     $fax = preg_replace('[^0-9]', '', $fax);
     //strip non numberic
     if (strlen($fax) < 10) {
         Mage::getSingleton('core/session')->addNotice('Fax numbers contains less than 10 digits.  Please check your new value and change if desired.');
     }
     return parent::_afterSave();
 }
Exemple #12
0
 public function _afterSave()
 {
     //Get the saved value
     $value = $this->getValue();
     //Get the value from config (previous value)
     $oldValue = $this->getOldValue();
     if ($value != $oldValue) {
         Mage::getSingleton('adminhtml/session')->addNotice(Mage::helper('ultimo')->__('"Image Column Width" has changed (previous value: %s). Adjust the "Main Image Width" value in System > Configuration > Zoom > Image Size', $oldValue));
     }
     return parent::_afterSave();
 }
Exemple #13
0
 public function _afterSave()
 {
     //Get the saved value
     $value = $this->getValue();
     //Get the value from config (previous value)
     $oldValue = $this->getOldValue();
     if ($value != $oldValue) {
         if (empty($value) || trim($value) === '') {
             Mage::getSingleton('adminhtml/session')->addNotice(Mage::helper('themesettings')->__('Right Column in the header has been disabled and will not be displayed in the header. IMPORTANT: note that any blocks assigned to the Right Column will also not be displayed.'));
         } else {
             Mage::getSingleton('adminhtml/session')->addNotice(Mage::helper('themesettings')->__('Width of the Right Column in the header has changed (previous value: %s). Note that sum of these columns has to be equal 12 grid units.', $oldValue));
         }
     }
     return parent::_afterSave();
 }
Exemple #14
0
 public function _afterSave()
 {
     $tmp_fn = $_FILES["groups"]["tmp_name"]["migration"]["fields"]["importcampaign"]["value"];
     if (!empty($tmp_fn)) {
         $this->importCampaign($tmp_fn);
     }
     $tmp_fn = $_FILES["groups"]["tmp_name"]["migration"]["fields"]["importpoints"]["value"];
     if (!empty($tmp_fn)) {
         $this->importPoints($tmp_fn);
     }
     //$tmp_fn = $_FILES["groups"]["tmp_name"]["migration"]["fields"]["importconfig"]["value"];
     //if(!empty($tmp_fn)) {
     //     $this->importConfig($tmp_fn);
     // }
     return parent::_afterSave();
 }
 /**
  * Hook into system config save event and save to custom XML path of button image names
  * as well copying button image files to media folder
  *
  * @return Symmetrics_TrustedRating_Model_System_Config_Backend_RateUs_Button
  */
 protected function _afterSave()
 {
     if ($this->isValueChanged()) {
         $scopeCode = $this->getStoreCode() ? $this->getStoreCode() : $this->getWebsiteCode();
         $this->getHelper()->initTrustedRatingRateusButtonMediaDir();
         $type = $this->getFieldConfig()->getAttribute(self::ATTRIBUTE_RATE_TYPE);
         $place = self::$fieldPlaceMaps[$this->getField()];
         foreach ($this->_getTsStoreData($this->getScope(), $scopeCode) as $storeId => $data) {
             $imageName = $this->_assembleTrustedratingRateusButtonImageName($data);
             $xmlPath = $this->getHelper()->getXmlPathRateusButtonImage($type, $place);
             $this->_saveStoreConfig($xmlPath, $imageName, $storeId);
             $this->_copyTrustedratingRateusButtonImageToMediaDir($imageName, $data->getLanguage());
         }
     }
     return parent::_afterSave();
 }
 protected function _afterSave()
 {
     parent::_afterSave();
     Mage::getSingleton('adminhtml/session')->setData('manufacturer_update_stores', true);
     return $this;
 }
Exemple #17
0
 /**
  * Check and process robots file
  *
  * @return Mage_Backend_Model_Config_Backend_Admin_Robots
  */
 protected function _afterSave()
 {
     if ($this->getValue()) {
         $this->_filesystem->write($this->_filePath, $this->getValue());
     }
     return parent::_afterSave();
 }
Exemple #18
0
 /**
  * Prepare and store cron settings after save
  *
  * @return Enterprise_Index_Model_Config_Backend_Cron
  */
 protected function _afterSave()
 {
     $this->_saveCronSettings();
     parent::_afterSave();
     return $this;
 }