Пример #1
0
 /**
  * getForm
  * @author Cornelius Hansjakob <*****@*****.**>
  * @version 1.0
  */
 private function getForm($intActionType = null)
 {
     $this->core->logger->debug('contacts->controllers->MemberController->getForm(' . $intActionType . ')');
     try {
         $strFormId = $this->objRequest->getParam("formId", $this->core->sysConfig->form->ids->members->default);
         $intElementId = $this->objRequest->getParam("id") != '' ? $this->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 location & unit 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')));
         /**
          * add currlevel hidden field
          */
         $this->objForm->addElement('hidden', 'currLevel', array('value' => $this->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;
     }
 }
 /**
  * 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
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 private function getForm($intActionType = null)
 {
     $this->core->logger->debug('global->controllers->ElementController->getForm(' . $intActionType . ')');
     try {
         $strFormId = $this->objRequest->getParam("formId");
         $intTemplateId = $this->objRequest->getParam("templateId");
         /**
          * if there is now formId, try to load form template
          */
         if ($strFormId == '') {
             if ($intTemplateId != '') {
                 /**
                  * get files
                  */
                 $this->getModelTemplates();
                 $objTemplateData = $this->objModelTemplates->loadTemplateById($intTemplateId);
                 if (count($objTemplateData) == 1) {
                     $objTemplate = $objTemplateData->current();
                     /**
                      * set form id from template
                      */
                     $strFormId = $objTemplate->genericFormId;
                 } else {
                     throw new Exception('Not able to create a form, because there is no form id!');
                 }
             } else {
                 throw new Exception('Not able to create a form, because there is no form id!');
             }
         }
         $intFormVersion = $this->objRequest->getParam("formVersion") != '' ? $this->objRequest->getParam("formVersion") : null;
         $intElementId = $this->objRequest->getParam("id") != '' ? $this->objRequest->getParam("id") : null;
         $objFormHandler = FormHandler::getInstance();
         $objFormHandler->setFormId($strFormId);
         $objFormHandler->setTemplateId($intTemplateId);
         $objFormHandler->setFormVersion($intFormVersion);
         $objFormHandler->setActionType($intActionType);
         $objFormHandler->setLanguageId($this->getItemLanguageId($intActionType));
         $objFormHandler->setFormLanguageId($this->core->intZooluLanguageId);
         $objFormHandler->setElementId($intElementId);
         $this->objForm = $objFormHandler->getGenericForm();
         /**
          * set element default & specific form values
          */
         $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()->setRootLevelGroupId($this->objRequest->getParam("rootLevelGroupId") != '' ? $this->objRequest->getParam("rootLevelGroupId") : 0);
         $this->objForm->Setup()->setParentId($this->objRequest->getParam("parentFolderId") != '' ? $this->objRequest->getParam("parentFolderId") : null);
         $this->objForm->Setup()->setIsStartElement($this->objRequest->getParam("isStartGlobal") != '' ? $this->objRequest->getParam("isStartGlobal") : 0);
         $this->objForm->Setup()->setPublishDate($this->objRequest->getParam("publishDate") != '' ? $this->objRequest->getParam("publishDate") : date('Y-m-d H:i:s'));
         $this->objForm->Setup()->setShowInNavigation($this->objRequest->getParam("showInNavigation") != '' ? $this->objRequest->getParam("showInNavigation") : 0);
         $this->objForm->Setup()->setLanguageFallbackId($this->objRequest->getParam("languageFallback") != '' ? $this->objRequest->getParam("languageFallback") : 0);
         $this->objForm->Setup()->setElementTypeId($this->objRequest->getParam("elementTypeId") != '' ? $this->objRequest->getParam("elementTypeId") : $this->core->sysConfig->global_types->product->id);
         $this->objForm->Setup()->setParentTypeId($this->objRequest->getParam("parentTypeId") != '' ? $this->objRequest->getParam("parentTypeId") : ($this->objRequest->getParam("parentFolderId") != '' ? $this->core->sysConfig->parent_types->folder : $this->core->sysConfig->parent_types->rootlevel));
         $this->objForm->Setup()->setModelSubPath('global/models/');
         $this->objForm->Setup()->setElementLinkId($this->objRequest->getParam("linkId", -1));
         /**
          * add currlevel hidden field
          */
         $this->objForm->addElement('hidden', 'currLevel', array('value' => $this->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;
     }
 }
 /**
  * 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;
     }
 }
Пример #5
0
 /**
  * createForm
  * @param integer $intActionType
  * @author Cornelius Hansjakob <*****@*****.**>
  * @version 1.0
  */
 private function getForm($intActionType = null)
 {
     $this->core->logger->debug('core->controllers->FolderController->createForm(' . $intActionType . ')');
     $this->view->module = $this->objRequest->getParam('zoolu_module') != '' ? $this->objRequest->getParam('zoolu_module') : 0;
     $this->view->core = $this->core;
     $strFormId = $this->objRequest->getParam('formId');
     $intFormVersion = $this->objRequest->getParam('formVersion') != '' ? $this->objRequest->getParam('formVersion') : null;
     $intElementId = $this->objRequest->getParam('id') != '' ? $this->objRequest->getParam('id') : null;
     $objFormHandler = FormHandler::getInstance();
     $objFormHandler->setFormId($strFormId);
     $objFormHandler->setFormVersion($intFormVersion);
     $objFormHandler->setActionType($intActionType);
     $objFormHandler->setLanguageId($this->getItemLanguageId());
     $objFormHandler->setFormLanguageId($this->core->intZooluLanguageId);
     $objFormHandler->setElementId($intElementId);
     $this->objForm = $objFormHandler->getGenericForm();
     /**
      * set page default & specific form values
      */
     $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()->setRootLevelTypeId($this->objRequest->getParam('rootLevelTypeId') != '' ? $this->objRequest->getParam('rootLevelTypeId') : null);
     $this->objForm->Setup()->setRootLevelGroupId($this->objRequest->getParam('rootLevelGroupId') != '' ? $this->objRequest->getParam('rootLevelGroupId') : null);
     $this->objForm->Setup()->setParentId($this->objRequest->getParam('parentFolderId') != '' ? $this->objRequest->getParam('parentFolderId') : null);
     $this->objForm->Setup()->setUrlFolder($this->objRequest->getParam('isUrlFolder') != '' ? $this->objRequest->getParam('isUrlFolder') : 1);
     $this->objForm->Setup()->setShowInNavigation($this->objRequest->getParam('showInNavigation') != '' ? $this->objRequest->getParam('showInNavigation') : 0);
     /**
      * add currlevel hidden field
      */
     $this->objForm->addElement('hidden', 'currLevel', array('value' => $this->objRequest->getParam('currLevel'), 'decorators' => array('Hidden'), 'ignore' => true));
     /**
      * add elementTye hidden field (folder, page, ...)
      */
     $this->objForm->addElement('hidden', 'elementType', array('value' => $this->objRequest->getParam('elementType'), 'decorators' => array('Hidden'), 'ignore' => true));
     /**
      * add zoolu_module hidden field
      */
     $this->objForm->addElement('hidden', 'zoolu_module', array('value' => $this->view->module, 'decorators' => array('Hidden'), 'ignore' => true));
 }
Пример #6
0
 /**
  * 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);
     }
 }
Пример #7
0
 /**
  * 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;
     }
 }