Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Websites Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Websites:

Mage_Adminhtml_Block_Store_Switcher Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getProduct ()
 getStoreId ()
 getProductId ()
 getWebsites ()
 hasWebsite ($websiteId)
 isReadonly ()
 getStoreName ($storeId)
 getChooseFromStoreHtml ($storeTo)

Protected Attributes

 $_storeFromHtml


Detailed Description

Definition at line 34 of file Websites.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Mage_Adminhtml_Block_Store_Switcher.

Definition at line 38 of file Websites.php.

00039     {
00040         parent::__construct();
00041         $this->setTemplate('catalog/product/edit/websites.phtml');
00042     }


Member Function Documentation

getChooseFromStoreHtml ( storeTo  ) 

Definition at line 89 of file Websites.php.

00090     {
00091         if (!$this->_storeFromHtml) {
00092             $this->_storeFromHtml = '<select name="copy_to_stores[__store_identifier__]" disabled>';
00093             $this->_storeFromHtml.= '<option value="0">'.Mage::helper('catalog')->__('Default Values').'</option>';
00094             foreach ($this->getWebsiteCollection() as $_website) {
00095                 if (!$this->hasWebsite($_website->getId())) {
00096                     continue;
00097                 }
00098                 $this->_storeFromHtml .= '<optgroup label="' . $_website->getName() . '"></optgroup>';
00099                 foreach ($this->getGroupCollection($_website) as $_group) {
00100                     $this->_storeFromHtml .= '<optgroup label="&nbsp;&nbsp;&nbsp;&nbsp;' . $_group->getName() . '">';
00101                     foreach ($this->getStoreCollection($_group) as $_store) {
00102                         $this->_storeFromHtml .= '<option value="' . $_store->getId() . '">&nbsp;&nbsp;&nbsp;&nbsp;' . $_store->getName() . '</option>';
00103                     }
00104                 }
00105                 $this->_storeFromHtml .= '</optgroup>';
00106             }
00107             $this->_storeFromHtml.= '</select>';
00108         }
00109         return str_replace('__store_identifier__', $storeTo->getId(), $this->_storeFromHtml);
00110     }

getProduct (  ) 

Retrieve edited product model instance

Returns:
Mage_Catalog_Model_Product

Definition at line 49 of file Websites.php.

00050     {
00051         return Mage::registry('product');
00052     }

getProductId (  ) 

Definition at line 59 of file Websites.php.

00060     {
00061         return $this->getProduct()->getId();
00062     }

getStoreId (  ) 

Reimplemented from Mage_Adminhtml_Block_Store_Switcher.

Definition at line 54 of file Websites.php.

00055     {
00056         return $this->getProduct()->getStoreId();
00057     }

getStoreName ( storeId  ) 

Definition at line 84 of file Websites.php.

00085     {
00086         return Mage::app()->getStore($storeId)->getName();
00087     }

getWebsites (  ) 

Get websites

Returns:
array

Reimplemented from Mage_Adminhtml_Block_Store_Switcher.

Definition at line 64 of file Websites.php.

00065     {
00066         return $this->getProduct()->getWebsiteIds();
00067     }

hasWebsite ( websiteId  ) 

Definition at line 69 of file Websites.php.

00070     {
00071         return in_array($websiteId, $this->getProduct()->getWebsiteIds());
00072     }

isReadonly (  ) 

Check websites block is readonly

Returns:
boolean

Definition at line 79 of file Websites.php.

00080     {
00081         return $this->getProduct()->getWebsitesReadonly();
00082     }


Member Data Documentation

$_storeFromHtml [protected]

Definition at line 36 of file Websites.php.


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

Generated on Sat Jul 4 17:22:46 2009 for Magento by  doxygen 1.5.8