本文整理汇总了PHP中Mage_Core_Model_Config_Data::_afterSave方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Config_Data::_afterSave方法的具体用法?PHP Mage_Core_Model_Config_Data::_afterSave怎么用?PHP Mage_Core_Model_Config_Data::_afterSave使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Config_Data
的用法示例。
在下文中一共展示了Mage_Core_Model_Config_Data::_afterSave方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _afterSave
/**
* 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;
}
示例2: _afterSave
protected function _afterSave()
{
if ($this->isValueChanged()) {
Mage::getModel('enterprise_giftcardaccount/pool')->cleanupFree();
}
parent::_afterSave();
}
示例3: _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();
}
示例4: _afterSave
/**
* 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;
}
示例5: _afterSave
/**
* 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();
}
示例6: _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();
}
示例7: _afterSave
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();
}
示例8: _afterSave
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();
}
示例9: _afterSave
/**
* 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();
}
示例10: _afterSave
/**
* 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();
}
示例11: _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();
}
示例12: _afterSave
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();
}
示例13: _afterSave
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();
}
示例14: _afterSave
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();
}
示例15: _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();
}