本文整理匯總了PHP中PHUIPropertyListView類的典型用法代碼示例。如果您正苦於以下問題:PHP PHUIPropertyListView類的具體用法?PHP PHUIPropertyListView怎麽用?PHP PHUIPropertyListView使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了PHUIPropertyListView類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: renderItemCommonProperties
private function renderItemCommonProperties(PhabricatorUser $viewer, NuanceItem $item, PHUIPropertyListView $view)
{
$complaint = $item->getNuanceProperty('complaint');
$complaint = new PHUIRemarkupView($viewer, $complaint);
$view->addSectionHeader(pht('Complaint'), 'fa-exclamation-circle');
$view->addTextContent($complaint);
}
示例3: renderItemCommonProperties
private function renderItemCommonProperties(PhabricatorUser $viewer, NuanceItem $item, PHUIPropertyListView $view)
{
$complaint = $item->getNuanceProperty('complaint');
$complaint = PhabricatorMarkupEngine::renderOneObject(id(new PhabricatorMarkupOneOff())->setContent($complaint), 'default', $viewer);
$view->addSectionHeader(pht('Complaint'), 'fa-exclamation-circle');
$view->addTextContent($complaint);
}
示例4: buildDocument
private function buildDocument(PhabricatorMarkupEngine $engine, LegalpadDocumentBody $body)
{
$view = new PHUIPropertyListView();
$view->addClass('legalpad');
$view->addSectionHeader(pht('Document'));
$view->addTextContent($engine->getOutput($body, LegalpadDocumentBody::MARKUP_FIELD_TEXT));
return $view;
}
示例5: buildPropertyListView
private function buildPropertyListView(DrydockRepositoryOperation $operation)
{
$viewer = $this->getViewer();
$view = new PHUIPropertyListView();
$view->addProperty(pht('Repository'), $viewer->renderHandle($operation->getRepositoryPHID()));
$view->addProperty(pht('Object'), $viewer->renderHandle($operation->getObjectPHID()));
return $view;
}
示例6: buildPropertyList
private function buildPropertyList(PhabricatorRepositoryPushEvent $event)
{
$viewer = $this->getRequest()->getUser();
$view = new PHUIPropertyListView();
$view->addProperty(pht('Pushed At'), phabricator_datetime($event->getEpoch(), $viewer));
$view->addProperty(pht('Pushed By'), $viewer->renderHandle($event->getPusherPHID()));
$view->addProperty(pht('Pushed Via'), $event->getRemoteProtocol());
return $view;
}
示例7: addPropertyList
public function addPropertyList(PHUIPropertyListView $property_list)
{
$this->propertyLists[] = $property_list;
$action_list = $property_list->getActionList();
if ($action_list) {
$this->actionListID = celerity_generate_unique_node_id();
$action_list->setId($this->actionListID);
}
return $this;
}
示例8: 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;
}
示例9: buildPropertyListView
private function buildPropertyListView(DrydockAuthorization $authorization)
{
$viewer = $this->getViewer();
$object_phid = $authorization->getObjectPHID();
$handles = $viewer->loadHandles(array($object_phid));
$handle = $handles[$object_phid];
$view = new PHUIPropertyListView();
$view->addProperty(pht('Authorized Object'), $handle->renderLink($handle->getFullName()));
$view->addProperty(pht('Object Type'), $handle->getTypeName());
$object_state = $authorization->getObjectAuthorizationState();
$view->addProperty(pht('Authorization State'), DrydockAuthorization::getObjectStateName($object_state));
return $view;
}
示例10: buildPropertyListView
private function buildPropertyListView(DrydockResource $resource)
{
$viewer = $this->getViewer();
$view = new PHUIPropertyListView();
$status = $resource->getStatus();
$status = DrydockResourceStatus::getNameForStatus($status);
$view->addProperty(pht('Status'), $status);
$until = $resource->getUntil();
if ($until) {
$until_display = phabricator_datetime($until, $viewer);
} else {
$until_display = phutil_tag('em', array(), pht('Never'));
}
$view->addProperty(pht('Expires'), $until_display);
$view->addProperty(pht('Resource Type'), $resource->getType());
$view->addProperty(pht('Blueprint'), $viewer->renderHandle($resource->getBlueprintPHID()));
$attributes = $resource->getAttributes();
if ($attributes) {
$view->addSectionHeader(pht('Attributes'), 'fa-list-ul');
foreach ($attributes as $key => $value) {
$view->addProperty($key, $value);
}
}
return $view;
}
示例11: buildPropertyListView
private function buildPropertyListView(DrydockRepositoryOperation $operation)
{
$viewer = $this->getViewer();
$view = new PHUIPropertyListView();
$view->addProperty(pht('Repository'), $viewer->renderHandle($operation->getRepositoryPHID()));
$view->addProperty(pht('Object'), $viewer->renderHandle($operation->getObjectPHID()));
$lease_phid = $operation->getWorkingCopyLeasePHID();
if ($lease_phid) {
$lease_display = $viewer->renderHandle($lease_phid);
} else {
$lease_display = phutil_tag('em', array(), pht('None'));
}
$view->addProperty(pht('Working Copy'), $lease_display);
return $view;
}
示例12: appendImportProperties
public function appendImportProperties(PhabricatorUser $viewer, PhabricatorCalendarImport $import, PHUIPropertyListView $properties)
{
$uri_key = PhabricatorCalendarImportICSURITransaction::PARAMKEY_URI;
$uri = $import->getParameter($uri_key);
// Since the URI may contain a secret hash, don't show it to users who
// can not edit the import.
$can_edit = PhabricatorPolicyFilter::hasCapability($viewer, $import, PhabricatorPolicyCapability::CAN_EDIT);
if (!$can_edit) {
$uri_display = phutil_tag('em', array(), pht('Restricted'));
} else {
if (!PhabricatorEnv::isValidRemoteURIForLink($uri)) {
$uri_display = $uri;
} else {
$uri_display = phutil_tag('a', array('href' => $uri, 'target' => '_blank'), $uri);
}
}
$properties->addProperty(pht('Source URI'), $uri_display);
}
示例13: processRequest
public function processRequest()
{
$request = $this->getRequest();
$user = $request->getUser();
$macro = id(new PhabricatorMacroQuery())->setViewer($user)->withIDs(array($this->id))->needFiles(true)->executeOne();
if (!$macro) {
return new Aphront404Response();
}
$file = $macro->getFile();
$title_short = pht('Macro "%s"', $macro->getName());
$title_long = pht('Image Macro "%s"', $macro->getName());
$actions = $this->buildActionView($macro);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->setActionList($actions);
$crumbs->addTextCrumb($title_short, $this->getApplicationURI('/view/' . $macro->getID() . '/'));
$properties = $this->buildPropertyView($macro, $actions);
if ($file) {
$file_view = new PHUIPropertyListView();
$file_view->addImageContent(phutil_tag('img', array('src' => $file->getViewURI(), 'class' => 'phabricator-image-macro-hero')));
}
$xactions = id(new PhabricatorMacroTransactionQuery())->setViewer($request->getUser())->withObjectPHIDs(array($macro->getPHID()))->execute();
$engine = id(new PhabricatorMarkupEngine())->setViewer($user);
foreach ($xactions as $xaction) {
if ($xaction->getComment()) {
$engine->addObject($xaction->getComment(), PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
}
}
$engine->process();
$timeline = id(new PhabricatorApplicationTransactionView())->setUser($user)->setObjectPHID($macro->getPHID())->setTransactions($xactions)->setMarkupEngine($engine);
$header = id(new PHUIHeaderView())->setUser($user)->setPolicyObject($macro)->setHeader($title_long);
if ($macro->getIsDisabled()) {
$header->addTag(id(new PHUITagView())->setType(PHUITagView::TYPE_STATE)->setName(pht('Macro Disabled'))->setBackgroundColor(PHUITagView::COLOR_BLACK));
}
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
$comment_header = $is_serious ? pht('Add Comment') : pht('Grovel in Awe');
$draft = PhabricatorDraft::newFromUserAndKey($user, $macro->getPHID());
$add_comment_form = id(new PhabricatorApplicationTransactionCommentView())->setUser($user)->setObjectPHID($macro->getPHID())->setDraft($draft)->setHeaderText($comment_header)->setAction($this->getApplicationURI('/comment/' . $macro->getID() . '/'))->setSubmitButtonName(pht('Add Comment'));
$object_box = id(new PHUIObjectBoxView())->setHeader($header)->addPropertyList($properties);
if ($file_view) {
$object_box->addPropertyList($file_view);
}
return $this->buildApplicationPage(array($crumbs, $object_box, $timeline, $add_comment_form), array('title' => $title_short));
}
示例14: 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;
}
示例15: renderCommonProperties
private function renderCommonProperties(PHUIPropertyListView $properties, PhabricatorCacheSpec $cache)
{
if ($cache->getName() !== null) {
$name = $this->renderYes($cache->getName());
} else {
$name = $this->renderNo(pht('None'));
}
$properties->addProperty(pht('Cache'), $name);
if ($cache->getIsEnabled()) {
$enabled = $this->renderYes(pht('Enabled'));
} else {
$enabled = $this->renderNo(pht('Not Enabled'));
}
$properties->addProperty(pht('Enabled'), $enabled);
$version = $cache->getVersion();
if ($version) {
$properties->addProperty(pht('Version'), $this->renderInfo($version));
}
if ($cache->getName() === null) {
return;
}
$mem_total = $cache->getTotalMemory();
$mem_used = $cache->getUsedMemory();
if ($mem_total) {
$percent = 100 * ($mem_used / $mem_total);
$properties->addProperty(pht('Memory Usage'), pht('%s of %s', phutil_tag('strong', array(), sprintf('%.1f%%', $percent)), phutil_format_bytes($mem_total)));
}
$entry_count = $cache->getEntryCount();
if ($entry_count !== null) {
$properties->addProperty(pht('Cache Entries'), pht('%s', new PhutilNumber($entry_count)));
}
}