Public Member Functions | |
getHtml () | |
getCondition () |
Definition at line 35 of file Store.php.
getCondition | ( | ) |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Abstract.
Definition at line 90 of file Store.php.
00091 { 00092 if (is_null($this->getValue())) { 00093 return null; 00094 } 00095 if ($this->getValue() == '_deleted_') { 00096 return array('null' => true); 00097 } 00098 else { 00099 return array('eq' => $this->getValue()); 00100 } 00101 }
getHtml | ( | ) |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Abstract.
Definition at line 38 of file Store.php.
00039 { 00040 $storeModel = Mage::getSingleton('adminhtml/system_store'); 00041 /* @var $storeModel Mage_Adminhtml_Model_System_Store */ 00042 $websiteCollection = $storeModel->getWebsiteCollection(); 00043 $groupCollection = $storeModel->getGroupCollection(); 00044 $storeCollection = $storeModel->getStoreCollection(); 00045 00046 $allShow = $this->getColumn()->getStoreAll(); 00047 00048 $html = '<select name="' . ($this->getColumn()->getName() ? $this->getColumn()->getName() : $this->getColumn()->getId()) . '" ' . $this->getColumn()->getValidateClass() . '>'; 00049 $value = $this->getColumn()->getValue(); 00050 if ($allShow) { 00051 $html .= '<option value="0"' . ($value == 0 ? ' selected="selected"' : '') . '>' . Mage::helper('adminhtml')->__('All Store Views') . '</option>'; 00052 } else { 00053 $html .= '<option value=""' . (!$value ? ' selected="selected"' : '') . '></option>'; 00054 } 00055 foreach ($websiteCollection as $website) { 00056 $websiteShow = false; 00057 foreach ($groupCollection as $group) { 00058 if ($group->getWebsiteId() != $website->getId()) { 00059 continue; 00060 } 00061 $groupShow = false; 00062 foreach ($storeCollection as $store) { 00063 if ($store->getGroupId() != $group->getId()) { 00064 continue; 00065 } 00066 if (!$websiteShow) { 00067 $websiteShow = true; 00068 $html .= '<optgroup label="' . $website->getName() . '"></optgroup>'; 00069 } 00070 if (!$groupShow) { 00071 $groupShow = true; 00072 $html .= '<optgroup label=" ' . $group->getName() . '">'; 00073 } 00074 $value = $this->getValue(); 00075 $html .= '<option value="' . $store->getId() . '"' . ($value == $store->getId() ? ' selected="selected"' : '') . '> ' . $store->getName() . '</option>'; 00076 } 00077 if ($groupShow) { 00078 $html .= '</optgroup>'; 00079 } 00080 } 00081 } 00082 if ($this->getColumn()->getDisplayDeleted()) { 00083 $selected = ($this->getValue() == '_deleted_') ? ' selected' : ''; 00084 $html.= '<option value="_deleted_"'.$selected.'>'.$this->__('[ deleted ]').'</option>'; 00085 } 00086 $html .= '</select>'; 00087 return $html; 00088 }