Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Store Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Store:

Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Abstract Mage_Adminhtml_Block_Abstract Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Interface Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getHtml ()
 getCondition ()


Detailed Description

Definition at line 35 of file Store.php.


Member Function Documentation

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="&nbsp;&nbsp;&nbsp;&nbsp;' . $group->getName() . '">';
00073                     }
00074                     $value = $this->getValue();
00075                     $html .= '<option value="' . $store->getId() . '"' . ($value == $store->getId() ? ' selected="selected"' : '') . '>&nbsp;&nbsp;&nbsp;&nbsp;' . $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     }


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

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