/**
  * getForm
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 private function getForm($intActionType = null)
 {
     $this->core->logger->debug('properties->controllers->LocationController->getForm(' . $intActionType . ')');
     try {
         $objRequest = $this->getRequest();
         $strFormId = $objRequest->getParam("formId", $this->core->sysConfig->form->ids->locations->default);
         $intElementId = $objRequest->getParam("id") != '' ? $objRequest->getParam("id") : null;
         $objFormHandler = FormHandler::getInstance();
         $objFormHandler->setFormId($strFormId);
         $objFormHandler->setActionType($intActionType);
         $objFormHandler->setLanguageId(1);
         //TODO : get Language id
         $objFormHandler->setFormLanguageId($this->core->intZooluLanguageId);
         $objFormHandler->setElementId($intElementId);
         $this->objForm = $objFormHandler->getGenericForm();
         /**
          * add location & unit specific hidden fields
          */
         $this->objForm->addElement('hidden', 'rootLevelId', array('value' => $objRequest->getParam("rootLevelId"), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'parentId', array('value' => $objRequest->getParam("parentId"), 'decorators' => array('Hidden')));
         /**
          * add currlevel hidden field
          */
         $this->objForm->addElement('hidden', 'currLevel', array('value' => $objRequest->getParam("currLevel"), 'decorators' => array('Hidden'), 'ignore' => true));
     } catch (Exception $exc) {
         $this->core->logger->err($exc);
         exit;
     }
 }
 /**
  * getForm
  */
 private function getForm($intActionType = null)
 {
     $this->core->logger->debug('properties->controllers->CategoryController->getForm(' . $intActionType . ')');
     try {
         $strFormId = $this->objRequest->getParam("formId");
         $intElementId = $this->objRequest->getParam("id") != '' ? $this->objRequest->getParam("id") : null;
         $objFormHandler = FormHandler::getInstance();
         $objFormHandler->setFormId($strFormId);
         $objFormHandler->setActionType($intActionType);
         $objFormHandler->setLanguageId($this->objRequest->getParam("languageId", $this->core->sysConfig->languages->default->id));
         $objFormHandler->setFormLanguageId(Zend_Auth::getInstance()->getIdentity()->languageId);
         $objFormHandler->setElementId($intElementId);
         $this->objForm = $objFormHandler->getGenericForm();
         /**
          * add folder specific hidden fields
          */
         $this->objForm->addElement('hidden', 'rootLevelId', array('value' => $this->objRequest->getParam("rootLevelId"), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'parentId', array('value' => $this->objRequest->getParam("parentId"), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'categoryTypeId', array('value' => $this->objRequest->getParam("categoryTypeId"), 'decorators' => array('Hidden')));
         /**
          * add currlevel hidden field
          */
         $this->objForm->addElement('hidden', 'currLevel', array('value' => $this->objRequest->getParam("currLevel"), 'decorators' => array('Hidden'), 'ignore' => true));
     } catch (Exception $exc) {
         $this->core->logger->err($exc);
         exit;
     }
 }
 /**
  * addFolderSpecificFormElements
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 protected function addFolderSpecificFormElements()
 {
     if (is_object($this->objForm) && $this->objForm instanceof GenericForm) {
         /**
          * add folder specific hidden fields
          */
         $this->objForm->addElement('hidden', 'creator', array('value' => $this->objForm->Setup()->getCreatorId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'idStatus', array('value' => $this->objForm->Setup()->getStatusId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'rootLevelId', array('value' => $this->objForm->Setup()->getRootLevelId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'rootLevelTypeId', array('value' => $this->objForm->Setup()->getRootLevelTypeId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'parentFolderId', array('value' => $this->objForm->Setup()->getParentId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'isUrlFolder', array('value' => $this->objForm->Setup()->getUrlFolder(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'showInNavigation', array('value' => $this->objForm->Setup()->getShowInNavigation(), 'decorators' => array('Hidden'), 'ignore' => true));
     }
 }
 /**
  * getFormProperties
  * @param number $intActionType
  * @author Daniel Rotter <*****@*****.**>
  * @version 1.0
  */
 private function getFormProperties($intActionType = null)
 {
     $this->core->logger->debug('widgets->log->FormController->getFormProperties(' . $intActionType . ')');
     try {
         $objFormHandler = FormHandler::getInstance();
         $objFormHandler->setFormId('W_BLOG_PROPERTIES');
         $objFormHandler->setFormVersion(1);
         $objFormHandler->setActionType($intActionType);
         $objFormHandler->setLanguageId($this->core->sysConfig->languages->default->id);
         $objFormHandler->setFormLanguageId(Zend_Auth::getInstance()->getIdentity()->languageId);
         $this->objForm = $objFormHandler->getGenericForm();
         $this->objForm->addElement('hidden', 'idWidgetInstances', array('value' => $this->objRequest->getParam('idWidgetInstances'), 'decorators' => array('Hidden'), 'ignore' => true));
     } catch (Exception $exc) {
         $this->core->logger->err($exc);
         exit;
     }
 }
 /**
  * addPageSpecificFormElements
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 protected function addPageSpecificFormElements()
 {
     if (is_object($this->objForm) && $this->objForm instanceof GenericForm) {
         /**
          * add page specific hidden fields
          */
         $this->objForm->addElement('hidden', 'creator', array('value' => $this->objForm->Setup()->getCreatorId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'idStatus', array('value' => $this->objForm->Setup()->getStatusId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'rootLevelId', array('value' => $this->objForm->Setup()->getRootLevelId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'rootLevelTypeId', array('value' => $this->objForm->Setup()->getRootLevelTypeId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'parentFolderId', array('value' => $this->objForm->Setup()->getParentId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'pageTypeId', array('value' => $this->objForm->Setup()->getElementTypeId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'isStartPage', array('value' => $this->objForm->Setup()->getIsStartElement(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'publishDate', array('value' => $this->objForm->Setup()->getPublishDate('Y-m-d H:i:s'), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'showInNavigation', array('value' => $this->objForm->Setup()->getShowInNavigation(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'parentTypeId', array('value' => $this->objForm->Setup()->getParentTypeId(), 'decorators' => array('Hidden')));
     }
 }
 /**
  * getForm
  * @author Cornelius Hansjakob <*****@*****.**>
  * @version 1.0
  */
 private function getForm($intActionType = null)
 {
     $this->core->logger->debug('contacts->controllers->ContactController->getForm(' . $intActionType . ')');
     try {
         $objRequest = $this->getRequest();
         $strFormId = $objRequest->getParam("formId");
         $intElementId = $objRequest->getParam("id") != '' ? $objRequest->getParam("id") : null;
         /**
          * if there is no formId
          */
         if ($strFormId == '') {
             throw new Exception('Not able to create a form, because there is no form id!');
         }
         $objFormHandler = FormHandler::getInstance();
         $objFormHandler->setFormId($strFormId);
         $objFormHandler->setActionType($intActionType);
         $objFormHandler->setLanguageId($this->getItemLanguageId($intActionType));
         $objFormHandler->setFormLanguageId($this->core->intZooluLanguageId);
         $objFormHandler->setElementId($intElementId);
         $this->objForm = $objFormHandler->getGenericForm();
         /**
          * add contact & unit specific hidden fields
          */
         $this->objForm->addElement('hidden', 'rootLevelId', array('value' => $objRequest->getParam("rootLevelId"), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'parentId', array('value' => $objRequest->getParam("parentId"), 'decorators' => array('Hidden')));
         /**
          * add currlevel hidden field
          */
         $this->objForm->addElement('hidden', 'currLevel', array('value' => $objRequest->getParam("currLevel"), 'decorators' => array('Hidden'), 'ignore' => true));
         /**
          * add elementTye hidden field (folder, element, ...)
          */
         $this->objForm->addElement('hidden', 'elementType', array('value' => $this->objRequest->getParam("elementType"), 'decorators' => array('Hidden'), 'ignore' => true));
     } catch (Exception $exc) {
         $this->core->logger->err($exc);
         exit;
     }
 }
 /**
  * addGlobalSpecificFormElements
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 protected function addGlobalSpecificFormElements()
 {
     if (is_object($this->objForm) && $this->objForm instanceof GenericForm) {
         /**
          * add element specific hidden fields
          */
         $this->objForm->addElement('hidden', 'creator', array('value' => $this->objForm->Setup()->getCreatorId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'idStatus', array('value' => $this->objForm->Setup()->getStatusId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'rootLevelId', array('value' => $this->objForm->Setup()->getRootLevelId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'rootLevelTypeId', array('value' => $this->objForm->Setup()->getRootLevelTypeId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'rootLevelGroupId', array('value' => $this->objForm->Setup()->getRootLevelGroupId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'parentFolderId', array('value' => $this->objForm->Setup()->getParentId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'elementTypeId', array('value' => $this->objForm->Setup()->getElementTypeId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'isStartGlobal', array('value' => $this->objForm->Setup()->getIsStartElement(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'publishDate', array('value' => $this->objForm->Setup()->getPublishDate('Y-m-d H:i:s'), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'showInNavigation', array('value' => $this->objForm->Setup()->getShowInNavigation(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'languageFallback', array('value' => $this->objForm->Setup()->getLanguageFallbackId(), 'decorators' => array('Hidden')));
         $this->objForm->addElement('hidden', 'parentTypeId', array('value' => $this->objForm->Setup()->getParentTypeId(), 'decorators' => array('Hidden')));
         /**
          * element link Id form the tree view
          */
         $this->objForm->addElement('hidden', 'linkId', array('value' => $this->objForm->Setup()->getElementLinkId(), 'decorators' => array('Hidden')));
     }
 }
 /**
  * getForm
  * @param number $intActionType
  * @author Daniel Rotter <*****@*****.**>
  * @version 1.0
  */
 private function getForm($intActionType = null)
 {
     $this->core->logger->debug('cms->controllers->WidgetController->getForm(' . $intActionType . ')');
     try {
         /**
          * Get Genericform ID by WidgetId
          */
         if ($this->objRequest->getParam("formId") == '' || $this->objRequest->getParam("formId") == '-1') {
             $objRow = $this->getModelWidget()->getGenericFormByWidgetId($this->objRequest->getParam('idWidget'));
             $objFormHandler = FormHandler::getInstance();
             $objFormHandler->setFormId($objRow->genericFormId);
             $objFormHandler->setFormVersion($objRow->version);
         } else {
             $objRow = $this->getModelWidget()->getGenericFormById($this->objRequest->getParam('formId'));
             $objFormHandler = FormHandler::getInstance();
             $objFormHandler->setFormId($objRow->genericFormId);
             $objFormHandler->setFormVersion($objRow->version);
         }
         /**
          * Get GenericFormId
          */
         $objFormHandler->setActionType($intActionType);
         $objFormHandler->setLanguageId($this->objRequest->getParam("languageId", $this->core->sysConfig->languages->default->id));
         $objFormHandler->setFormLanguageId(Zend_Auth::getInstance()->getIdentity()->languageId);
         $objFormHandler->setElementId($this->objRequest->getParam("idWidgetInstance") != '' ? $this->objRequest->getParam("idWidgetInstance") : null);
         $this->objForm = $objFormHandler->getGenericForm();
         $this->objForm->Setup()->setCreatorId($this->objRequest->getParam("creator") != '' ? $this->objRequest->getParam("creator") : Zend_Auth::getInstance()->getIdentity()->id);
         $this->objForm->Setup()->setStatusId($this->objRequest->getParam("idStatus") != '' ? $this->objRequest->getParam("idStatus") : $this->core->sysConfig->form->status->default);
         $this->objForm->Setup()->setRootLevelId($this->objRequest->getParam("rootLevelId") != '' ? $this->objRequest->getParam("rootLevelId") : null);
         $this->objForm->Setup()->setParentId($this->objRequest->getParam("parentFolderId") != '' ? $this->objRequest->getParam("parentFolderId") : null);
         $this->objForm->Setup()->setIsStartElement($this->objRequest->getParam("isStartPage") != '' ? $this->objRequest->getParam("isStartPage") : 0);
         $this->objForm->Setup()->setPublishDate($this->objRequest->getParam("publishDate") != '' ? $this->objRequest->getParam("publishDate") : date('Y-m-d H:i:s'));
         $this->objForm->Setup()->setStatusId($this->objRequest->getParam("idStatus") != '' ? $this->objRequest->getParam("idStatus") : $this->core->sysConfig->form->status->default);
         $this->objForm->Setup()->setShowInNavigation($this->objRequest->getParam("showInNavigation") != '' ? $this->objRequest->getParam("showInNavigation") : 0);
         $this->objForm->Setup()->setElementTypeId($this->objRequest->getParam("idWidget") != '' ? $this->objRequest->getParam("idWidget") : 0);
         $this->objForm->Setup()->setParentTypeId($this->objRequest->getParam("parentType") != '' ? $this->objRequest->getParam("parentType") : ($this->objRequest->getParam("parentFolderId") != '' ? $this->core->sysConfig->parent_types->folder : $this->core->sysConfig->parent_types->rootlevel));
         $this->objForm->Setup()->setElementId($this->objRequest->getParam('idWidgetInstance'));
         //Generate new widgetInstanceId if addAction is called
         if ($intActionType == $this->core->sysConfig->generic->actions->add && $this->objRequest->getParam('instanceId') == '') {
             $strWidgetInstanceId = uniqid();
             $this->objForm->Setup()->setWidgetInstanceId($strWidgetInstanceId);
         } else {
             $this->objForm->Setup()->setWidgetInstanceId($this->objRequest->getParam("instanceId"));
         }
         $this->objForm->Setup()->setModelSubPath('cms/models/');
         $this->objForm->addElement('hidden', 'parentFolderId', array('value' => $this->objRequest->getParam('parentFolderId'), 'decorators' => array('Hidden'), 'ignore' => true));
         $this->objForm->addElement('hidden', 'rootLevelId', array('value' => $this->objRequest->getParam('rootLevelId'), 'decorators' => array('Hidden'), 'ignore' => true));
         $this->objForm->addElement('hidden', 'currLevel', array('value' => $this->objRequest->getParam('currLevel'), 'decorators' => array('Hidden'), 'ignore' => true));
         $this->objForm->addElement('hidden', 'elementType', array('value' => 'widget', 'decorators' => array('Hidden'), 'ignore' => true));
         $this->objForm->addElement('hidden', 'parentType', array('value' => $this->objRequest->getParam('parentType'), 'decorators' => array('Hidden'), 'ignore' => true));
         $this->objForm->addElement('hidden', 'idWidget', array('value' => $this->objRequest->getParam('idWidget'), 'decorators' => array('Hidden'), 'ignore' => true));
         $this->objForm->addElement('hidden', 'elementId', array('value' => $this->objRequest->getParam('idWidgetInstance'), 'decorators' => array('Hidden'), 'ignore' => true));
         $this->objForm->addElement('hidden', 'isStartPage', array('value' => $this->objRequest->getParam('isStartPage'), 'decorators' => array('Hidden')));
         //Use the widgetInstanceId from above, if addAction is called
         if ($intActionType == $this->core->sysConfig->generic->actions->add) {
             $this->objForm->addElement('hidden', 'instanceId', array('value' => $this->objForm->Setup()->getWidgetInstanceId(), 'decorators' => array('Hidden')));
         } else {
             $this->objForm->addElement('hidden', 'instanceId', array('value' => $this->objRequest->getParam('instanceId'), 'decorators' => array('Hidden')));
         }
         $this->objForm->addElement('hidden', 'idWidgetInstance', array('value' => $this->objRequest->getParam('idWidgetInstance'), 'decorators' => array('Hidden')));
     } catch (Exception $exc) {
         $this->core->logger->err($exc);
     }
 }