00001 <?php
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 class Mage_Adminhtml_Block_Tax_Rate_Title extends Mage_Core_Block_Template
00034 {
00035     protected $_titles;
00036 
00037     protected function _construct()
00038     {
00039         $this->setTemplate('tax/rate/title.phtml');
00040     }
00041 
00042     public function getTitles()
00043     {
00044         if (is_null($this->_titles)) {
00045             $this->_titles = array();
00046             $titles = Mage::getSingleton('tax/calculation_rate')->getTitles();
00047             foreach ($titles as $title) {
00048                 $this->_titles[$title->getStoreId()] = $title->getValue();
00049             }
00050             foreach ($this->getStores() as $store) {
00051                 if (!isset($this->_titles[$store->getId()])) {
00052                     $this->_titles[$store->getId()] = '';
00053                 }
00054             }
00055         }
00056         return $this->_titles;
00057     }
00058 
00059     public function getStores()
00060     {
00061         $stores = $this->getData('stores');
00062         if (is_null($stores)) {
00063             $stores = Mage::getModel('core/store')
00064                 ->getResourceCollection()
00065                 ->setLoadDefault(false)
00066                 ->load();
00067             $this->setData('stores', $stores);
00068         }
00069         return $stores;
00070     }
00071 }