当前位置: 首页>>代码示例>>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;未经允许,请勿转载。