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


PHP PhabricatorApplicationSearchResultView類代碼示例

本文整理匯總了PHP中PhabricatorApplicationSearchResultView的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorApplicationSearchResultView類的具體用法?PHP PhabricatorApplicationSearchResultView怎麽用?PHP PhabricatorApplicationSearchResultView使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: renderResultList

 protected function renderResultList(array $posts, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($posts, 'PhamePost');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($posts as $post) {
         $id = $post->getID();
         $blog = $post->getBlog();
         $blog_name = $viewer->renderHandle($post->getBlogPHID())->render();
         $blog_name = pht('Blog: %s', $blog_name);
         $item = id(new PHUIObjectItemView())->setUser($viewer)->setObject($post)->setHeader($post->getTitle())->setStatusIcon('fa-star')->setHref($post->getViewURI())->addAttribute($blog_name);
         if ($post->isDraft()) {
             $item->setStatusIcon('fa-star-o grey');
             $item->setDisabled(true);
             $item->addIcon('none', pht('Draft Post'));
         } else {
             $date = $post->getDatePublished();
             $item->setEpoch($date);
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No blogs posts found.'));
     return $result;
 }
開發者ID:truSense,項目名稱:phabricator,代碼行數:27,代碼來源:PhamePostSearchEngine.php

示例2: renderResultList

 protected function renderResultList(array $dashboards, PhabricatorSavedQuery $query, array $handles)
 {
     $dashboards = mpull($dashboards, null, 'getPHID');
     $viewer = $this->requireViewer();
     if ($dashboards) {
         $installs = id(new PhabricatorDashboardInstall())->loadAllWhere('objectPHID IN (%Ls) AND dashboardPHID IN (%Ls)', array(PhabricatorHomeApplication::DASHBOARD_DEFAULT, $viewer->getPHID()), array_keys($dashboards));
         $installs = mpull($installs, null, 'getDashboardPHID');
     } else {
         $installs = array();
     }
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     $list->initBehavior('phabricator-tooltips', array());
     $list->requireResource('aphront-tooltip-css');
     foreach ($dashboards as $dashboard_phid => $dashboard) {
         $id = $dashboard->getID();
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Dashboard %d', $id))->setHeader($dashboard->getName())->setHref($this->getApplicationURI("view/{$id}/"))->setObject($dashboard);
         if (isset($installs[$dashboard_phid])) {
             $install = $installs[$dashboard_phid];
             if ($install->getObjectPHID() == $viewer->getPHID()) {
                 $attrs = array('tip' => pht('This dashboard is installed to your personal homepage.'));
                 $item->addIcon('fa-user', pht('Installed'), $attrs);
             } else {
                 $attrs = array('tip' => pht('This dashboard is the default homepage for all users.'));
                 $item->addIcon('fa-globe', pht('Installed'), $attrs);
             }
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No dashboards found.'));
     return $result;
 }
開發者ID:kristain,項目名稱:phabricator,代碼行數:34,代碼來源:PhabricatorDashboardSearchEngine.php

示例3: renderResultList

 protected function renderResultList(array $blogs, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($blogs, 'PhameBlog');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($blogs as $blog) {
         $id = $blog->getID();
         if ($blog->getDomain()) {
             $domain = $blog->getDomain();
         } else {
             $domain = pht('Local Blog');
         }
         $item = id(new PHUIObjectItemView())->setUser($viewer)->setObject($blog)->setHeader($blog->getName())->setImageURI($blog->getProfileImageURI())->setDisabled($blog->isArchived())->setHref($this->getApplicationURI("/blog/view/{$id}/"))->addAttribute($domain);
         if (!$blog->isArchived()) {
             $button = id(new PHUIButtonView())->setTag('a')->setText('New Post')->setHref($this->getApplicationURI('/post/edit/?blog=' . $id));
             $item->setLaunchButton($button);
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No blogs found.'));
     return $result;
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:25,代碼來源:PhameBlogSearchEngine.php

示例4: renderResultList

 protected function renderResultList(array $authorizations, PhabricatorSavedQuery $query, array $handles)
 {
     $list = id(new DrydockAuthorizationListView())->setUser($this->requireViewer())->setAuthorizations($authorizations);
     $result = new PhabricatorApplicationSearchResultView();
     $result->setTable($list);
     return $result;
 }
開發者ID:NeoArmageddon,項目名稱:phabricator,代碼行數:7,代碼來源:DrydockAuthorizationSearchEngine.php

示例5: renderResultList

 protected function renderResultList(array $notifications, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($notifications, 'PhabricatorFeedStory');
     $viewer = $this->requireViewer();
     $image = id(new PHUIIconView())->setIconFont('fa-eye-slash');
     $button = id(new PHUIButtonView())->setTag('a')->addSigil('workflow')->setColor(PHUIButtonView::SIMPLE)->setIcon($image)->setText(pht('Mark All Read'));
     switch ($query->getQueryKey()) {
         case 'unread':
             $header = pht('Unread Notifications');
             $no_data = pht('You have no unread notifications.');
             break;
         default:
             $header = pht('Notifications');
             $no_data = pht('You have no notifications.');
             break;
     }
     $clear_uri = id(new PhutilURI('/notification/clear/'));
     if ($notifications) {
         $builder = id(new PhabricatorNotificationBuilder($notifications))->setUser($viewer);
         $view = $builder->buildView();
         $clear_uri->setQueryParam('chronoKey', head($notifications)->getChronologicalKey());
     } else {
         $view = phutil_tag_div('phabricator-notification no-notifications', $no_data);
         $button->setDisabled(true);
     }
     $button->setHref((string) $clear_uri);
     $view = id(new PHUIBoxView())->addPadding(PHUI::PADDING_MEDIUM)->addClass('phabricator-notification-list')->appendChild($view);
     $result = new PhabricatorApplicationSearchResultView();
     $result->addAction($button);
     $result->setContent($view);
     return $result;
 }
開發者ID:patelhardik,項目名稱:phabricator,代碼行數:32,代碼來源:PhabricatorNotificationSearchEngine.php

示例6: renderResultList

 protected function renderResultList(array $panels, PhabricatorSavedQuery $query, array $handles)
 {
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($panels as $panel) {
         $item = id(new PHUIObjectItemView())->setObjectName($panel->getMonogram())->setHeader($panel->getName())->setHref('/' . $panel->getMonogram())->setObject($panel);
         $impl = $panel->getImplementation();
         if ($impl) {
             $type_text = $impl->getPanelTypeName();
         } else {
             $type_text = nonempty($panel->getPanelType(), pht('Unknown Type'));
         }
         $item->addAttribute($type_text);
         $properties = $panel->getProperties();
         $class = idx($properties, 'class');
         $item->addAttribute($class);
         if ($panel->getIsArchived()) {
             $item->setDisabled(true);
         }
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No panels found.'));
     return $result;
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:27,代碼來源:PhabricatorDashboardPanelSearchEngine.php

示例7: renderResultList

 protected function renderResultList(array $plans, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($plans, 'HarbormasterBuildPlan');
     $viewer = $this->requireViewer();
     if ($plans) {
         $edge_query = id(new PhabricatorEdgeQuery())->withSourcePHIDs(mpull($plans, 'getPHID'))->withEdgeTypes(array(PhabricatorProjectObjectHasProjectEdgeType::EDGECONST));
         $edge_query->execute();
     }
     $list = new PHUIObjectItemListView();
     foreach ($plans as $plan) {
         $id = $plan->getID();
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Plan %d', $id))->setHeader($plan->getName());
         if ($plan->isDisabled()) {
             $item->setDisabled(true);
         }
         if ($plan->isAutoplan()) {
             $item->addIcon('fa-lock grey', pht('Autoplan'));
         }
         $item->setHref($this->getApplicationURI("plan/{$id}/"));
         $phid = $plan->getPHID();
         $project_phids = $edge_query->getDestinationPHIDs(array($phid));
         $project_handles = $viewer->loadHandles($project_phids);
         $item->addAttribute(id(new PHUIHandleTagListView())->setLimit(4)->setNoDataString(pht('No Projects'))->setSlim(true)->setHandles($project_handles));
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No build plans found.'));
     return $result;
 }
開發者ID:rchicoli,項目名稱:phabricator,代碼行數:30,代碼來源:HarbormasterBuildPlanSearchEngine.php

示例8: renderResultList

 protected function renderResultList(array $invites, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($invites, 'PhabricatorAuthInvite');
     $viewer = $this->requireViewer();
     $rows = array();
     foreach ($invites as $invite) {
         $rows[] = array($invite->getEmailAddress(), $handles[$invite->getAuthorPHID()]->renderLink(), $invite->getAcceptedByPHID() ? $handles[$invite->getAcceptedByPHID()]->renderLink() : null, phabricator_datetime($invite->getDateCreated(), $viewer));
     }
     $table = id(new AphrontTableView($rows))->setHeaders(array(pht('Email Address'), pht('Sent By'), pht('Accepted By'), pht('Invited')))->setColumnClasses(array('', '', 'wide', 'right'));
     $result = new PhabricatorApplicationSearchResultView();
     $result->setTable($table);
     return $result;
 }
開發者ID:truSense,項目名稱:phabricator,代碼行數:13,代碼來源:PhabricatorAuthInviteSearchEngine.php

示例9: renderResultList

 protected function renderResultList(array $clients, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($clients, 'PhabricatorOauthServerClient');
     $viewer = $this->requireViewer();
     $list = id(new PHUIObjectItemListView())->setUser($viewer);
     foreach ($clients as $client) {
         $creator = $handles[$client->getCreatorPHID()];
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Application %d', $client->getID()))->setHeader($client->getName())->setHref($client->getViewURI())->setObject($client)->addByline(pht('Creator: %s', $creator->renderLink()));
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No clients found.'));
     return $result;
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:15,代碼來源:PhabricatorOAuthServerClientSearchEngine.php

示例10: renderResultList

 protected function renderResultList(array $urls, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($urls, 'PhabricatorPhurlURL');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $handles = $viewer->loadHandles(mpull($urls, 'getAuthorPHID'));
     foreach ($urls as $url) {
         $item = id(new PHUIObjectItemView())->setUser($viewer)->setObject($url)->setHeader($viewer->renderHandle($url->getPHID()));
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No URLs found.'));
     return $result;
 }
開發者ID:truSense,項目名稱:phabricator,代碼行數:15,代碼來源:PhabricatorPhurlURLSearchEngine.php

示例11: renderResultList

 protected function renderResultList(array $packages, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($packages, 'PhabricatorOwnersPackage');
     $viewer = $this->requireViewer();
     $list = id(new PHUIObjectItemListView())->setUser($viewer);
     foreach ($packages as $package) {
         $id = $package->getID();
         $item = id(new PHUIObjectItemView())->setObject($package)->setObjectName(pht('Package %d', $id))->setHeader($package->getName())->setHref('/owners/package/' . $id . '/');
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No packages found.'));
     return $result;
 }
開發者ID:JohnnyEstilles,項目名稱:phabricator,代碼行數:15,代碼來源:PhabricatorOwnersPackageSearchEngine.php

示例12: renderResultList

 protected function renderResultList(array $merchants, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($merchants, 'PhortuneMerchant');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($merchants as $merchant) {
         $item = id(new PHUIObjectItemView())->setSubhead(pht('Merchant %d', $merchant->getID()))->setHeader($merchant->getName())->setHref('/phortune/merchant/' . $merchant->getID() . '/')->setObject($merchant)->setImageIcon('fa-bank');
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No merchants found.'));
     return $result;
 }
開發者ID:endlessm,項目名稱:phabricator,代碼行數:15,代碼來源:PhortuneMerchantSearchEngine.php

示例13: renderResultList

 protected function renderResultList(array $queues, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($queues, 'NuanceQueue');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($queues as $queue) {
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Queue %d', $queue->getID()))->setHeader($queue->getName())->setHref($queue->getURI());
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No queues found.'));
     return $result;
 }
開發者ID:rchicoli,項目名稱:phabricator,代碼行數:15,代碼來源:NuanceQueueSearchEngine.php

示例14: renderResultList

 protected function renderResultList(array $services, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($services, 'AlmanacService');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($services as $service) {
         $item = id(new PHUIObjectItemView())->setObjectName(pht('Service %d', $service->getID()))->setHeader($service->getName())->setHref($service->getURI())->setObject($service)->addIcon($service->getServiceImplementation()->getServiceTypeIcon(), $service->getServiceImplementation()->getServiceTypeShortName());
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No Almanac Services found.'));
     return $result;
 }
開發者ID:Houzz,項目名稱:phabricator,代碼行數:15,代碼來源:AlmanacServiceSearchEngine.php

示例15: renderResultList

 protected function renderResultList(array $blogs, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($blogs, 'PhameBlog');
     $viewer = $this->requireViewer();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($blogs as $blog) {
         $id = $blog->getID();
         $item = id(new PHUIObjectItemView())->setUser($viewer)->setObject($blog)->setHeader($blog->getName())->setStatusIcon('fa-star')->setHref($this->getApplicationURI("/blog/view/{$id}/"))->addAttribute($blog->getSkin())->addAttribute($blog->getDomain());
         $list->addItem($item);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setObjectList($list);
     $result->setNoDataString(pht('No blogs found.'));
     return $result;
 }
開發者ID:fengshao0907,項目名稱:phabricator,代碼行數:16,代碼來源:PhameBlogSearchEngine.php


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