Public Member Functions | |
__construct () | |
getProduct () | |
getStoreId () | |
getProductId () | |
getWebsites () | |
hasWebsite ($websiteId) | |
isReadonly () | |
getStoreName ($storeId) | |
getChooseFromStoreHtml ($storeTo) | |
Protected Attributes | |
$_storeFromHtml |
Definition at line 34 of file Websites.php.
__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 }
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=" ' . $_group->getName() . '">'; 00101 foreach ($this->getStoreCollection($_group) as $_store) { 00102 $this->_storeFromHtml .= '<option value="' . $_store->getId() . '"> ' . $_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
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
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
Definition at line 79 of file Websites.php.
00080 { 00081 return $this->getProduct()->getWebsitesReadonly(); 00082 }
$_storeFromHtml [protected] |
Definition at line 36 of file Websites.php.