/** * * @param unknown $pageOptions */ protected function iniServices($pageOptions) { $services = array(); if (false !== ($getServices = $pageOptions->getApp('services'))) { foreach ($getServices as $key => $service) { $services[$key] = $this->getServiceLocator()->get($service); } } return $services; }
/** * * @param unknown $pageOptions * @param string $role * @param string $acl */ public function process($pageOptions, $role = null, $acl = null) { $datas = $this->getRequest()->getPost(); $current = $cat = ''; $current = str_replace('_', DS, $datas['currentpath']); if (strlen($current) > 0) { $cat = '/' . $datas['currentpath']; } $redirectUrl = $pageOptions->getApp('settoroute'); if (isset($datas['new-folder']) && strlen($datas['new-folder']) > 1) { $this->worker->setFsCurrent($current); $this->worker->setNewDirectory($datas['new-folder']); $this->worker->mkdir(); $this->flashMessenger()->setNamespace('mcwork')->addSuccessMessage('Successfully created a new directory'); } else { $this->flashMessenger()->setNamespace('mcwork')->addErrorMessage('Error while create a new directory'); } return $this->redirect()->toUrl($redirectUrl . $cat); }
/** * * @param unknown $pageOptions * @param unknown $defaultRole * @param unknown $acl * @return Ambigous <\Zend\Http\Response, \Zend\Stdlib\ResponseInterface>|\Zend\View\Model\ViewModel */ public function process($pageOptions, $role = null, $acl = null) { $category = ''; if (null !== $this->groupIdent) { $category = '/category/' . $this->getGroupIdent(); } $form = $this->getForm(); $form->setInputFilter($form->getInputFilter()); $form->setData($this->getRequest()->getPost()); if ($form->isValid()) { $formDatas = $form->getData(); try { if (method_exists($this->worker, 'setIdentity')) { $this->worker->setIdentity($this->getIdentity()); } $msg = $this->worker->save($form->getData(), $this->worker->fetchPopulateValues($this->getIdent(), false)); return $this->redirect()->toUrl($pageOptions->getApp('settoroute') . $category); } catch (\Exception $e) { exit($e->getMessage()); } } else { $this->backendlayout($pageOptions, $this->getIdentity(), $role, $acl, $this->layout(), $this->getServiceLocator()); $services = array(); return $this->buildView(array('acl' => $acl, 'role' => $role, 'resource' => $this->getServiceLocator()->get('mcwork_acl_resource'), 'current' => $pageOptions->getActive(), 'services' => $services, 'identity' => $this->getIdentity(), 'usergroups' => $this->getServiceLocator()->get('contentinum_acl_usrgrp'), 'content' => $pageOptions->getPageContent(), 'form' => $form, 'category' => $this->getGroupIdent(), 'paramter' => $pageOptions->getParams(), 'appparameter' => $pageOptions->getApp('appparameter'), 'xmlHttpRequest' => $this->getXmlHttpRequest()), $pageOptions); } }