/** * We're never creating leave directly, so die * if there's no associated user * * @param Leave $model */ public function editAction($model = null) { if (!(int) $this->_getParam('id')) { throw new Exception("Cannot create new Leave details"); } parent::editAction($model); }
public function editAction() { if (Zend_Auth::getInstance()->getIdentity()->role != 'admin') { $this->_forms['edit']->removeElement('path'); } $id = $this->_request->getParam('id'); $page = $this->_modelMapper->find($id, new Pages_Model_Pages()); if (is_null($page)) { $this->_redirector->gotoSimpleAndExit('index'); } if ($this->_request->getParam('dataPage')) { $dataPage = $this->_request->getParam('dataPage'); $page->setOptions($dataPage); $this->setUploadImage($page); $markdown = $dataPage['contentMarkdown']; $context_html = Michelf\MarkdownExtra::defaultTransform($markdown); $page->setContentHtml($context_html); $this->_modelMapper->save($page); $this->_redirector->gotoUrlAndExit($this->_request->getParam('currentUrl')); } parent::editAction(); $config = array(Zend_Navigation_Page_Mvc::factory(array('label' => 'На сайт', 'uri' => $page->getPath() != 'home' ? '/' . $page->getPath() . '/' : '/'))); $containerNav = new Zend_Navigation($config); $this->view->container_nav = $containerNav; }
public function editAction() { if ($this->_request->getParam('dataPage')) { $dataPage = $this->_request->getParam('dataPage'); $id = $this->_request->getParam('id'); $item = $this->_modelMapper->find($id, $this->_model); $item->setOptions($dataPage); $category = $this->_modelCategoriesMapper->find($item->getCategoryId(), new Pipeline_Model_PipelineCategories()); $fullPath = $category ? $category->getPath() . '/' . $item->getPath() : $item->getPath(); $item->setFullPath($fullPath); $this->setUploadImage($item); $markdown = $dataPage['contentMarkdown']; $context_html = Michelf\MarkdownExtra::defaultTransform($markdown); $item->setContentHtml($context_html); $this->_modelMapper->save($item); $this->_redirector->gotoUrlAndExit('/pipeline/' . $item->getFullPath()); } parent::editAction(); $form = $this->_forms['edit']; $imageTableElement = $form->getElement('imageTable'); $imageTablePrepend = '<button type="button" class="btn btn-default" id="imageTableLoadBtn"><span class="glyphicon glyphicon-save"></span></button>'; $imageTableValue = $imageTableElement->getValue(); if (!is_null($imageTableValue)) { $imageTablePrepend .= '<a href="' . $imageTableValue . '" class="btn btn-default" target="_blank"><span class="glyphicon glyphicon-eye-open"></span></a>'; //$imageTablePrepend .= '<button type="button" class="btn btn-default"><span class="glyphicon glyphicon-trash"></span></button>'; } $imageTableElement->setAttrib('prepend_btn', $imageTablePrepend); $this->setViewPipelineProperties(); }
public function editAction() { if ($this->_request->getParam('dataPage')) { $dataPage = $this->_request->getParam('dataPage'); $id = $this->_request->getParam('id'); $categories = $this->_modelMapper->find($id, $this->_model); $categories->setOptions($dataPage); $this->setUploadImage($categories); $this->_modelMapper->save($categories); $this->getRedirector()->gotoUrlAndExit('/media/' . $categories->getPath()); } parent::editAction(); }
public function editAction() { if ($this->_request->getParam('dataPage')) { $dataPage = $this->_request->getParam('dataPage'); $id = $this->_request->getParam('id'); $categories = $this->_modelMapper->find($id, $this->_model); $categories->setOptions($dataPage); $this->setUploadImage($categories); $markdown = $dataPage['contentMarkdown']; $context_html = Michelf\MarkdownExtra::defaultTransform($markdown); $categories->setContentHtml($context_html); $this->_modelMapper->save($categories); $this->_redirector->gotoUrlAndExit('/manufacture/' . $categories->getPath()); } parent::editAction(); }
public function editAction() { if ($this->_request->getParam('dataPage')) { $dataPage = $this->_request->getParam('dataPage'); $id = $this->_request->getParam('id'); $item = $this->_modelMapper->find($id, $this->_model); $item->setOptions($dataPage); $categories = $this->_modelCategoriesMapper->find($item->getCategoryId(), new Media_Model_MediaCategories()); $fullPath = $categories->getPath() . '/' . $item->getPath(); $item->setFullPath($fullPath); $this->setUploadImage($item); $markdown = $dataPage['contentMarkdown']; $context_html = Michelf\MarkdownExtra::defaultTransform($markdown); $item->setContentHtml($context_html); $this->_modelMapper->save($item); $this->_redirector->gotoUrlAndExit('/media/' . $item->getFullPath()); } parent::editAction(); }
public function editAction($model = null) { $this->view->project = $this->projectService->getProject((int) $this->_getParam('projectid')); $this->view->timesheets = $this->projectService->getTimesheets(array('projectid=' => $this->view->project->id)); parent::editAction($model); }