示例#1
0
 protected function _prepareLayout()
 {
     $this->parent = parent::_prepareLayout();
     if (Mage::app()->getRequest()->getParam('id') !== null) {
         $this->addTab('productvideo', array('label' => Mage::helper('catalog')->__('Product Videos'), 'class' => 'ajax', 'url' => $this->getUrl('iwd_productvideo/adminhtml_productvideo/videogrid', array('_current' => true))));
     }
     return $this->parent;
 }
示例#2
0
 protected function _beforeToHtml()
 {
     if ($this->getProduct()->getTypeId()) {
         $name = Mage::helper('amlabel')->__('Product Labels');
         $this->addTab('general', array('label' => $name, 'content' => $this->getLayout()->createBlock('amlabel/adminhtml_catalog_product_edit_labels')->setTitle($name)->toHtml()));
     }
     return parent::_beforeToHtml();
 }
示例#3
0
 protected function _prepareLayout()
 {
     $return = parent::_prepareLayout();
     $contents = $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_vaf');
     $contents = $contents->toHtml();
     $this->addTab('vaf', array('label' => Mage::helper('catalog')->__('Vehicle Fits'), 'content' => $contents));
     return $return;
 }
示例#4
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $_product = Mage::registry('product');
     if ($_product->getId()) {
         $this->addTab('customerprices', array('label' => Mage::helper('catalog')->__('Prices per Customer'), 'content' => $this->getLayout()->createBlock('customerprices/Adminhtml_Catalog_Product_Tab_CustomerPrices')->toHtml()));
     }
 }
示例#5
0
文件: Tabs.php 项目: enjoy2000/gemz
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $_session = Mage::getSingleton('core/session');
     $_session->setIsBlockInserted(false);
     $_product = Mage::registry('product');
     if ($_product->getId() && $_product->getTypeId() == 'giftcards' && $_product->getAttributeText('wts_gc_pregenerate') == 'Yes') {
         $this->addTab('pregeneratedcards', array('label' => Mage::helper('catalog')->__('Pre-Generated Codes'), 'url' => $this->getUrl('giftcards/adminhtml_product/pregenerated', array('_current' => true)), 'class' => 'ajax'));
     }
 }
示例#6
0
 protected function _prepareLayout()
 {
     $parent = parent::_prepareLayout();
     //if (!Mage::helper('giftcard')->isActive())
     //    return $parent;
     $product = $this->getProduct();
     if ($product->getTypeId() == MT_Giftcard_Model_Catalog_Product_Type::TYPE_GIFTCARD_PRODUCT) {
         $this->addTab('giftcard_series_assign', array('label' => Mage::helper('giftcard')->__('Assign Gift Cards Series'), 'url' => $this->getUrl('*/*/giftCardSeries', array('_current' => true)), 'class' => 'ajax'));
     }
     return $this;
 }
示例#7
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     if ($this->getProduct()->getId()) {
         $TaskCount = 0;
         $gridBlock = $this->getLayout()->createBlock('Organizer/Task_Grid')->setEntityType('product')->setEntityId($this->getProduct()->getId())->setShowTarget(false)->setShowEntity(false)->setTemplate('Organizer/Task/List.phtml');
         $content = $gridBlock->toHtml();
         $TaskCount = $gridBlock->getCollection()->getSize();
         $this->addTab('product_organizer', array('label' => Mage::helper('Organizer')->__('Organizer') . ' (' . $TaskCount . ')', 'title' => Mage::helper('Organizer')->__('Organizer') . ' (' . $TaskCount . ')', 'content' => $content));
     }
     return $this;
 }
示例#8
0
 /**
  * override the _prepareLayout() method to include teh accessories tab
  * @access protected
  * @return Anais_Accessories_Block_Adminhtml_Catalog_Product_Edit_Tabs
  * @author Marius Strajeru <*****@*****.**>
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $product = $this->getProduct();
     if (!($setId = $product->getAttributeSetId())) {
         $setId = $this->getRequest()->getParam('set', null);
     }
     if ($setId) {
         $this->addTab('accessories', array('label' => Mage::helper('accessories')->__('Accessories'), 'url' => $this->getUrl('*/*/accessories', array('_current' => true)), 'class' => 'ajax'));
     }
     return $this;
 }
 protected function _prepareLayout()
 {
     $product = $this->getProduct();
     if (!($setId = $product->getAttributeSetId())) {
         $return = parent::_prepareLayout();
     }
     if ($setId) {
         $return = parent::_prepareLayout();
         $this->addTab('niveus_youtube_videos', array('label' => Mage::helper('productvideo')->__('Videos'), 'url' => $this->getUrl('productvideo_admin/adminhtml_videos', array('_current' => true)), 'class' => 'ajax', 'after' => 'custom_option'));
         return $return;
     }
     return false;
 }
示例#10
0
 /**
  * Add tab under Product Information section
  * Tab will not be added of product type is 'Downloadable'
  * Tab name : 'Product Files'
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     if (Mage::registry('current_product')->getTypeID() !== Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE) {
         $product = $this->getProduct();
         if (!($setId = $product->getAttributeSetId())) {
             $setId = $this->getRequest()->getParam('set', null);
         }
         if ($setId) {
             $this->addTab('staempfli_productattachment', array('label' => Mage::helper('staempfli_productattachment')->__('Product Files'), 'content' => $this->getLayout()->createBlock('staempfli_productattachment/adminhtml_catalog_product_edit_tab_list')->_toHtml()));
         }
     }
 }
示例#11
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $product = $this->getProduct();
     if (!($setId = $product->getAttributeSetId())) {
         $setId = $this->getRequest()->getParam('set', null);
     }
     if ($setId) {
         //add logic to check if vendor module on and have any vendor information
         $this->addTab('vendor_information', array('label' => Mage::helper('vendor')->__('Vendor Information'), 'content' => $this->getLayout()->createBlock('vendor/adminhtml_catalog_product_edit_tab_vendor')->toHtml(), 'active' => false));
     }
     //return parent::_prepareLayout();
 }
示例#12
0
 public function addTab($tabId, $tab)
 {
     if (isset($tab['insertAfter'])) {
         // Remove and remember every tab after the specified key
         $afterTabs = array();
         $afterKeyFound = false;
         foreach ($this->_tabs as $key => $value) {
             if ($afterKeyFound) {
                 $afterTabs[$key] = $value;
                 unset($this->_tabs[$key]);
             }
             if ($key == $tab['insertAfter']) {
                 $afterKeyFound = true;
             }
         }
     }
     parent::addTab($tabId, $tab);
     if (isset($tab['insertAfter'])) {
         // Now that we've added our new tab, add the remembered tabs back into the internal array
         $this->_tabs += $afterTabs;
     }
 }
示例#13
0
 protected function _prepareLayout()
 {
     $params = $this->getRequest()->getParams();
     if ($params['id']) {
         $product = false;
         //Mage::getModel('catalog/product')->load($params['id']);
         if ($product) {
             switch ($product->getTypeId()) {
                 case 'simple':
                 case 'virtual':
                 case 'downloadable':
                     break;
                 case 'bundle':
                     $block = $this->getLayout()->createBlock('rewardpoints/adminhtml_sellproducts_edit_tab_grid');
                     $block->setSingle(true);
                     $block->setProductId($product->getId());
                     $this->addTabAfter('sell_points', array('label' => Mage::helper('catalog')->__('Sell in Points'), 'content' => $block->toHtml()));
                 case 'grouped':
                     break;
             }
         }
     }
     parent::_prepareLayout();
 }
示例#14
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $this->addTab('bundle_items', array('label' => Mage::helper('bundle')->__('Bundle Items'), 'url' => $this->getUrl('*/*/bundles', array('_current' => true)), 'class' => 'ajax'));
     $this->bindShadowTabs('bundle_items', 'customer_options');
 }
示例#15
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $this->addTab('super', array('label' => Mage::helper('catalog')->__('Associated Products'), 'url' => $this->getUrl('*/*/superGroup', array('_current' => true)), 'class' => 'ajax'));
 }
 protected function _prepareLayout()
 {
     $return = parent::_prepareLayout();
     $this->addTab('rw_youtube_videos', array('label' => Mage::helper('productvideo')->__('Videos'), 'url' => $this->getUrl('productvideo_admin/adminhtml_videos', array('_current' => true)), 'class' => 'ajax', 'after' => 'inventory'));
     return $return;
 }
示例#17
0
 protected function _prepareLayout()
 {
     //return
     parent::_prepareLayout();
     $l_aAttributesToBeRemoved = array('sku', 'weight', 'tax_class_id', 'url_key', 'visibility', 'news_from_date', 'news_to_date');
     $l_aBypassAttributesRemoval = array('status', 'visibility', 'publication_details', 'purchase_product', 'online_catalogue');
     $product = $this->getProduct();
     if (!($setId = $product->getAttributeSetId())) {
         $setId = $this->getRequest()->getParam('set', null);
     }
     if ($setId) {
         $groupCollection = Mage::getResourceModel('eav/entity_attribute_group_collection')->setAttributeSetFilter($setId)->setSortOrder()->load();
         foreach ($groupCollection as $group) {
             if ('General' !== $group->getAttributeGroupName()) {
                 continue;
             }
             $attributes = $product->getAttributes($group->getId(), true);
             // do not add groups without attributes
             foreach ($attributes as $key => $attribute) {
                 //pr($attribute->getName());
                 if (!$attribute->getIsVisible()) {
                     unset($attributes[$key]);
                 }
                 if (!$attribute->getIsRequired() && !in_array($attribute->getName(), $l_aBypassAttributesRemoval)) {
                     unset($attributes[$key]);
                 } else {
                     //pr($attribute->getName());
                 }
             }
             //die();
             //pr(array_keys($attributes));die();
             if (count($attributes) == 0) {
                 continue;
             }
             //pr($this->getAttributeTabBlock());
             $this->addTab('group_' . $group->getId(), array('label' => Mage::helper('catalog')->__($group->getAttributeGroupName()), 'content' => $this->_translateHtml($this->getLayout()->createBlock($this->getAttributeTabBlock(), 'adminhtml.catalog.product.edit.tab.attributes')->setGroup($group)->setGroupAttributes($attributes)->setProduct($product)->setCategories($this->getCategories())->setTemplate('reea_entries/formpdf.phtml')->toHtml())));
             /*
             
             pr(array_keys($group->getData()));
             pr($group->getAttributeGroupName());
             pr('group_'.$group->getId());
             pr(get_class($group));
             */
         }
     }
     //die();
     $this->removeTab('categories');
     $this->removeTab('related');
     $this->removeTab('upsell');
     $this->removeTab('crosssell');
     if (Mage::helper('core')->isModuleEnabled('Mage_CatalogInventory')) {
         $this->removeTab('inventory');
     }
     if (!Mage::app()->isSingleStoreMode()) {
         $this->removeTab('websites');
     }
     if (!$product->isGrouped()) {
         $this->removeTab('customer_options');
     }
     if ($this->getRequest()->getParam('id', false)) {
         if (Mage::helper('catalog')->isModuleEnabled('Mage_Review')) {
             if (Mage::getSingleton('admin/session')->isAllowed('admin/catalog/reviews_ratings')) {
                 $this->removeTab('reviews');
             }
         }
         if (Mage::helper('catalog')->isModuleEnabled('Mage_Tag')) {
             if (Mage::getSingleton('admin/session')->isAllowed('admin/catalog/tag')) {
                 $this->removeTab('tags');
                 $this->removeTab('customers_tags');
             }
         }
     }
     return $this;
 }
示例#18
0
 protected function _prepareLayout()
 {
     $this->parent = parent::_prepareLayout();
     $this->addTab('img360', array('label' => Mage::helper('catalog')->__('360&ordm; Gallery'), 'content' => $this->_translateHtml($this->getLayout()->createBlock('rotate360/adminhtml_tabs_img360')->toHtml())));
     return $this->parent;
 }
示例#19
0
 protected function _prepareLayout()
 {
     //return
     parent::_prepareLayout();
     $l_aAttributesToBeRemoved = array('sku', 'weight', 'tax_class_id', 'url_key', 'visibility', 'news_from_date', 'news_to_date');
     $l_aBypassAttributesRemoval = array('status', 'visibility', 'description', 'entry_postage', 'entry_postage2', 'entry_custom_postage', 'entry_work_in_progress', 'entry_batch_id', 'entry_date', 'entry_mapmaker', 'entry_mapmaker_from_year', 'entry_mapmaker_to_year', 'entry_artist', 'entry_artist_from_year', 'entry_artist_to_year', 'entry_author', 'entry_author_from_year', 'entry_author_to_year', 'entry_engraver', 'entry_engraver_from_year', 'entry_engraver_to_year', 'entry_condition', 'entry_technique', 'entry_unmatted', 'entry_matted', 'entry_framed', 'entry_image_size_width', 'entry_image_size_height', 'entry_frame_size_width', 'entry_frame_size_height', 'entry_plate_mark_size_width', 'entry_plate_mark_size_height', 'entry_paper_size_width', 'entry_paper_size_height', 'entry_catalogue_number', 'entry_on_hold', 'entry_on_hold_client_id', 'entry_on_hold_client_details', 'entry_is_sold', 'entry_hide', 'entry_is_featured', 'meta_title', 'meta_description', 'meta_keyword', 'frame_setup', 'short_description', 'printed_feature', 'product_location', 'product_lpk', 'product_cost_code', 'stock_number', 'product_location', 'entry_date2', 'sku', 'width', 'height', 'length', 'weight');
     $product = $this->getProduct();
     if (!($setId = $product->getAttributeSetId())) {
         $setId = $this->getRequest()->getParam('set', null);
     }
     if ($setId) {
         $groupCollection = Mage::getResourceModel('eav/entity_attribute_group_collection')->setAttributeSetFilter($setId)->setSortOrder()->load();
         foreach ($groupCollection as $group) {
             if ('General' !== $group->getAttributeGroupName()) {
                 continue;
             }
             $attributes = $product->getAttributes($group->getId(), true);
             // do not add groups without attributes
             foreach ($attributes as $key => $attribute) {
                 //pr($attribute->getName());
                 if (!$attribute->getIsVisible()) {
                     unset($attributes[$key]);
                 }
                 if (!$attribute->getIsRequired() && !in_array($attribute->getName(), $l_aBypassAttributesRemoval)) {
                     unset($attributes[$key]);
                 } else {
                     //pr($attribute->getName());
                 }
                 if (in_array($attribute->getName(), $l_aAttributesToBeRemoved)) {
                     //unset($attributes[$key]);
                 }
             }
             //die();
             if (count($attributes) == 0) {
                 continue;
             }
             //pr($this->getAttributeTabBlock());
             $this->addTab('group_' . $group->getId(), array('label' => Mage::helper('catalog')->__($group->getAttributeGroupName()), 'content' => $this->_translateHtml($this->getLayout()->createBlock($this->getAttributeTabBlock(), 'adminhtml.catalog.product.edit.tab.attributes')->setGroup($group)->setGroupAttributes($attributes)->setProduct($product)->setCategories($this->getCategories())->setTemplate('reea_entries/form.phtml')->toHtml())));
             /*
             
             pr(array_keys($group->getData()));
             pr($group->getAttributeGroupName());
             pr('group_'.$group->getId());
             pr(get_class($group));
             */
         }
     }
     //die();
     $this->removeTab('categories');
     $this->removeTab('related');
     $this->removeTab('upsell');
     $this->removeTab('crosssell');
     if (Mage::helper('core')->isModuleEnabled('Mage_CatalogInventory')) {
         $this->removeTab('inventory');
     }
     if (!Mage::app()->isSingleStoreMode()) {
         $this->removeTab('websites');
     }
     if (!$product->isGrouped()) {
         $this->removeTab('customer_options');
     }
     if ($this->getRequest()->getParam('id', false)) {
         if (Mage::helper('catalog')->isModuleEnabled('Mage_Review')) {
             if (Mage::getSingleton('admin/session')->isAllowed('admin/catalog/reviews_ratings')) {
                 $this->removeTab('reviews');
             }
         }
         if (Mage::helper('catalog')->isModuleEnabled('Mage_Tag')) {
             if (Mage::getSingleton('admin/session')->isAllowed('admin/catalog/tag')) {
                 $this->removeTab('tags');
                 $this->removeTab('customers_tags');
             }
         }
     }
     return $this;
 }
示例#20
0
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $this->addTab('demo', array('label' => Mage::helper('catalog')->__('Demos'), 'content' => 'aaaaaaaa'));
 }
示例#21
0
 protected function _prepareLayout()
 {
     $product = Mage::registry('product');
     $product = $this->getProduct();
     if (!($setId = $product->getAttributeSetId())) {
         $setId = $this->getRequest()->getParam('set', null);
     }
     if ($setId) {
         $groupCollection = Mage::getResourceModel('eav/entity_attribute_group_collection')->setAttributeSetFilter($setId)->setSortOrder()->load();
         foreach ($groupCollection as $group) {
             if ($group->getData('attribute_group_name') != "Recurring Profile" && $group->getData('attribute_group_name') != "Meta Information" && $group->getData('attribute_group_name') != "Gift Options" && $group->getData('attribute_group_name') != "Design") {
                 $attributes = $product->getAttributes($group->getId(), true);
                 // do not add groups without attributes
                 foreach ($attributes as $key => $attribute) {
                     if (!$attribute->getIsVisible()) {
                         unset($attributes[$key]);
                     }
                 }
                 if (count($attributes) == 0) {
                     continue;
                 }
                 $this->addTab('group_' . $group->getId(), array('label' => Mage::helper('catalog')->__($group->getAttributeGroupName()), 'content' => $this->_translateHtml($this->getLayout()->createBlock('marketplace/adminhtml_catalog_product_edit_tab_attributes', 'marketplace.adminhtml.catalog.product.edit.tab.attributes')->setGroup($group)->setGroupAttributes($attributes)->toHtml())));
             }
         }
         if (Mage::helper('core')->isModuleEnabled('Mage_CatalogInventory')) {
             $this->addTab('inventory', array('label' => Mage::helper('catalog')->__('Inventory'), 'content' => $this->_translateHtml($this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_inventory')->toHtml())));
         }
         /**
          * Don't display website tab for single mode
          */
         if (!Mage::app()->isSingleStoreMode()) {
             $this->addTab('websites', array('label' => Mage::helper('catalog')->__('Websites'), 'content' => $this->_translateHtml($this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_websites')->toHtml())));
         }
         $this->addTab('categories', array('label' => Mage::helper('catalog')->__('Categories'), 'url' => $this->getUrl('*/*/categories', array('_current' => true)), 'class' => 'ajax'));
         // $this->addTab('related', array(
         //     'label'     => Mage::helper('catalog')->__('Related Products'),
         //     'url'       => $this->getUrl('*/*/related', array('_current' => true)),
         //     'class'     => 'ajax',
         // ));
         // $this->addTab('upsell', array(
         //     'label'     => Mage::helper('catalog')->__('Up-sells'),
         //     'url'       => $this->getUrl('*/*/upsell', array('_current' => true)),
         //     'class'     => 'ajax',
         // ));
         // $this->addTab('crosssell', array(
         //     'label'     => Mage::helper('catalog')->__('Cross-sells'),
         //     'url'       => $this->getUrl('*/*/crosssell', array('_current' => true)),
         //     'class'     => 'ajax',
         // ));
         $storeId = 0;
         if ($this->getRequest()->getParam('store')) {
             $storeId = Mage::app()->getStore($this->getRequest()->getParam('store'))->getId();
         }
         $alertPriceAllow = Mage::getStoreConfig('catalog/productalert/allow_price');
         $alertStockAllow = Mage::getStoreConfig('catalog/productalert/allow_stock');
         if (($alertPriceAllow || $alertStockAllow) && !$product->isGrouped()) {
             $this->addTab('productalert', array('label' => Mage::helper('catalog')->__('Product Alerts'), 'content' => $this->_translateHtml($this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_alerts', 'admin.alerts.products')->toHtml())));
         }
         if ($this->getRequest()->getParam('id', false)) {
             if (Mage::helper('catalog')->isModuleEnabled('Mage_Review')) {
                 if (Mage::getSingleton('admin/session')->isAllowed('admin/catalog/reviews_ratings')) {
                     $this->addTab('reviews', array('label' => Mage::helper('catalog')->__('Product Reviews'), 'url' => $this->getUrl('*/*/reviews', array('_current' => true)), 'class' => 'ajax'));
                 }
             }
             if (Mage::helper('catalog')->isModuleEnabled('Mage_Tag')) {
                 if (Mage::getSingleton('admin/session')->isAllowed('admin/catalog/tag')) {
                     $this->addTab('tags', array('label' => Mage::helper('catalog')->__('Product Tags'), 'url' => $this->getUrl('*/*/tagGrid', array('_current' => true)), 'class' => 'ajax'));
                     $this->addTab('customers_tags', array('label' => Mage::helper('catalog')->__('Customers Tagged Product'), 'url' => $this->getUrl('*/*/tagCustomerGrid', array('_current' => true)), 'class' => 'ajax'));
                 }
             }
         }
         // /**
         //  * Do not change this tab id
         //  * @see Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs_Configurable
         //  * @see Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tabs
         //  */
         // if (!$product->isGrouped()) {
         //     $this->addTab('customer_options', array(
         //         'label' => Mage::helper('catalog')->__('Custom Options'),
         //         'url'   => $this->getUrl('*/*/options', array('_current' => true)),
         //         'class' => 'ajax',
         //     ));
         // }
     } else {
         $this->addTab('set', array('label' => Mage::helper('catalog')->__('Settings'), 'content' => $this->_translateHtml($this->getLayout()->createBlock('marketplace/adminhtml_catalog_product_edit_tab_settings')->toHtml()), 'active' => true));
     }
     return parent::_beforeToHtml();
 }