当前位置: 首页>>代码示例>>PHP>>正文


PHP FormHandler::getInstance方法代码示例

本文整理汇总了PHP中FormHandler::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP FormHandler::getInstance方法的具体用法?PHP FormHandler::getInstance怎么用?PHP FormHandler::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormHandler的用法示例。


在下文中一共展示了FormHandler::getInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getForm

 /**
  * getForm
  * @author Cornelius Hansjakob <cha@massiveart.com>
  * @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;
     }
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:42,代码来源:MemberController.php

示例2: getForm

 /**
  * getForm
  * @author Thomas Schedler <tsh@massiveart.com>
  * @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;
     }
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:34,代码来源:LocationController.php

示例3: getForm

 /**
  * getForm
  * @author Thomas Schedler <tsh@massiveart.com>
  * @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;
     }
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:74,代码来源:ElementController.php

示例4: getForm

 /**
  * 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;
     }
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:31,代码来源:CategoryController.php

示例5: getForm

 /**
  * createForm
  * @param integer $intActionType
  * @author Cornelius Hansjakob <cha@massiveart.com>
  * @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));
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:46,代码来源:FolderController.php

示例6: getForm

 /**
  * getForm
  * @param number $intActionType
  * @author Daniel Rotter <daniel.rotter@massiveart.com>
  * @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);
     }
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:70,代码来源:WidgetController.php

示例7: getFormProperties

 /**
  * getFormProperties
  * @param number $intActionType
  * @author Daniel Rotter <daniel.rotter@massiveart.com>
  * @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;
     }
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:23,代码来源:FormController.php


注:本文中的FormHandler::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。