discount = $this->related_object; // $i18n = $this->getContext()->getI18n(); // $this->items = array('stDiscountBackend/edit?id=' . $this->discount->getPrimaryKey() => $i18n->__('_edit', null, 'stDiscountBackend')); // $this->items["stDiscountBackend/edit?id={$this->discount->getId()}"] = $i18n->__('Edycja', null, 'stDiscountBackend'); // $this->items["stDiscountBackend/userList?discount_id={$this->discount->getId()}"] = $i18n->__('Przypisz klientów', null, 'stDiscountBackend'); // $this->items["stDiscountBackend/productList?discount_id={$this->discount->getId()}"] = $i18n->__('Przypisz produkty', null, 'stDiscountBackend'); // if (!$this->items) // { // return sfView::NONE; // } // $this->processMenuItems(); // $this->selected_item_path = $this->getUser()->getAttribute('selected', false, 'soteshop/component/menu'); $ret = parent::executeEditMenu(); if ($this->discount->getType() == 'O') { unset($this->items["stDiscountBackend/productList?discount_id={$this->discount->getId()}"]); } return $ret; } }