Exemplo n.º 1
0
 public function getHeaderHtml()
 {
     //------------------------------
     $collection = Mage::getModel('M2ePro/Listing')->getCollection();
     $collection->addFieldToFilter('component_mode', Ess_M2ePro_Helper_Component_Ebay::NICK);
     $collection->addFieldToFilter('id', array('neq' => $this->listing->getId()));
     $collection->setPageSize(200);
     $collection->setOrder('title', 'ASC');
     $items = array();
     foreach ($collection->getItems() as $item) {
         $items[] = array('label' => $item->getTitle(), 'url' => $this->getUrl('*/*/view', array('id' => $item->getId())));
     }
     //------------------------------
     if (count($items) == 0) {
         return parent::getHeaderHtml();
     }
     //------------------------------
     $data = array('target_css_class' => 'listing-profile-title', 'style' => 'max-height: 120px; overflow: auto; width: 200px;', 'items' => $items);
     $dropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
     $dropDownBlock->setData($data);
     //------------------------------
     return parent::getHeaderHtml() . $dropDownBlock->toHtml();
 }