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


PHP Locale::getSupportedFormLocales方法代码示例

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


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

示例1: Form

 /**
  * Constructor.
  * @param $template string the path to the form template file
  */
 function Form($template = null, $callHooks = true, $requiredLocale = null, $supportedLocales = null)
 {
     if ($callHooks === true && checkPhpVersion('4.3.0')) {
         $trace = debug_backtrace();
         // Call hooks based on the calling entity, assuming
         // this method is only called by a subclass. Results
         // in hook calls named e.g. "papergalleyform::Constructor"
         // Note that class names are always lower case.
         HookRegistry::call(strtolower($trace[1]['class']) . '::Constructor', array(&$this, &$template));
     }
     if ($requiredLocale === null) {
         $requiredLocale = Locale::getPrimaryLocale();
     }
     $this->requiredLocale = $requiredLocale;
     if ($supportedLocales === null) {
         $supportedLocales = Locale::getSupportedFormLocales();
     }
     $this->supportedLocales = $supportedLocales;
     $this->_template = $template;
     $this->_data = array();
     $this->_checks = array();
     $this->_errors = array();
     $this->errorsArray = array();
     $this->errorFields = array();
     $this->formSectionErrors = array();
     $this->fbvStyles = array('size' => array('SMALL' => 'SMALL', 'MEDIUM' => 'MEDIUM', 'LARGE' => 'LARGE'), 'float' => array('RIGHT' => 'RIGHT', 'LEFT' => 'LEFT'), 'align' => array('RIGHT' => 'RIGHT', 'LEFT' => 'LEFT'), 'measure' => array('1OF1' => '1OF1', '1OF2' => '1OF2', '1OF3' => '1OF3', '2OF3' => '2OF3', '1OF4' => '1OF4', '3OF4' => '3OF4', '1OF5' => '1OF5', '2OF5' => '2OF5', '3OF5' => '3OF5', '4OF5' => '4OF5', '1OF10' => '1OF10', '8OF10' => '8OF10'), 'layout' => array('THREE_COLUMNS' => 'THREE_COLUMNS', 'TWO_COLUMNS' => 'TWO_COLUMNS', 'ONE_COLUMN' => 'ONE_COLUMN'));
 }
开发者ID:ramonsodoma,项目名称:pkp-lib,代码行数:31,代码来源:Form.inc.php

示例2: display

 /**
  * Display the form.
  * @param $request PKPRequest
  * @param $fetch boolean if set to true will return the rendered
  *  form rather than sending the response to the user
  * @return string the rendered form if fetch is true, otherwise null
  */
 function display($request = null, $fetch = false)
 {
     if (checkPhpVersion('4.3.0')) {
         $returner = null;
         $trace = debug_backtrace();
         // Call hooks based on the calling entity, assuming
         // this method is only called by a subclass. Results
         // in hook calls named e.g. "papergalleyform::display"
         // Note that class names are always lower case.
         if (HookRegistry::call(strtolower($trace[1]['class']) . '::' . $trace[0]['function'], array(&$this, &$returner))) {
             return $returner;
         }
     }
     $templateMgr =& TemplateManager::getManager($request);
     $templateMgr->setCacheability(CACHEABILITY_NO_STORE);
     $templateMgr->register_function('fieldLabel', array(&$this, 'smartyFieldLabel'));
     $templateMgr->register_function('form_language_chooser', array(&$this, 'smartyFormLanguageChooser'));
     $templateMgr->register_function('modal_language_chooser', array(&$this, 'smartyModalLanguageChooser'));
     $templateMgr->register_block('form_locale_iterator', array(&$this, 'formLocaleIterator'));
     // modifier vocabulary for creating forms
     $templateMgr->register_block('fbvFormSection', array(&$this, 'smartyFBVFormSection'));
     $templateMgr->register_block('fbvCustomElement', array(&$this, 'smartyFBVCustomElement'));
     $templateMgr->register_block('fbvFormArea', array(&$this, 'smartyFBVFormArea'));
     $templateMgr->register_function('fbvButton', array(&$this, 'smartyFBVButton'));
     $templateMgr->register_function('fbvTextInput', array(&$this, 'smartyFBVTextInput'));
     $templateMgr->register_function('fbvTextarea', array(&$this, 'smartyFBVTextArea'));
     $templateMgr->register_function('fbvSelect', array(&$this, 'smartyFBVSelect'));
     $templateMgr->register_function('fbvElement', array(&$this, 'smartyFBVElement'));
     $templateMgr->register_function('fbvElementMultilingual', array(&$this, 'smartyFBVElementMultilingual'));
     $templateMgr->register_function('fbvCheckbox', array(&$this, 'smartyFBVCheckbox'));
     $templateMgr->register_function('fbvRadioButton', array(&$this, 'smartyFBVRadioButton'));
     $templateMgr->register_function('fbvFileInput', array(&$this, 'smartyFBVFileInput'));
     $templateMgr->assign('fbvStyles', $this->fbvStyles);
     $templateMgr->assign($this->_data);
     $templateMgr->assign('isError', !$this->isValid());
     $templateMgr->assign('errors', $this->getErrorsArray());
     $templateMgr->assign('formLocales', Locale::getSupportedFormLocales());
     // Determine the current locale to display fields with
     $formLocale = Request::getUserVar('formLocale');
     if (empty($formLocale)) {
         $formLocale = Locale::getLocale();
     }
     if (!in_array($formLocale, array_keys(Locale::getSupportedFormLocales()))) {
         $formLocale = Locale::getPrimaryLocale();
     }
     $templateMgr->assign('formLocale', $formLocale);
     if ($fetch) {
         return $templateMgr->fetch($this->_template);
     } else {
         $templateMgr->display($this->_template);
         return null;
     }
 }
开发者ID:reedstrm,项目名称:pkp-lib,代码行数:60,代码来源:Form.inc.php


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