1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: class Mage_Adminhtml_Block_Notification_Baseurl extends Mage_Adminhtml_Block_Template
28: {
29: 30: 31: 32: 33:
34: public function getConfigUrl()
35: {
36: $defaultUnsecure= (string) Mage::getConfig()->getNode('default/'.Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL);
37: $defaultSecure = (string) Mage::getConfig()->getNode('default/'.Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL);
38:
39: if ($defaultSecure == '{{base_url}}' || $defaultUnsecure == '{{base_url}}') {
40: return $this->getUrl('adminhtml/system_config/edit', array('section'=>'web'));
41: }
42:
43: $configData = Mage::getModel('core/config_data');
44: $dataCollection = $configData->getCollection()
45: ->addValueFilter('{{base_url}}');
46:
47: $url = false;
48: foreach ($dataCollection as $data) {
49: if ($data->getScope() == 'stores') {
50: $code = Mage::app()->getStore($data->getScopeId())->getCode();
51: $url = $this->getUrl('adminhtml/system_config/edit', array('section'=>'web', 'store'=>$code));
52: }
53: if ($data->getScope() == 'websites') {
54: $code = Mage::app()->getWebsite($data->getScopeId())->getCode();
55: $url = $this->getUrl('adminhtml/system_config/edit', array('section'=>'web', 'website'=>$code));
56: }
57:
58: if ($url) {
59: return $url;
60: }
61: }
62: return $url;
63: }
64: }
65: