public function actionEdit($id, $redirectUrl = null) { $productCategory = ProductCategory::getById(intval($id)); $breadcrumbLinks = static::getDetailsAndEditBreadcrumbLinks(); $breadcrumbLinks[] = StringUtil::getChoppedStringContent(strval($productCategory), 25); $view = new ProductCategoriesPageView(ProductDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $this->makeEditAndDetailsView($this->attemptToSaveModelFromPost($productCategory, $redirectUrl), 'Edit'), $breadcrumbLinks, 'ProductBreadCrumbView')); echo $view->render(); }
public function actionEdit($id, $redirectUrl = null) { $product = Product::getById(intval($id)); ControllerSecurityUtil::resolveAccessCanCurrentUserWriteModel($product); $breadcrumbLinks = array(StringUtil::getChoppedStringContent(strval($product), 25)); $view = new ProductsPageView(ProductDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $this->makeEditAndDetailsView($this->attemptToSaveModelFromPost($product, $redirectUrl), 'Edit'), $breadcrumbLinks, 'ProductBreadCrumbView')); echo $view->render(); }
/** * Resolve and render zero model view for product template, products * and product categories * @param Object $messageView * @return string containing the zero model view */ protected function resolveAndRenderView(View $messageView) { $gridViewId = 'notUsed'; $pageVar = 'notUsed'; $modelClassName = $this->modelClassName; $listModel = new $modelClassName(); $actionBarView = new SecuredActionBarForProductsZeroModelView(get_class($this->controller), get_class($this->controller->getModule()), $listModel, $gridViewId, $pageVar, false, $this->activeActionElementType); $pageViewClassName = $this->pageViewClassName; $mixedView = new ActionBarAndZeroModelsYetView($actionBarView, $messageView); $view = new $pageViewClassName(ProductDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this->controller, $mixedView, $this->breadcrumbLinks, 'ProductBreadCrumbView')); echo $view->render(); }