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


PHP RequestContext::getInstance方法代码示例

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


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

示例1: preDuplicate

 /**
  * @param form_persistentdocument_group $newDocument
  * @param form_persistentdocument_group $originalDocument
  * @param Integer $parentNodeId
  */
 protected function preDuplicate($newDocument, $originalDocument, $parentNodeId)
 {
     $requestContext = RequestContext::getInstance();
     foreach ($requestContext->getSupportedLanguages() as $lang) {
         try {
             $requestContext->beginI18nWork($lang);
             if ($newDocument->isContextLangAvailable()) {
                 $newDocument->setLabel($originalDocument->getLabel());
             }
             $requestContext->endI18nWork();
         } catch (Exception $e) {
             $requestContext->endI18nWork($e);
         }
     }
 }
开发者ID:RBSWebFactory,项目名称:modules.form,代码行数:20,代码来源:GroupService.class.php

示例2: duplicateNotificationInfo

 /**
  * @param notification_persistentdocument_notification $oldNotification
  * @param notification_persistentdocument_notification $newNotification
  */
 protected function duplicateNotificationInfo($oldNotification, $newNotification)
 {
     $requestContext = RequestContext::getInstance();
     foreach ($requestContext->getSupportedLanguages() as $lang) {
         try {
             $requestContext->beginI18nWork($lang);
             if ($newNotification->isContextLangAvailable()) {
                 if ($oldNotification->getLabel() != $oldNotification->getSubject()) {
                     $newNotification->setSubject(f_Locale::translate('&modules.generic.backoffice.Duplicate-prefix;') . ' ' . $oldNotification->getSubject());
                 }
                 $newNotification->setBody($oldNotification->getBody());
                 $newNotification->setHeader($oldNotification->getHeader());
                 $newNotification->setFooter($oldNotification->getFooter());
                 $newNotification->setFooter($oldNotification->getFooter());
                 $newNotification->setTemplate($oldNotification->getTemplate());
                 $newNotification->setSenderEmail($oldNotification->getSenderEmail());
             }
             $requestContext->endI18nWork();
         } catch (Exception $e) {
             $requestContext->endI18nWork($e);
         }
     }
 }
开发者ID:RBSWebFactory,项目名称:modules.form,代码行数:27,代码来源:BaseformService.class.php

示例3: renderForm

 /**
  * @param form_persistentdocument_baseform $form
  * @param block_BlockRequest $formRequest
  * @param validation_Errors $errors
  * @param array<String> $scriptArray
  * @return String
  * @deprecated
  */
 public function renderForm($form, $formRequest, $errors, &$scriptArray)
 {
     $scriptArray[] = 'modules.form.lib.js.date-picker.date';
     $scriptArray[] = 'modules.form.lib.js.date-picker.date_' . RequestContext::getInstance()->getLang();
     $scriptArray[] = 'modules.form.lib.js.date-picker.jquery-bgiframe';
     $scriptArray[] = 'modules.form.lib.js.date-picker.jquery-dimensions';
     $scriptArray[] = 'modules.form.lib.js.date-picker.jquery-datePicker';
     $scriptArray[] = 'modules.form.lib.js.form';
     $markup = $form->getMarkup();
     if (!$markup) {
         $markup = 'default';
     }
     try {
         $template = TemplateLoader::getInstance()->setMimeContentType(K::HTML)->setPackageName('modules_form')->setDirectory('templates/markup/' . $markup)->load('Form');
         $template->setAttribute('form', $form);
         $template->setAttribute('selfUrl', $_SERVER['REQUEST_URI']);
         if ($formRequest->hasParameter(form_FormConstants::BACK_URL_PARAMETER)) {
             $template->setAttribute('backUrl', $formRequest->getParameter(form_FormConstants::BACK_URL_PARAMETER));
         } else {
             $template->setAttribute('backUrl', $_SERVER['HTTP_REFERER']);
         }
         if (!is_null($errors)) {
             $template->setAttribute('errors', $errors);
         }
         $fieldContents = array();
         $this->buildContentsFromRequest($form->getDocumentNode()->getChildren(), $fieldContents, $formRequest, $form);
         $template->setAttribute('requestParameters', $formRequest->getParameters());
         $template->setAttribute('elements', $fieldContents);
         return $template->execute(true);
     } catch (Exception $e) {
         Framework::exception($e);
     }
     return null;
 }
开发者ID:RBSWebFactory,项目名称:modules.form,代码行数:42,代码来源:FormService.class.php

示例4: preDuplicate

 /**
  * @param form_persistentdocument_field $newDocument
  * @param form_persistentdocument_field $originalDocument
  * @param Integer $parentNodeId
  */
 protected function preDuplicate($newDocument, $originalDocument, $parentNodeId)
 {
     $requestContext = RequestContext::getInstance();
     foreach ($newDocument->getI18nInfo()->getLangs() as $lang) {
         try {
             $requestContext->beginI18nWork($lang);
             $newDocument->setLabel($originalDocument->getLabel());
             $requestContext->endI18nWork();
         } catch (Exception $e) {
             $requestContext->endI18nWork($e);
         }
     }
 }
开发者ID:RBSWebFactory,项目名称:modules.form,代码行数:18,代码来源:FieldService.class.php

示例5: addScriptsAndStyles

 /**
  * @param website_Page $page
  * @param form_persistentdocument_baseform $form
  */
 public static function addScriptsAndStyles($page)
 {
     $page->addStyle('modules.form.frontoffice');
     $page->addScript('modules.form.lib.js.date-picker.date');
     $page->addScript('modules.form.lib.js.date-picker.date_' . RequestContext::getInstance()->getLang());
     $page->addScript('modules.form.lib.js.date-picker.jquery-bgiframe');
     $page->addScript('modules.form.lib.js.date-picker.jquery-dimensions');
     $page->addScript('modules.form.lib.js.date-picker.jquery-datePicker');
     $page->addScript('modules.form.lib.js.form');
 }
开发者ID:RBSWebFactory,项目名称:modules.form,代码行数:14,代码来源:FormHelper.class.php


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