Changeset View
Changeset View
Standalone View
Standalone View
src/applications/nuance/item/NuanceGitHubEventItemType.php
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | switch ($action) { | ||||
->setTitle(pht('GitHub Raw Event')) | ->setTitle(pht('GitHub Raw Event')) | ||||
->appendForm($form) | ->appendForm($form) | ||||
->addCancelButton($item->getURI(), pht('Done')); | ->addCancelButton($item->getURI(), pht('Done')); | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
protected function newItemView(NuanceItem $item) { | |||||
$content = array(); | |||||
$content[] = $this->newGitHubEventItemPropertyBox($item); | |||||
return $content; | |||||
} | |||||
private function newGitHubEventItemPropertyBox($item) { | |||||
$viewer = $this->getViewer(); | |||||
$property_list = id(new PHUIPropertyListView()) | |||||
->setViewer($viewer); | |||||
$event = $this->newRawEvent($item); | |||||
$property_list->addProperty( | |||||
pht('GitHub Event ID'), | |||||
$event->getID()); | |||||
$event_uri = $event->getURI(); | |||||
if ($event_uri && PhabricatorEnv::isValidRemoteURIForLink($event_uri)) { | |||||
$event_uri = phutil_tag( | |||||
'a', | |||||
array( | |||||
'href' => $event_uri, | |||||
), | |||||
$event_uri); | |||||
} | |||||
if ($event_uri) { | |||||
$property_list->addProperty( | |||||
pht('GitHub Event URI'), | |||||
$event_uri); | |||||
} | |||||
return id(new PHUIObjectBoxView()) | |||||
->setHeaderText(pht('Event Properties')) | |||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | |||||
->appendChild($property_list); | |||||
} | |||||
} | } |