getRestParams(); if (count($params) == 1 && is_numeric($params[0])) { $this->_getDataObj()->setProductId($params[0]); if ($this->_getDataObj()->getProductData() !== null) { $header = 'Manage Images for "' . $this->_getDataObj()->getProductData('title') . '"'; $this->_doc->setHeader($header); if (!Qs_Request::getRequestValue('action')) { $this->_getDataObj()->addFilter(array('productId' => $params[0])); } } else { $this->_doc->display404(); } } else { $this->_doc->display404(); } return parent::exec(); } protected function _initFromForm(Qs_Form $form) { $data = $form->getValues(); $data['productId'] = $this->_getDataObj()->getProductData('id'); $this->_getDataObj()->initFromForm($data); return $this; } protected function _getDefaultLinks() { $links = parent::_getDefaultLinks(); $fullAlias = Qs_SiteMap::findFirst(null, array('type' => 'ECommerce_Product_Admin_'), null, 'fullAlias'); $backUrl = $this->_getBackUrl($fullAlias); if ($backUrl == $this->url()) { $backUrl = Qs_Constant::get('BASE_URL') . '/' . $fullAlias . '?query=' . rawurlencode($this->_getDataObj()->getProductData('title')); } $link = array('title' => 'Manage Products', 'url' => $backUrl); array_unshift($links, $link); return $links; } }