本文整理匯總了PHP中PHUIPropertyListView::setActionList方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHUIPropertyListView::setActionList方法的具體用法?PHP PHUIPropertyListView::setActionList怎麽用?PHP PHUIPropertyListView::setActionList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PHUIPropertyListView
的用法示例。
在下文中一共展示了PHUIPropertyListView::setActionList方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildPropertyListView
private function buildPropertyListView(DrydockBlueprint $blueprint, PhabricatorActionListView $actions)
{
$view = new PHUIPropertyListView();
$view->setActionList($actions);
$view->addProperty(pht('Type'), $blueprint->getImplementation()->getBlueprintName());
return $view;
}
示例2: buildPropertyListView
private function buildPropertyListView(DrydockLease $lease, PhabricatorActionListView $actions)
{
$viewer = $this->getViewer();
$view = new PHUIPropertyListView();
$view->setActionList($actions);
$view->addProperty(pht('Status'), DrydockLeaseStatus::getNameForStatus($lease->getStatus()));
$view->addProperty(pht('Resource Type'), $lease->getResourceType());
$resource_phid = $lease->getResourcePHID();
if ($resource_phid) {
$resource_display = $viewer->renderHandle($resource_phid);
} else {
$resource_display = phutil_tag('em', array(), pht('No Resource'));
}
$view->addProperty(pht('Resource'), $resource_display);
$until = $lease->getUntil();
if ($until) {
$until_display = phabricator_datetime($until, $viewer);
} else {
$until_display = phutil_tag('em', array(), pht('Never'));
}
$view->addProperty(pht('Expires'), $until_display);
$attributes = $lease->getAttributes();
if ($attributes) {
$view->addSectionHeader(pht('Attributes'), 'fa-list-ul');
foreach ($attributes as $key => $value) {
$view->addProperty($key, $value);
}
}
return $view;
}
示例3: buildPropertyListView
private function buildPropertyListView(PhabricatorWorkerTask $task, PhabricatorActionListView $actions)
{
$viewer = $this->getRequest()->getUser();
$view = new PHUIPropertyListView();
$view->setActionList($actions);
if ($task->isArchived()) {
switch ($task->getResult()) {
case PhabricatorWorkerArchiveTask::RESULT_SUCCESS:
$status = pht('Complete');
break;
case PhabricatorWorkerArchiveTask::RESULT_FAILURE:
$status = pht('Failed');
break;
case PhabricatorWorkerArchiveTask::RESULT_CANCELLED:
$status = pht('Cancelled');
break;
default:
throw new Exception('Unknown task status!');
}
} else {
$status = pht('Queued');
}
$view->addProperty(pht('Task Status'), $status);
$view->addProperty(pht('Task Class'), $task->getTaskClass());
if ($task->getLeaseExpires()) {
if ($task->getLeaseExpires() > time()) {
$lease_status = pht('Leased');
} else {
$lease_status = pht('Lease Expired');
}
} else {
$lease_status = phutil_tag('em', array(), pht('Not Leased'));
}
$view->addProperty(pht('Lease Status'), $lease_status);
$view->addProperty(pht('Lease Owner'), $task->getLeaseOwner() ? $task->getLeaseOwner() : phutil_tag('em', array(), pht('None')));
if ($task->getLeaseExpires() && $task->getLeaseOwner()) {
$expires = $task->getLeaseExpires() - time();
$expires = phutil_format_relative_time_detailed($expires);
} else {
$expires = phutil_tag('em', array(), pht('None'));
}
$view->addProperty(pht('Lease Expires'), $expires);
if ($task->isArchived()) {
$duration = number_format($task->getDuration()) . ' us';
} else {
$duration = phutil_tag('em', array(), pht('Not Completed'));
}
$view->addProperty(pht('Duration'), $duration);
$data = id(new PhabricatorWorkerTaskData())->load($task->getDataID());
$task->setData($data->getData());
$worker = $task->getWorkerInstance();
$data = $worker->renderForDisplay($viewer);
$view->addProperty(pht('Data'), $data);
return $view;
}
示例4: renderProperties
private function renderProperties(PhameBlog $blog, PhabricatorUser $user, PhabricatorActionListView $actions)
{
require_celerity_resource('aphront-tooltip-css');
Javelin::initBehavior('phabricator-tooltips');
$properties = new PHUIPropertyListView();
$properties->setActionList($actions);
$properties->addProperty(pht('Skin'), $blog->getSkin());
$properties->addProperty(pht('Domain'), $blog->getDomain());
$feed_uri = PhabricatorEnv::getProductionURI($this->getApplicationURI('blog/feed/' . $blog->getID() . '/'));
$properties->addProperty(pht('Atom URI'), javelin_tag('a', array('href' => $feed_uri, 'sigil' => 'has-tooltip', 'meta' => array('tip' => pht('Atom URI does not support custom domains.'), 'size' => 320)), $feed_uri));
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions($user, $blog);
$properties->addProperty(pht('Editable By'), $descriptions[PhabricatorPolicyCapability::CAN_EDIT]);
$properties->addProperty(pht('Joinable By'), $descriptions[PhabricatorPolicyCapability::CAN_JOIN]);
$engine = id(new PhabricatorMarkupEngine())->setViewer($user)->addObject($blog, PhameBlog::MARKUP_FIELD_DESCRIPTION)->process();
$properties->addTextContent(phutil_tag('div', array('class' => 'phabricator-remarkup'), $engine->getOutput($blog, PhameBlog::MARKUP_FIELD_DESCRIPTION)));
return $properties;
}
示例5: buildPropertyListView
private function buildPropertyListView(DrydockResource $resource, PhabricatorActionListView $actions)
{
$view = new PHUIPropertyListView();
$view->setActionList($actions);
$status = $resource->getStatus();
$status = DrydockResourceStatus::getNameForStatus($status);
$view->addProperty(pht('Status'), $status);
$view->addProperty(pht('Resource Type'), $resource->getType());
// TODO: Load handle.
$view->addProperty(pht('Blueprint'), $resource->getBlueprintPHID());
$attributes = $resource->getAttributes();
if ($attributes) {
$view->addSectionHeader(pht('Attributes'));
foreach ($attributes as $key => $value) {
$view->addProperty($key, $value);
}
}
return $view;
}
示例6: buildPropertyListView
private function buildPropertyListView(DrydockLease $lease, PhabricatorActionListView $actions)
{
$view = new PHUIPropertyListView();
$view->setActionList($actions);
switch ($lease->getStatus()) {
case DrydockLeaseStatus::STATUS_ACTIVE:
$status = pht('Active');
break;
case DrydockLeaseStatus::STATUS_RELEASED:
$status = pht('Released');
break;
case DrydockLeaseStatus::STATUS_EXPIRED:
$status = pht('Expired');
break;
case DrydockLeaseStatus::STATUS_PENDING:
$status = pht('Pending');
break;
case DrydockLeaseStatus::STATUS_BROKEN:
$status = pht('Broken');
break;
default:
$status = pht('Unknown');
break;
}
$view->addProperty(pht('Status'), $status);
$view->addProperty(pht('Resource Type'), $lease->getResourceType());
$view->addProperty(pht('Resource'), $lease->getResourceID());
$attributes = $lease->getAttributes();
if ($attributes) {
$view->addSectionHeader(pht('Attributes'));
foreach ($attributes as $key => $value) {
$view->addProperty($key, $value);
}
}
return $view;
}