/** * addAction * @author Daniel Rotter <*****@*****.**> * @version 1.0 */ public function addAction() { $this->core->logger->debug('cms->controllers->WidgetController->addAction()'); try { $this->getForm($this->core->sysConfig->generic->actions->add); $this->addWidgetSpecificFormElements(); if ($this->objRequest->isPost() && $this->objRequest->isXmlHttpRequest()) { $arrFormData = $this->objRequest->getPost(); $this->objForm->Setup()->setFieldValues($arrFormData); $this->objForm->prepareForm(); if ($this->objForm->isValid($arrFormData)) { $this->objForm->setAction('/zoolu/cms/widget/edit'); $intWidgetId = $this->objForm->saveFormData(); $this->objForm->Setup()->setElementId($intWidgetId); $this->objForm->Setup()->setActionType($this->core->sysConfig->generic->actions->edit); $this->objForm->getElement('id')->setValue($intWidgetId); $this->view->assign('blnShowFormAlert', true); } else { $this->objForm->setAction('zoolu/cms/widget/add'); $this->view->assign('blnShowFormAlert', false); } } else { $this->objForm->prepareForm(); } $this->objForm->updateSpecialFieldValues(); $this->view->formtitle = $this->objForm->Setup()->getFormTitle(); $this->setViewMetaInfos(); $this->view->form = $this->objForm; $this->renderScript('page/form.phtml'); } catch (Exception $exc) { $this->core->logger->err($exc); } }
/** * addAction * @author Thomas Schedler <*****@*****.**> * @version 1.0 */ public function addAction() { $this->core->logger->debug('global->controllers->ElementController->addAction()'); try { $this->getForm($this->core->sysConfig->generic->actions->add); $this->addGlobalSpecificFormElements(); if ($this->objRequest->isPost() && $this->objRequest->isXmlHttpRequest()) { $arrFormData = $this->objRequest->getPost(); $this->objForm->Setup()->setFieldValues($arrFormData); /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); if ($this->objForm->isValid($arrFormData)) { /** * set action */ $this->objForm->setAction('/zoolu/global/element/edit'); $intGlobalId = $this->objForm->saveFormData(); $this->objForm->Setup()->setElementId($intGlobalId); $this->objForm->Setup()->setActionType($this->core->sysConfig->generic->actions->edit); $this->objForm->getElement('id')->setValue($intGlobalId); $this->objForm->getElement('linkId')->setValue($this->objForm->Setup()->getElementLinkId()); $this->view->assign('blnShowFormAlert', true); } else { /** * set action */ $this->objForm->setAction('/zoolu/global/element/add'); $this->view->assign('blnShowFormAlert', false); } } else { /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); } /** * update special field values */ $this->objForm->updateSpecificFieldValues(); /** * get form title */ $this->view->formtitle = $this->objForm->Setup()->getFormTitle(); /** * output of metainformation to hidden div */ $this->setViewMetaInfos(); $this->view->form = $this->objForm; $this->renderScript('element/form.phtml'); } catch (Exception $exc) { $this->core->logger->err($exc); exit; } }
/** * addAction * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function addAction() { $this->core->logger->debug('core->controllers->FolderController->addAction()'); $this->getForm($this->core->sysConfig->generic->actions->add); $this->addFolderSpecificFormElements(); /** * set action */ $this->objForm->setAction('/zoolu/core/folder/add'); if ($this->objRequest->isPost() && $this->objRequest->isXmlHttpRequest()) { $arrFormData = $this->objRequest->getPost(); $this->objForm->Setup()->setFieldValues($arrFormData); /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); if ($this->objForm->isValid($arrFormData)) { /** * set action */ $this->objForm->setAction('/zoolu/core/folder/edit'); $intFolderId = $this->objForm->saveFormData(); $this->objForm->Setup()->setElementId($intFolderId); $this->objForm->getElement('id')->setValue($intFolderId); $this->objForm->Setup()->setActionType($this->core->sysConfig->generic->actions->edit); $this->view->assign('blnShowFormAlert', true); $arrArgs = array('ParentId' => $intFolderId, 'LanguageId' => $this->objRequest->getParam('languageId', $this->core->intZooluLanguageId), 'GenericSetup' => $this->objForm->Setup()); if ($this->objCommandChain->runCommand('addFolderStartElement', $arrArgs)) { $this->view->assign('selectNavigationItemNow', true); $this->view->assign('itemId', 'folder' . $intFolderId); } } else { $this->view->assign('blnShowFormAlert', false); } } else { /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); } /** * get form title */ $this->view->formtitle = $this->objForm->Setup()->getFormTitle(); /** * output of metainformation to hidden div */ $this->setViewMetaInfos(); $this->view->form = $this->objForm; $this->renderScript('folder/form.phtml'); }
/** * addAction * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function addAction() { $this->core->logger->debug('properties->controllers->CategoryController->addAction()'); $this->getForm($this->core->sysConfig->generic->actions->add); /** * set action */ $this->objForm->setAction('/zoolu/properties/category/add'); if ($this->objRequest->isPost() && $this->objRequest->isXmlHttpRequest()) { $arrFormData = $this->objRequest->getPost(); $this->objForm->Setup()->setFieldValues($arrFormData); /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); if ($this->objForm->isValid($arrFormData)) { /** * set action */ $this->objForm->setAction('/zoolu/properties/category/edit'); /** * set rootlevelid and parentid for category creation */ $this->objForm->Setup()->setRootLevelId($this->objForm->getElement('rootLevelId')->getValue()); $this->objForm->Setup()->setParentId($this->objForm->getElement('parentId')->getValue()); $this->objForm->Setup()->setElementTypeId($this->objForm->getElement('categoryTypeId')->getValue()); $intCategoryId = $this->objForm->saveFormData(); $this->objForm->getElement('id')->setValue($intCategoryId); $this->objForm->Setup()->setActionType($this->core->sysConfig->generic->actions->edit); $this->view->blnShowFormAlert = true; } } else { /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); } /** * get form title */ $this->view->formtitle = $this->objForm->Setup()->getFormTitle(); if ($this->objForm->Setup()->getActionType() == $this->core->sysConfig->generic->actions->edit) { $this->view->languageOptions = HtmlOutput::getOptionsOfSQL($this->core, 'SELECT id AS VALUE, languageCode AS DISPLAY FROM languages', $this->objForm->Setup()->getLanguageId()); } $this->view->form = $this->objForm; $this->renderScript('category/form.phtml'); }
/** * addAction * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function addAction() { $this->core->logger->debug('contacts->controllers->MemberController->addAction()'); $this->getForm($this->core->sysConfig->generic->actions->add); /** * set action */ $this->objForm->setAction('/zoolu/contacts/member/add'); if ($this->getRequest()->isPost() && $this->getRequest()->isXmlHttpRequest()) { $arrFormData = $this->getRequest()->getPost(); $this->objForm->Setup()->setFieldValues($arrFormData); /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); if ($this->objForm->isValid($arrFormData)) { /** * set action */ $this->objForm->setAction('/zoolu/contacts/member/edit'); /** * set rootlevelid and parentid for member creation */ $this->objForm->Setup()->setRootLevelId($this->objForm->getElement('rootLevelId')->getValue()); //$this->objForm->Setup()->setParentId($this->objForm->getElement('parentId')->getValue()); $intMemberId = $this->objForm->saveFormData(); $this->objForm->getElement('id')->setValue($intMemberId); $this->view->blnShowFormAlert = true; } } else { /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); } /** * get form title */ $this->view->formtitle = $this->objForm->Setup()->getFormTitle(); /** * output of metainformation to hidden div */ //$this->setViewMetaInfos(); $this->view->form = $this->objForm; $this->renderScript('form.phtml'); }
/** * getaddsubwidgetAction * @author Daniel Rotter <*****@*****.**> * @version 1.0 */ public function addsubwidgetAction() { $this->core->logger->debug('widgets->blog->FormController->addsubwidgetAction()'); try { $this->getFormArticle($this->core->sysConfig->generic->actions->add); $this->getBlogSpecificElements(); if ($this->objRequest->getPost() && $this->objRequest->isXmlHttpRequest()) { $arrFormData = $this->objRequest->getPost(); $this->objForm->Setup()->setFieldValues($arrFormData); $this->objForm->prepareForm(); if ($this->objForm->isValid($arrFormData)) { $this->objForm->setAction('/../widget/blog/form/editsubwidget'); $intSubwidgetUnique = uniqid(); $arrData = array('title' => $arrFormData['title'], 'text' => $arrFormData['text'], 'subwidgetId' => $intSubwidgetUnique); $intSubWidgetId = $this->getModelBlogEntry()->addBlogEntry($arrData); $this->objForm->Setup()->setElementId($intSubWidgetId); $this->objForm->Setup()->setSubwidgetId($intSubwidgetUnique); $this->objForm->Setup()->setActionType($this->core->sysConfig->generic->actions->add); $this->objForm->Setup()->setParentId($arrFormData['widgetInstanceId']); $this->objForm->getElement('id')->setValue($intSubWidgetId); if ($this->objForm->isValid($arrFormData)) { $this->objForm->saveFormData(); $this->view->assign('blnShowFormAlert', true); } else { $this->view->assign('blnShowFormAlert', false); } $this->view->assign('blnShowFormAlert', true); } else { $this->objForm->setAction('widget/blog/form/addsubwidget'); $this->view->assign('blnShowFormAlert', false); } } else { $this->objForm->prepareForm(); } $this->objForm->updateSpecialFieldValues(); $this->view->formtitle = $this->objForm->Setup()->getFormTitle(); $this->setViewMetaInfos(); $this->view->form = $this->objForm; $this->renderScript('blog/form.phtml'); } catch (Exception $exc) { $this->core->logger->err($exc); exit; } }
/** * addAction * @author Thomas Schedler <*****@*****.**> * @version 1.0 */ public function addAction() { $this->core->logger->debug('properties->controllers->LocationController->addAction()'); $this->getForm($this->core->sysConfig->generic->actions->add); /** * set action */ $this->objForm->setAction('/zoolu/properties/location/add'); if ($this->getRequest()->isPost() && $this->getRequest()->isXmlHttpRequest()) { $arrFormData = $this->getRequest()->getPost(); $this->objForm->Setup()->setFieldValues($arrFormData); /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); if ($this->objForm->isValid($arrFormData)) { /** * set action */ $this->objForm->setAction('/zoolu/properties/location/edit'); /** * set rootlevelid and parentid for location creation */ $this->objForm->Setup()->setRootLevelId($this->objForm->getElement('rootLevelId')->getValue()); $this->objForm->Setup()->setParentId($this->objForm->getElement('parentId')->getValue()); $intLocationId = $this->objForm->saveFormData(); $this->objForm->getElement('id')->setValue($intLocationId); $this->view->blnShowFormAlert = true; } } else { /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); } /** * get form title */ $this->view->formtitle = $this->objForm->Setup()->getFormTitle(); $this->view->form = $this->objForm; $this->renderScript('location/form.phtml'); }
/** * addAction * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ public function addAction() { $this->core->logger->debug('core->controllers->FolderController->addAction()'); $this->getForm($this->core->sysConfig->generic->actions->add); $this->addFolderSpecificFormElements(); /** * set action */ $this->objForm->setAction('/zoolu/core/folder/add'); if ($this->objRequest->isPost() && $this->objRequest->isXmlHttpRequest()) { $arrFormData = $this->objRequest->getPost(); $this->objForm->Setup()->setFieldValues($arrFormData); /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); if ($this->objForm->isValid($arrFormData)) { /** * set action */ $this->objForm->setAction('/zoolu/core/folder/edit'); $intFolderId = $this->objForm->saveFormData(); $this->objForm->Setup()->setElementId($intFolderId); $this->objForm->getElement('id')->setValue($intFolderId); $this->objForm->Setup()->setActionType($this->core->sysConfig->generic->actions->edit); $this->view->assign('blnShowFormAlert', true); /** * add defautl start page */ if (array_key_exists("rootLevelTypeId", $arrFormData) && $arrFormData["rootLevelTypeId"] == $this->core->sysConfig->root_level_types->portals) { $intTemplateId = $this->core->sysConfig->page_types->page->startpage_templateId; $this->getModelTemplates(); $objTemplateData = $this->objModelTemplates->loadTemplateById($intTemplateId); if (count($objTemplateData) == 1) { $objTemplate = $objTemplateData->current(); /** * set form id from template */ $strFormId = $objTemplate->genericFormId; $intFormVersion = $objTemplate->version; $intFormTypeId = $objTemplate->formTypeId; } else { throw new Exception('Not able to create a generic data object, because there is no form id!'); } $objGenericData = new GenericData(); $objGenericData->Setup()->setFormId($strFormId); $objGenericData->Setup()->setFormVersion($intFormVersion); $objGenericData->Setup()->setFormTypeId($intFormTypeId); $objGenericData->Setup()->setTemplateId($intTemplateId); $objGenericData->Setup()->setActionType($this->core->sysConfig->generic->actions->add); $objGenericData->Setup()->setLanguageId($this->objRequest->getParam("languageId", $this->core->sysConfig->languages->default->id)); $objGenericData->Setup()->setFormLanguageId(Zend_Auth::getInstance()->getIdentity()->languageId); $objGenericData->Setup()->setParentId($intFolderId); $objGenericData->Setup()->setRootLevelId($this->objForm->Setup()->getRootLevelId()); $objGenericData->Setup()->setElementTypeId($this->core->sysConfig->page_types->page->id); $objGenericData->Setup()->setCreatorId($this->objForm->Setup()->getCreatorId()); $objGenericData->Setup()->setStatusId($this->objForm->Setup()->getStatusId()); $objGenericData->Setup()->setShowInNavigation($this->objForm->Setup()->getShowInNavigation()); $objGenericData->Setup()->setModelSubPath('cms/models/'); $objGenericData->addStartPage($this->objForm->Setup()->getCoreField('title')->getValue()); $this->view->assign('selectNavigationItemNow', true); $this->view->assign('itemId', 'folder' . $intFolderId); } } else { $this->view->assign('blnShowFormAlert', false); } } else { /** * prepare form (add fields and region to the Zend_Form) */ $this->objForm->prepareForm(); } /** * get form title */ $this->view->formtitle = $this->objForm->Setup()->getFormTitle(); /** * output of metainformation to hidden div */ $this->setViewMetaInfos(); $this->view->form = $this->objForm; $this->renderScript('folder/form.phtml'); }