Mage_Adminhtml_Model_System_Config_Backend_Admin_Custom Class Reference

Inheritance diagram for Mage_Adminhtml_Model_System_Config_Backend_Admin_Custom:

Mage_Core_Model_Config_Data Mage_Core_Model_Abstract Varien_Object

List of all members.

Public Member Functions

 _afterSave ()

Public Attributes

const CONFIG_SCOPE = 'stores'
const CONFIG_SCOPE_ID = 0
const XML_PATH_UNSECURE_BASE_URL = 'web/unsecure/base_url'
const XML_PATH_SECURE_BASE_URL = 'web/secure/base_url'

Protected Member Functions

 _beforeSave ()


Detailed Description

Definition at line 35 of file Custom.php.


Member Function Documentation

_afterSave (  ) 

Processing object after save data

Returns:
Mage_Core_Model_Abstract

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 55 of file Custom.php.

00056     {
00057         $useCustomUrl = $this->getData('groups/url/fields/use_custom/value');
00058         $value = $this->getValue();
00059 
00060         if ($useCustomUrl == 1 && empty($value)) {
00061             return $this;
00062         }
00063 
00064         if ($useCustomUrl == 1) {
00065             Mage::getConfig()->saveConfig(self::XML_PATH_SECURE_BASE_URL, $value, self::CONFIG_SCOPE, self::CONFIG_SCOPE_ID);
00066             Mage::getConfig()->saveConfig(self::XML_PATH_UNSECURE_BASE_URL, $value, self::CONFIG_SCOPE, self::CONFIG_SCOPE_ID);
00067         }
00068         else {
00069             Mage::getConfig()->deleteConfig(self::XML_PATH_SECURE_BASE_URL, self::CONFIG_SCOPE, self::CONFIG_SCOPE_ID);
00070             Mage::getConfig()->deleteConfig(self::XML_PATH_UNSECURE_BASE_URL, self::CONFIG_SCOPE, self::CONFIG_SCOPE_ID);
00071         }
00072 
00073         return $this;
00074     }

_beforeSave (  )  [protected]

Processing object before save data

Returns:
Mage_Core_Model_Abstract

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 43 of file Custom.php.

00044     {
00045         $value = $this->getValue();
00046 
00047         if (!empty($value) && substr($value, -2) !== '}}') {
00048             $value = rtrim($value, '/').'/';
00049         }
00050 
00051         $this->setValue($value);
00052         return $this;
00053     }


Member Data Documentation

const CONFIG_SCOPE = 'stores'

Definition at line 37 of file Custom.php.

const CONFIG_SCOPE_ID = 0

Definition at line 38 of file Custom.php.

const XML_PATH_SECURE_BASE_URL = 'web/secure/base_url'

Definition at line 41 of file Custom.php.

const XML_PATH_UNSECURE_BASE_URL = 'web/unsecure/base_url'

Definition at line 40 of file Custom.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:13 2009 for Magento by  doxygen 1.5.8