本文整理汇总了PHP中PhabricatorApplicationSearchResultView::setNoDataString方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationSearchResultView::setNoDataString方法的具体用法?PHP PhabricatorApplicationSearchResultView::setNoDataString怎么用?PHP PhabricatorApplicationSearchResultView::setNoDataString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorApplicationSearchResultView
的用法示例。
在下文中一共展示了PhabricatorApplicationSearchResultView::setNoDataString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderResultList
protected function renderResultList(array $countdowns, PhabricatorSavedQuery $query, array $handles)
{
assert_instances_of($countdowns, 'PhabricatorCountdown');
$viewer = $this->requireViewer();
$list = new PHUIObjectItemListView();
$list->setUser($viewer);
foreach ($countdowns as $countdown) {
$id = $countdown->getID();
$ended = false;
$epoch = $countdown->getEpoch();
if ($epoch <= PhabricatorTime::getNow()) {
$ended = true;
}
$item = id(new PHUIObjectItemView())->setUser($viewer)->setObject($countdown)->setObjectName("C{$id}")->setHeader($countdown->getTitle())->setHref($this->getApplicationURI("{$id}/"))->addByline(pht('Created by %s', $handles[$countdown->getAuthorPHID()]->renderLink()));
if ($ended) {
$item->addAttribute(pht('Launched on %s', phabricator_datetime($epoch, $viewer)));
$item->setDisabled(true);
} else {
$time_left = $epoch - PhabricatorTime::getNow();
$num = round($time_left / (60 * 60 * 24));
$noun = pht('Days');
if ($num < 1) {
$num = round($time_left / (60 * 60), 1);
$noun = pht('Hours');
}
$item->setCountdown($num, $noun);
$item->addAttribute(phabricator_datetime($epoch, $viewer));
}
$list->addItem($item);
}
$result = new PhabricatorApplicationSearchResultView();
$result->setObjectList($list);
$result->setNoDataString(pht('No countdowns found.'));
return $result;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例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;
}
示例10: 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;
}
示例11: 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;
}
示例12: 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;
}
示例13: renderResultList
protected function renderResultList(array $networks, PhabricatorSavedQuery $query, array $handles)
{
assert_instances_of($networks, 'AlmanacNetwork');
$viewer = $this->requireViewer();
$list = new PHUIObjectItemListView();
$list->setUser($viewer);
foreach ($networks as $network) {
$id = $network->getID();
$item = id(new PHUIObjectItemView())->setObjectName(pht('Network %d', $id))->setHeader($network->getName())->setHref($this->getApplicationURI("network/{$id}/"))->setObject($network);
$list->addItem($item);
}
$result = new PhabricatorApplicationSearchResultView();
$result->setObjectList($list);
$result->setNoDataString(pht('No Almanac Networks found.'));
return $result;
}
示例14: 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;
}
示例15: renderResultList
protected function renderResultList(array $items, PhabricatorSavedQuery $query, array $handles)
{
assert_instances_of($items, 'NuanceItem');
$viewer = $this->requireViewer();
$list = new PHUIObjectItemListView();
$list->setUser($viewer);
foreach ($items as $item) {
$impl = $item->getImplementation();
$view = id(new PHUIObjectItemView())->setObjectName(pht('Item %d', $item->getID()))->setHeader($item->getDisplayName())->setHref($item->getURI());
$view->addIcon($impl->getItemTypeDisplayIcon(), $impl->getItemTypeDisplayName());
$list->addItem($view);
}
$result = new PhabricatorApplicationSearchResultView();
$result->setObjectList($list);
$result->setNoDataString(pht('No items found.'));
return $result;
}