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