Mage_Adminhtml_Model_System_Config_Backend_Baseurl Class Reference

Inheritance diagram for Mage_Adminhtml_Model_System_Config_Backend_Baseurl:

Mage_Core_Model_Config_Data Mage_Core_Model_Abstract Varien_Object

List of all members.

Protected Member Functions

 _beforeSave ()


Detailed Description

Definition at line 28 of file Baseurl.php.


Member Function Documentation

_beforeSave (  )  [protected]

Processing object before save data

Returns:
Mage_Core_Model_Abstract

If value is special ({{}}) we don't need add slash

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 30 of file Baseurl.php.

00031     {
00032         $value = $this->getValue();
00033 
00034         if (!preg_match('#^{{((un)?secure_)?base_url}}#', $value)) {
00035             $parsedUrl = parse_url($value);
00036             if (!isset($parsedUrl['scheme']) || !isset($parsedUrl['host'])) {
00037                 Mage::throwException(Mage::helper('core')->__('The %s you entered is invalid. Please make sure that it follows "http://domain.com/" format.', $this->getFieldConfig()->label));
00038             }
00039         }
00040 
00041         $value = rtrim($value,  '/');
00042         /**
00043          * If value is special ({{}}) we don't need add slash
00044          */
00045         if (!preg_match('#}}$#', $value)) {
00046             $value.= '/';
00047         }
00048          
00049 
00050         $this->setValue($value);
00051         return $this;
00052     }


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