Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/controller/HeraldTranscriptController.php
Show First 20 Lines • Show All 441 Lines • ▼ Show 20 Lines | private function buildActionTranscriptPanel(HeraldTranscript $xscript) { | ||||
$box = id(new PHUIObjectBoxView()) | $box = id(new PHUIObjectBoxView()) | ||||
->setHeaderText(pht('Rule Transcript')) | ->setHeaderText(pht('Rule Transcript')) | ||||
->appendChild($rule_list); | ->appendChild($rule_list); | ||||
return $box; | return $box; | ||||
} | } | ||||
private function buildObjectTranscriptPanel(HeraldTranscript $xscript) { | private function buildObjectTranscriptPanel(HeraldTranscript $xscript) { | ||||
$viewer = $this->getViewer(); | |||||
$adapter = $this->getAdapter(); | $adapter = $this->getAdapter(); | ||||
$field_names = $adapter->getFieldNameMap(); | $field_names = $adapter->getFieldNameMap(); | ||||
$object_xscript = $xscript->getObjectTranscript(); | $object_xscript = $xscript->getObjectTranscript(); | ||||
$rows = array(); | $rows = array(); | ||||
if ($object_xscript) { | if ($object_xscript) { | ||||
$phid = $object_xscript->getPHID(); | $phid = $object_xscript->getPHID(); | ||||
$handles = $this->handles; | $handles = $this->handles; | ||||
Show All 22 Lines | private function buildObjectTranscriptPanel(HeraldTranscript $xscript) { | ||||
foreach ($xscript->getMetadataMap() as $key => $value) { | foreach ($xscript->getMetadataMap() as $key => $value) { | ||||
$rows[] = array( | $rows[] = array( | ||||
$key, | $key, | ||||
$value, | $value, | ||||
); | ); | ||||
} | } | ||||
if ($object_xscript) { | if ($object_xscript) { | ||||
foreach ($object_xscript->getFields() as $field => $value) { | foreach ($object_xscript->getFields() as $field_type => $value) { | ||||
if (isset($field_names[$field])) { | if (isset($field_names[$field_type])) { | ||||
$field_name = pht('Field: %s', $field_names[$field]); | $field_name = pht('Field: %s', $field_names[$field_type]); | ||||
} else { | } else { | ||||
$field_name = pht('Unknown Field ("%s")', $field_name); | $field_name = pht('Unknown Field ("%s")', $field_type); | ||||
} | |||||
if (!is_scalar($value) && !is_null($value)) { | |||||
$value = implode("\n", $value); | |||||
} | } | ||||
if (strlen($value) > 256) { | $field_value = $adapter->renderFieldTranscriptValue( | ||||
$value = phutil_tag( | $viewer, | ||||
'textarea', | $field_type, | ||||
array( | |||||
'class' => 'herald-field-value-transcript', | |||||
), | |||||
$value); | $value); | ||||
} | |||||
$rows[] = array( | $rows[] = array( | ||||
$field_name, | $field_name, | ||||
$value, | $field_value, | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
$property_list = new PHUIPropertyListView(); | $property_list = new PHUIPropertyListView(); | ||||
$property_list->setStacked(true); | $property_list->setStacked(true); | ||||
foreach ($rows as $row) { | foreach ($rows as $row) { | ||||
$property_list->addProperty($row[0], $row[1]); | $property_list->addProperty($row[0], $row[1]); | ||||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |