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


PHP PKPString::strtoupper方法代码示例

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


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

示例1: _translateSearchPhrase

 /**
  * Translate query keywords.
  * @param $searchPhrase string
  * @return The translated search phrase.
  */
 function _translateSearchPhrase($searchPhrase, $backwards = false)
 {
     static $queryKeywords;
     if (is_null($queryKeywords)) {
         // Query keywords.
         $queryKeywords = array(PKPString::strtoupper(__('search.operator.not')) => 'NOT', PKPString::strtoupper(__('search.operator.and')) => 'AND', PKPString::strtoupper(__('search.operator.or')) => 'OR');
     }
     if ($backwards) {
         $translationTable = array_flip($queryKeywords);
     } else {
         $translationTable = $queryKeywords;
     }
     // Translate the search phrase.
     foreach ($translationTable as $translateFrom => $translateTo) {
         $searchPhrase = PKPString::regexp_replace("/(^|\\s){$translateFrom}(\\s|\$)/i", "\\1{$translateTo}\\2", $searchPhrase);
     }
     return $searchPhrase;
 }
开发者ID:pkp,项目名称:ojs,代码行数:23,代码来源:SolrWebService.inc.php

示例2: itemAutocomplete

 /**
  * Returns a JSON list for the autocomplete field. Fetches a list of possible spotlight options
  * based on the spotlight type chosen.
  * @param $args array
  * @param $request PKPRequest
  * @return JSONMessage JSON object
  */
 function itemAutocomplete($args, $request)
 {
     $name = $request->getUserVar('name');
     $press = $this->getPress();
     $itemList = array();
     // get the items that match.
     $matches = array();
     $publishedMonographDao = DAORegistry::getDAO('PublishedMonographDAO');
     $publishedMonographs = $publishedMonographDao->getByPressId($press->getId());
     while ($monograph = $publishedMonographs->next()) {
         if ($name == '' || preg_match('/' . preg_quote($name, '/') . '/i', $monograph->getLocalizedTitle())) {
             $matches[] = array('label' => $monograph->getLocalizedTitle(), 'value' => $monograph->getId() . ':' . SPOTLIGHT_TYPE_BOOK);
         }
     }
     if (!empty($matches)) {
         $itemList[] = array('label' => PKPString::strtoupper(__('submission.monograph')), 'value' => '');
         $itemList = array_merge($itemList, $matches);
     }
     $matches = array();
     $seriesDao = DAORegistry::getDAO('SeriesDAO');
     $allSeries = $seriesDao->getByPressId($press->getId());
     while ($series = $allSeries->next()) {
         if ($name == '' || preg_match('/' . preg_quote($name, '/') . '/i', $series->getLocalizedTitle())) {
             $matches[] = array('label' => $series->getLocalizedTitle(), 'value' => $series->getId() . ':' . SPOTLIGHT_TYPE_SERIES);
         }
     }
     if (!empty($matches)) {
         $itemList[] = array('label' => PKPString::strtoupper(__('manager.series.book')), 'value' => '');
         $itemList = array_merge($itemList, $matches);
     }
     if (count($itemList) == 0) {
         return $this->noAutocompleteResults();
     }
     return new JSONMessage(true, $itemList);
 }
开发者ID:NateWr,项目名称:omp,代码行数:42,代码来源:ManageSpotlightsGridHandler.inc.php

示例3: selectSubscriber

 /**
  * Display a list of users from which to choose a subscriber/subscription contact.
  */
 function selectSubscriber($args, $request, $institutional = false)
 {
     $templateMgr = TemplateManager::getManager($request);
     if ($institutional) {
         $pageTitle = 'manager.subscriptions.selectContact';
         $redirect = 'institutional';
     } else {
         $pageTitle = 'manager.subscriptions.selectUser';
         $redirect = 'individual';
     }
     $userDao = DAORegistry::getDAO('UserDAO');
     $searchType = null;
     $searchMatch = null;
     $search = $searchQuery = $request->getUserVar('search');
     $searchInitial = $request->getUserVar('searchInitial');
     if (!empty($search)) {
         $searchType = $request->getUserVar('searchField');
         $searchMatch = $request->getUserVar('searchMatch');
     } else {
         if (isset($searchInitial)) {
             $searchInitial = PKPString::strtoupper($searchInitial);
             $searchType = USER_FIELD_INITIAL;
             $search = $searchInitial;
         }
     }
     $rangeInfo = Handler::getRangeInfo($request, 'users');
     $users = $userDao->getUsersByField($searchType, $searchMatch, $search, true, $rangeInfo);
     $templateMgr->assign('searchField', $searchType);
     $templateMgr->assign('searchMatch', $searchMatch);
     $templateMgr->assign('search', $searchQuery);
     $templateMgr->assign('searchInitial', $request->getUserVar('searchInitial'));
     import('classes.security.Validation');
     $templateMgr->assign('isJournalManager', Validation::isJournalManager());
     $templateMgr->assign('fieldOptions', array(USER_FIELD_FIRSTNAME => 'user.firstName', USER_FIELD_LASTNAME => 'user.lastName', USER_FIELD_USERNAME => 'user.username', USER_FIELD_EMAIL => 'user.email'));
     $templateMgr->assign('users', $users);
     $templateMgr->assign('subscriptionId', $request->getUserVar('subscriptionId'));
     $templateMgr->assign('pageTitle', $pageTitle);
     $templateMgr->assign('redirect', $redirect);
     $templateMgr->assign('alphaList', explode(' ', __('common.alphaList')));
     $templateMgr->display('subscription/users.tpl');
 }
开发者ID:utslibrary,项目名称:ojs,代码行数:44,代码来源:SubscriptionAction.inc.php


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