本文整理汇总了PHP中PhabricatorApplicationSearchResultView::addAction方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationSearchResultView::addAction方法的具体用法?PHP PhabricatorApplicationSearchResultView::addAction怎么用?PHP PhabricatorApplicationSearchResultView::addAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorApplicationSearchResultView
的用法示例。
在下文中一共展示了PhabricatorApplicationSearchResultView::addAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: renderResultList
protected function renderResultList(array $signatures, PhabricatorSavedQuery $query, array $handles)
{
assert_instances_of($signatures, 'LegalpadDocumentSignature');
$viewer = $this->requireViewer();
Javelin::initBehavior('phabricator-tooltips');
$sig_good = $this->renderIcon('fa-check', null, pht('Verified, Current'));
$sig_corp = $this->renderIcon('fa-building-o', null, pht('Verified, Corporate'));
$sig_old = $this->renderIcon('fa-clock-o', 'orange', pht('Signed Older Version'));
$sig_unverified = $this->renderIcon('fa-envelope', 'red', pht('Unverified Email'));
$sig_exemption = $this->renderIcon('fa-asterisk', 'indigo', pht('Exemption'));
id(new PHUIIconView())->setIcon('fa-envelope', 'red')->addSigil('has-tooltip')->setMetadata(array('tip' => pht('Unverified Email')));
$type_corporate = LegalpadDocument::SIGNATURE_TYPE_CORPORATION;
$rows = array();
foreach ($signatures as $signature) {
$name = $signature->getSignerName();
$email = $signature->getSignerEmail();
$document = $signature->getDocument();
if ($signature->getIsExemption()) {
$sig_icon = $sig_exemption;
} else {
if (!$signature->isVerified()) {
$sig_icon = $sig_unverified;
} else {
if ($signature->getDocumentVersion() != $document->getVersions()) {
$sig_icon = $sig_old;
} else {
if ($signature->getSignatureType() == $type_corporate) {
$sig_icon = $sig_corp;
} else {
$sig_icon = $sig_good;
}
}
}
}
$signature_href = $this->getApplicationURI('signature/' . $signature->getID() . '/');
$sig_icon = javelin_tag('a', array('href' => $signature_href, 'sigil' => 'workflow'), $sig_icon);
$signer_phid = $signature->getSignerPHID();
$rows[] = array($sig_icon, $handles[$document->getPHID()]->renderLink(), $signer_phid ? $handles[$signer_phid]->renderLink() : null, $name, phutil_tag('a', array('href' => 'mailto:' . $email), $email), phabricator_datetime($signature->getDateCreated(), $viewer));
}
$table = id(new AphrontTableView($rows))->setNoDataString(pht('No signatures match the query.'))->setHeaders(array('', pht('Document'), pht('Account'), pht('Name'), pht('Email'), pht('Signed')))->setColumnVisibility(array(true, !$this->document))->setColumnClasses(array('', '', '', '', 'wide', 'right'));
$button = null;
if ($this->document) {
$document_id = $this->document->getID();
$button = id(new PHUIButtonView())->setText(pht('Add Exemption'))->setTag('a')->setHref($this->getApplicationURI('addsignature/' . $document_id . '/'))->setWorkflow(true)->setIcon('fa-pencil');
}
if (!$this->document) {
$table->setNotice(pht('NOTE: You can only see your own signatures and signatures on ' . 'documents you have permission to edit.'));
}
$result = new PhabricatorApplicationSearchResultView();
$result->setTable($table);
if ($button) {
$result->addAction($button);
}
return $result;
}