當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhabricatorApplicationSearchEngine::getQueryResultsPageURI方法代碼示例

本文整理匯總了PHP中PhabricatorApplicationSearchEngine::getQueryResultsPageURI方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorApplicationSearchEngine::getQueryResultsPageURI方法的具體用法?PHP PhabricatorApplicationSearchEngine::getQueryResultsPageURI怎麽用?PHP PhabricatorApplicationSearchEngine::getQueryResultsPageURI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhabricatorApplicationSearchEngine的用法示例。


在下文中一共展示了PhabricatorApplicationSearchEngine::getQueryResultsPageURI方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildFilterMenu

 private function buildFilterMenu(PhabricatorUser $viewer, $custom_query, PhabricatorApplicationSearchEngine $engine, $query_key)
 {
     $filter_icon = id(new PHUIIconView())->setIconFont('fa-search-plus bluegrey');
     $named = array('open' => pht('Open Tasks'), 'all' => pht('All Tasks'));
     if ($viewer->isLoggedIn()) {
         $named['assigned'] = pht('Assigned to Me');
     }
     if ($custom_query) {
         $named[$custom_query->getQueryKey()] = pht('Custom Filter');
     }
     $items = array();
     foreach ($named as $key => $name) {
         $is_selected = $key == $query_key;
         if ($is_selected) {
             $active_filter = $name;
         }
         $is_custom = false;
         if ($custom_query) {
             $is_custom = $key == $custom_query->getQueryKey();
         }
         $item = id(new PhabricatorActionView())->setIcon('fa-search')->setSelected($is_selected)->setName($name);
         if ($is_custom) {
             $uri = $this->getApplicationURI('board/' . $this->id . '/filter/query/' . $key . '/');
             $item->setWorkflow(true);
         } else {
             $uri = $engine->getQueryResultsPageURI($key);
         }
         $uri = $this->getURIWithState($uri);
         $item->setHref($uri);
         $items[] = $item;
     }
     $items[] = id(new PhabricatorActionView())->setIcon('fa-cog')->setHref($this->getApplicationURI('board/' . $this->id . '/filter/'))->setWorkflow(true)->setName(pht('Advanced Filter...'));
     $filter_menu = id(new PhabricatorActionListView())->setUser($viewer);
     foreach ($items as $item) {
         $filter_menu->addAction($item);
     }
     $filter_button = id(new PHUIButtonView())->setText(pht('Filter: %s', $active_filter))->setIcon($filter_icon)->setTag('a')->setHref('#')->addSigil('boards-dropdown-menu')->setMetadata(array('items' => hsprintf('%s', $filter_menu)));
     return $filter_button;
 }
開發者ID:denghp,項目名稱:phabricator,代碼行數:39,代碼來源:PhabricatorProjectBoardViewController.php

示例2: buildFilterMenu

 private function buildFilterMenu(PhabricatorUser $viewer, PhabricatorProject $project, $custom_query, PhabricatorApplicationSearchEngine $engine, $query_key)
 {
     $named = array('open' => pht('Open Tasks'), 'all' => pht('All Tasks'));
     if ($viewer->isLoggedIn()) {
         $named['assigned'] = pht('Assigned to Me');
     }
     if ($custom_query) {
         $named[$custom_query->getQueryKey()] = pht('Custom Filter');
     }
     $items = array();
     foreach ($named as $key => $name) {
         $is_selected = $key == $query_key;
         if ($is_selected) {
             $active_filter = $name;
         }
         $is_custom = false;
         if ($custom_query) {
             $is_custom = $key == $custom_query->getQueryKey();
         }
         $item = id(new PhabricatorActionView())->setIcon('fa-search')->setSelected($is_selected)->setName($name);
         if ($is_custom) {
             $uri = $this->getApplicationURI('board/' . $this->id . '/filter/query/' . $key . '/');
             $item->setWorkflow(true);
         } else {
             $uri = $engine->getQueryResultsPageURI($key);
         }
         $uri = $this->getURIWithState($uri)->setQueryParam('filter', null);
         $item->setHref($uri);
         $items[] = $item;
     }
     $id = $project->getID();
     $filter_uri = $this->getApplicationURI("board/{$id}/filter/");
     $filter_uri = $this->getURIWithState($filter_uri, $force = true);
     $items[] = id(new PhabricatorActionView())->setIcon('fa-cog')->setHref($filter_uri)->setWorkflow(true)->setName(pht('Advanced Filter...'));
     $save_uri = "default/{$id}/filter/";
     $save_uri = $this->getApplicationURI($save_uri);
     $save_uri = $this->getURIWithState($save_uri, $force = true);
     $can_edit = PhabricatorPolicyFilter::hasCapability($viewer, $project, PhabricatorPolicyCapability::CAN_EDIT);
     $items[] = id(new PhabricatorActionView())->setIcon('fa-floppy-o')->setName(pht('Save as Default'))->setHref($save_uri)->setWorkflow(true)->setDisabled(!$can_edit);
     $filter_menu = id(new PhabricatorActionListView())->setUser($viewer);
     foreach ($items as $item) {
         $filter_menu->addAction($item);
     }
     $filter_button = id(new PHUIListItemView())->setName($active_filter)->setIcon('fa-search')->setHref('#')->addSigil('boards-dropdown-menu')->setMetadata(array('items' => hsprintf('%s', $filter_menu)));
     return $filter_button;
 }
開發者ID:rchicoli,項目名稱:phabricator,代碼行數:46,代碼來源:PhabricatorProjectBoardViewController.php


注:本文中的PhabricatorApplicationSearchEngine::getQueryResultsPageURI方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。