Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
index c8d42f6629..2c949564ef 100644
--- a/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelEditController.php
@@ -1,193 +1,204 @@
<?php
final class PhabricatorDashboardPanelEditController
extends PhabricatorDashboardController {
private $id;
public function willProcessRequest(array $data) {
$this->id = idx($data, 'id');
}
public function processRequest() {
$request = $this->getRequest();
$viewer = $request->getUser();
if ($this->id) {
$is_create = false;
$panel = id(new PhabricatorDashboardPanelQuery())
->setViewer($viewer)
->withIDs(array($this->id))
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
PhabricatorPolicyCapability::CAN_EDIT,
))
->executeOne();
if (!$panel) {
return new Aphront404Response();
}
} else {
$is_create = true;
$panel = PhabricatorDashboardPanel::initializeNewPanel($viewer);
$types = PhabricatorDashboardPanelType::getAllPanelTypes();
$type = $request->getStr('type');
if (empty($types[$type])) {
return new Aphront404Response();
}
$panel->setPanelType($type);
}
if ($is_create) {
$title = pht('New Panel');
$header = pht('Create New Panel');
$button = pht('Create Panel');
$cancel_uri = $this->getApplicationURI('panel/');
} else {
$title = pht('Edit %s', $panel->getMonogram());
$header = pht('Edit %s %s', $panel->getMonogram(), $panel->getName());
$button = pht('Save Panel');
$cancel_uri = $this->getPanelRedirectURI($panel);
}
$v_name = $panel->getName();
$e_name = true;
$field_list = PhabricatorCustomField::getObjectFields(
$panel,
PhabricatorCustomField::ROLE_EDIT);
$field_list
->setViewer($viewer)
->readFieldsFromStorage($panel);
$validation_exception = null;
if ($request->isFormPost()) {
$v_name = $request->getStr('name');
$v_view_policy = $request->getStr('viewPolicy');
$v_edit_policy = $request->getStr('editPolicy');
$type_name = PhabricatorDashboardPanelTransaction::TYPE_NAME;
$type_view_policy = PhabricatorTransactions::TYPE_VIEW_POLICY;
$type_edit_policy = PhabricatorTransactions::TYPE_EDIT_POLICY;
$xactions = array();
$xactions[] = id(new PhabricatorDashboardPanelTransaction())
->setTransactionType($type_name)
->setNewValue($v_name);
$xactions[] = id(new PhabricatorDashboardPanelTransaction())
->setTransactionType($type_view_policy)
->setNewValue($v_view_policy);
$xactions[] = id(new PhabricatorDashboardPanelTransaction())
->setTransactionType($type_edit_policy)
->setNewValue($v_edit_policy);
$field_xactions = $field_list->buildFieldTransactionsFromRequest(
new PhabricatorDashboardPanelTransaction(),
$request);
$xactions = array_merge($xactions, $field_xactions);
try {
$editor = id(new PhabricatorDashboardPanelTransactionEditor())
->setActor($viewer)
->setContinueOnNoEffect(true)
->setContentSourceFromRequest($request)
->applyTransactions($panel, $xactions);
return id(new AphrontRedirectResponse())
->setURI($this->getPanelRedirectURI($panel));
} catch (PhabricatorApplicationTransactionValidationException $ex) {
$validation_exception = $ex;
$e_name = $validation_exception->getShortMessage($type_name);
$panel->setViewPolicy($v_view_policy);
$panel->setEditPolicy($v_edit_policy);
}
}
$policies = id(new PhabricatorPolicyQuery())
->setViewer($viewer)
->setObject($panel)
->execute();
$form = id(new AphrontFormView())
->setUser($viewer)
+ ->addHiddenInput('dashboardID', $request->getInt('dashboardID'))
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Name'))
->setName('name')
->setValue($v_name)
->setError($e_name))
->appendChild(
id(new AphrontFormPolicyControl())
->setName('viewPolicy')
->setPolicyObject($panel)
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
->setPolicies($policies))
->appendChild(
id(new AphrontFormPolicyControl())
->setName('editPolicy')
->setPolicyObject($panel)
->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
->setPolicies($policies));
$field_list->appendFieldsToForm($form);
- $form
- ->appendChild(
- id(new AphrontFormSubmitControl())
- ->setValue($button)
- ->addCancelButton($cancel_uri));
-
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(
pht('Panels'),
$this->getApplicationURI('panel/'));
if ($is_create) {
$crumbs->addTextCrumb(pht('New Panel'));
$form->addHiddenInput('type', $panel->getPanelType());
} else {
$crumbs->addTextCrumb(
$panel->getMonogram(),
'/'.$panel->getMonogram());
$crumbs->addTextCrumb(pht('Edit'));
}
+ if ($request->isAjax()) {
+ return $this->newDialog()
+ ->setTitle($header)
+ ->setWidth(AphrontDialogView::WIDTH_FORM)
+ ->setValidationException($validation_exception)
+ ->appendChild($form->buildLayoutView())
+ ->addCancelButton($cancel_uri)
+ ->addSubmitButton($button);
+ } else {
+ $form
+ ->appendChild(
+ id(new AphrontFormSubmitControl())
+ ->setValue($button)
+ ->addCancelButton($cancel_uri));
+ }
+
$box = id(new PHUIObjectBoxView())
->setHeaderText($header)
->setValidationException($validation_exception)
->setForm($form);
return $this->buildApplicationPage(
array(
$crumbs,
$box,
),
array(
'title' => $title,
'device' => true,
));
}
private function getPanelRedirectURI(PhabricatorDashboardPanel $panel) {
$request = $this->getRequest();
$dashboard_id = $request->getInt('dashboardID');
if ($dashboard_id) {
$uri = $this->getApplicationURI('manage/'.$dashboard_id.'/');
} else {
$uri = '/'.$panel->getMonogram();
}
return $uri;
}
}
diff --git a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
index 91771cb05a..35023570a1 100644
--- a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
+++ b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
@@ -1,294 +1,295 @@
<?php
final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
const HEADER_MODE_NORMAL = 'normal';
const HEADER_MODE_NONE = 'none';
const HEADER_MODE_EDIT = 'edit';
private $panel;
private $viewer;
private $enableAsyncRendering;
private $parentPanelPHIDs;
private $headerMode = self::HEADER_MODE_NORMAL;
private $dashboardID;
public function setDashboardID($id) {
$this->dashboardID = $id;
return $this;
}
public function getDashboardID() {
return $this->dashboardID;
}
public function setHeaderMode($header_mode) {
$this->headerMode = $header_mode;
return $this;
}
public function getHeaderMode() {
return $this->headerMode;
}
/**
* Allow the engine to render the panel via Ajax.
*/
public function setEnableAsyncRendering($enable) {
$this->enableAsyncRendering = $enable;
return $this;
}
public function setParentPanelPHIDs(array $parents) {
$this->parentPanelPHIDs = $parents;
return $this;
}
public function getParentPanelPHIDs() {
return $this->parentPanelPHIDs;
}
public function setViewer(PhabricatorUser $viewer) {
$this->viewer = $viewer;
return $this;
}
public function getViewer() {
return $this->viewer;
}
public function setPanel(PhabricatorDashboardPanel $panel) {
$this->panel = $panel;
return $this;
}
public function getPanel() {
return $this->panel;
}
public function renderPanel() {
$panel = $this->getPanel();
$viewer = $this->getViewer();
if (!$panel) {
return $this->renderErrorPanel(
pht('Missing Panel'),
pht('This panel does not exist.'));
}
$panel_type = $panel->getImplementation();
if (!$panel_type) {
return $this->renderErrorPanel(
$panel->getName(),
pht(
'This panel has type "%s", but that panel type is not known to '.
'Phabricator.',
$panel->getPanelType()));
}
try {
$this->detectRenderingCycle($panel);
if ($this->enableAsyncRendering) {
if ($panel_type->shouldRenderAsync()) {
return $this->renderAsyncPanel();
}
}
return $this->renderNormalPanel($viewer, $panel, $this);
} catch (Exception $ex) {
return $this->renderErrorPanel(
$panel->getName(),
pht(
'%s: %s',
phutil_tag('strong', array(), get_class($ex)),
$ex->getMessage()));
}
}
private function renderNormalPanel() {
$panel = $this->getPanel();
$panel_type = $panel->getImplementation();
$content = $panel_type->renderPanelContent(
$this->getViewer(),
$panel,
$this);
$header = $this->renderPanelHeader();
return $this->renderPanelDiv(
$content,
$header);
}
private function renderAsyncPanel() {
$panel = $this->getPanel();
$panel_id = celerity_generate_unique_node_id();
$dashboard_id = $this->getDashboardID();
Javelin::initBehavior(
'dashboard-async-panel',
array(
'panelID' => $panel_id,
'parentPanelPHIDs' => $this->getParentPanelPHIDs(),
'headerMode' => $this->getHeaderMode(),
'dashboardID' => $dashboard_id,
'uri' => '/dashboard/panel/render/'.$panel->getID().'/',
));
$header = $this->renderPanelHeader();
$content = id(new PHUIPropertyListView())
->addTextContent(pht('Loading...'));
return $this->renderPanelDiv(
$content,
$header,
$panel_id);
}
private function renderErrorPanel($title, $body) {
switch ($this->getHeaderMode()) {
case self::HEADER_MODE_NONE:
$header = null;
break;
case self::HEADER_MODE_EDIT:
$header = id(new PhabricatorActionHeaderView())
->setHeaderTitle($title)
->setHeaderColor(PhabricatorActionHeaderView::HEADER_WHITE);
$header = $this->addPanelHeaderActions($header);
break;
case self::HEADER_MODE_NORMAL:
default:
$header = id(new PhabricatorActionHeaderView())
->setHeaderTitle($title)
->setHeaderColor(PhabricatorActionHeaderView::HEADER_WHITE);
break;
}
$icon = id(new PHUIIconView())
->setIconFont('fa-warning red msr');
$content = id(new PHUIBoxView())
->addClass('dashboard-box')
->appendChild($icon)
->appendChild($body);
return $this->renderPanelDiv(
$content,
$header);
}
private function renderPanelDiv(
$content,
$header = null,
$id = null) {
require_celerity_resource('phabricator-dashboard-css');
$panel = $this->getPanel();
if (!$id) {
$id = celerity_generate_unique_node_id();
}
return javelin_tag(
'div',
array(
'id' => $id,
'sigil' => 'dashboard-panel',
'meta' => array(
'objectPHID' => $panel->getPHID()),
'class' => 'dashboard-panel'),
array(
$header,
$content));
}
private function renderPanelHeader() {
$panel = $this->getPanel();
switch ($this->getHeaderMode()) {
case self::HEADER_MODE_NONE:
$header = null;
break;
case self::HEADER_MODE_EDIT:
$header = id(new PhabricatorActionHeaderView())
->setHeaderTitle($panel->getName())
->setHeaderColor(PhabricatorActionHeaderView::HEADER_WHITE);
$header = $this->addPanelHeaderActions($header);
break;
case self::HEADER_MODE_NORMAL:
default:
$header = id(new PhabricatorActionHeaderView())
->setHeaderTitle($panel->getName())
->setHeaderColor(PhabricatorActionHeaderView::HEADER_WHITE);
break;
}
return $header;
}
private function addPanelHeaderActions(
PhabricatorActionHeaderView $header) {
$panel = $this->getPanel();
$dashboard_id = $this->getDashboardID();
$edit_uri = id(new PhutilURI(
'/dashboard/panel/edit/'.$panel->getID().'/'));
if ($dashboard_id) {
$edit_uri->setQueryParam('dashboardID', $dashboard_id);
}
$action_edit = id(new PHUIIconView())
->setIconFont('fa-pencil')
+ ->setWorkflow(true)
->setHref((string) $edit_uri);
$header->addAction($action_edit);
if ($dashboard_id) {
$uri = id(new PhutilURI(
'/dashboard/removepanel/'.$dashboard_id.'/'))
->setQueryParam('panelPHID', $panel->getPHID());
$action_remove = id(new PHUIIconView())
->setIconFont('fa-trash-o')
->setHref((string) $uri)
->setWorkflow(true);
$header->addAction($action_remove);
}
return $header;
}
/**
* Detect graph cycles in panels, and deeply nested panels.
*
* This method throws if the current rendering stack is too deep or contains
* a cycle. This can happen if you embed layout panels inside each other,
* build a big stack of panels, or embed a panel in remarkup inside another
* panel. Generally, all of this stuff is ridiculous and we just want to
* shut it down.
*
* @param PhabricatorDashboardPanel Panel being rendered.
* @return void
*/
private function detectRenderingCycle(PhabricatorDashboardPanel $panel) {
if ($this->parentPanelPHIDs === null) {
throw new Exception(
pht(
'You must call setParentPanelPHIDs() before rendering panels.'));
}
$max_depth = 4;
if (count($this->parentPanelPHIDs) >= $max_depth) {
throw new Exception(
pht(
'To render more than %s levels of panels nested inside other '.
'panels, purchase a subscription to Phabricator Gold.',
new PhutilNumber($max_depth)));
}
if (in_array($panel->getPHID(), $this->parentPanelPHIDs)) {
throw new Exception(
pht(
'You awake in a twisting maze of mirrors, all alike. '.
'You are likely to be eaten by a graph cycle. '.
'Should you escape alive, you resolve to be more careful about '.
'putting dashboard panels inside themselves.'));
}
}
}
diff --git a/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
index c64d8f0489..8c37e78a0b 100644
--- a/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
+++ b/src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
@@ -1,129 +1,130 @@
<?php
final class PhabricatorDashboardRenderingEngine extends Phobject {
private $dashboard;
private $viewer;
private $arrangeMode;
public function setViewer(PhabricatorUser $viewer) {
$this->viewer = $viewer;
return $this;
}
public function setDashboard(PhabricatorDashboard $dashboard) {
$this->dashboard = $dashboard;
return $this;
}
public function setArrangeMode($mode) {
$this->arrangeMode = $mode;
return $this;
}
public function renderDashboard() {
require_celerity_resource('phabricator-dashboard-css');
$dashboard = $this->dashboard;
$viewer = $this->viewer;
$layout_config = $dashboard->getLayoutConfigObject();
$panel_grid_locations = $layout_config->getPanelLocations();
$panels = mpull($dashboard->getPanels(), null, 'getPHID');
$dashboard_id = celerity_generate_unique_node_id();
$result = id(new AphrontMultiColumnView())
->setID($dashboard_id)
->setFluidlayout(true)
->setGutter(AphrontMultiColumnView::GUTTER_LARGE);
if ($this->arrangeMode) {
$h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_EDIT;
} else {
$h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_NORMAL;
}
+
foreach ($panel_grid_locations as $column => $panel_column_locations) {
$panel_phids = $panel_column_locations;
$column_panels = array_select_keys($panels, $panel_phids);
$column_result = array();
foreach ($column_panels as $panel) {
$column_result[] = id(new PhabricatorDashboardPanelRenderingEngine())
->setViewer($viewer)
->setPanel($panel)
->setDashboardID($dashboard->getID())
->setEnableAsyncRendering(true)
->setParentPanelPHIDs(array())
->setHeaderMode($h_mode)
->renderPanel();
}
$column_class = $layout_config->getColumnClass(
$column,
$this->arrangeMode);
if ($this->arrangeMode) {
$column_result[] = $this->renderAddPanelPlaceHolder($column);
$column_result[] = $this->renderAddPanelUI($column);
}
$result->addColumn(
$column_result,
$column_class,
$sigil = 'dashboard-column',
$metadata = array('columnID' => $column));
}
if ($this->arrangeMode) {
Javelin::initBehavior(
'dashboard-move-panels',
array(
'dashboardID' => $dashboard_id,
'moveURI' => '/dashboard/movepanel/'.$dashboard->getID().'/',
));
}
$view = id(new PHUIBoxView())
->addClass('dashboard-view')
->appendChild($result);
return $view;
}
private function renderAddPanelPlaceHolder($column) {
$uri = $this->getAddPanelURI($column);
$dashboard = $this->dashboard;
$panels = $dashboard->getPanels();
$layout_config = $dashboard->getLayoutConfigObject();
if ($layout_config->isMultiColumnLayout() && count($panels)) {
$text = pht('Drag a panel here or click to add a panel.');
} else {
$text = pht('Click to add a panel.');
}
return javelin_tag(
'a',
array(
'sigil' => 'workflow',
'class' => 'drag-ghost dashboard-panel-placeholder',
'href' => (string) $uri),
$text);
}
private function renderAddPanelUI($column) {
$uri = $this->getAddPanelURI($column);
return id(new PHUIButtonView())
->setTag('a')
->setHref((string) $uri)
->setWorkflow(true)
->setColor(PHUIButtonView::GREY)
->setIcon(id(new PHUIIconView())
->setIconFont('fa-plus'))
->setText(pht('Add Panel'))
->addClass(PHUI::MARGIN_LARGE);
}
private function getAddPanelURI($column) {
$dashboard = $this->dashboard;
$uri = id(new PhutilURI('/dashboard/addpanel/'.$dashboard->getID().'/'))
->setQueryParam('column', $column)
->setQueryParam('src', 'arrange');
return $uri;
}
}
diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php
index 9a71350136..ba8b2556ce 100644
--- a/src/view/AphrontDialogView.php
+++ b/src/view/AphrontDialogView.php
@@ -1,326 +1,344 @@
<?php
final class AphrontDialogView extends AphrontView {
private $title;
private $shortTitle;
private $submitButton;
private $cancelURI;
private $cancelText = 'Cancel';
private $submitURI;
private $hidden = array();
private $class;
private $renderAsForm = true;
private $formID;
private $headerColor = PhabricatorActionHeaderView::HEADER_LIGHTBLUE;
private $footers = array();
private $isStandalone;
private $method = 'POST';
private $disableWorkflowOnSubmit;
private $disableWorkflowOnCancel;
private $width = 'default';
- private $errors;
+ private $errors = array();
private $flush;
+ private $validationException;
+
const WIDTH_DEFAULT = 'default';
const WIDTH_FORM = 'form';
const WIDTH_FULL = 'full';
public function setMethod($method) {
$this->method = $method;
return $this;
}
public function setIsStandalone($is_standalone) {
$this->isStandalone = $is_standalone;
return $this;
}
public function setErrors(array $errors) {
$this->errors = $errors;
return $this;
}
public function getIsStandalone() {
return $this->isStandalone;
}
public function setSubmitURI($uri) {
$this->submitURI = $uri;
return $this;
}
public function setTitle($title) {
$this->title = $title;
return $this;
}
public function getTitle() {
return $this->title;
}
public function setShortTitle($short_title) {
$this->shortTitle = $short_title;
return $this;
}
public function getShortTitle() {
return $this->shortTitle;
}
public function addSubmitButton($text = null) {
if (!$text) {
$text = pht('Okay');
}
$this->submitButton = $text;
return $this;
}
public function addCancelButton($uri, $text = null) {
if (!$text) {
$text = pht('Cancel');
}
$this->cancelURI = $uri;
$this->cancelText = $text;
return $this;
}
public function addFooter($footer) {
$this->footers[] = $footer;
return $this;
}
public function addHiddenInput($key, $value) {
if (is_array($value)) {
foreach ($value as $hidden_key => $hidden_value) {
$this->hidden[] = array($key.'['.$hidden_key.']', $hidden_value);
}
} else {
$this->hidden[] = array($key, $value);
}
return $this;
}
public function setClass($class) {
$this->class = $class;
return $this;
}
public function setFlush($flush) {
$this->flush = $flush;
return $this;
}
public function setRenderDialogAsDiv() {
// TODO: This API is awkward.
$this->renderAsForm = false;
return $this;
}
public function setFormID($id) {
$this->formID = $id;
return $this;
}
public function setWidth($width) {
$this->width = $width;
return $this;
}
public function setHeaderColor($color) {
$this->headerColor = $color;
return $this;
}
public function appendParagraph($paragraph) {
return $this->appendChild(
phutil_tag(
'p',
array(
'class' => 'aphront-dialog-view-paragraph',
),
$paragraph));
}
public function setDisableWorkflowOnSubmit($disable_workflow_on_submit) {
$this->disableWorkflowOnSubmit = $disable_workflow_on_submit;
return $this;
}
public function getDisableWorkflowOnSubmit() {
return $this->disableWorkflowOnSubmit;
}
public function setDisableWorkflowOnCancel($disable_workflow_on_cancel) {
$this->disableWorkflowOnCancel = $disable_workflow_on_cancel;
return $this;
}
public function getDisableWorkflowOnCancel() {
return $this->disableWorkflowOnCancel;
}
+ public function setValidationException(
+ PhabricatorApplicationTransactionValidationException $ex = null) {
+ $this->validationException = $ex;
+ return $this;
+ }
+
final public function render() {
require_celerity_resource('aphront-dialog-view-css');
$buttons = array();
if ($this->submitButton) {
$meta = array();
if ($this->disableWorkflowOnSubmit) {
$meta['disableWorkflow'] = true;
}
$buttons[] = javelin_tag(
'button',
array(
'name' => '__submit__',
'sigil' => '__default__',
'type' => 'submit',
'meta' => $meta,
),
$this->submitButton);
}
if ($this->cancelURI) {
$meta = array();
if ($this->disableWorkflowOnCancel) {
$meta['disableWorkflow'] = true;
}
$buttons[] = javelin_tag(
'a',
array(
'href' => $this->cancelURI,
'class' => 'button grey',
'name' => '__cancel__',
'sigil' => 'jx-workflow-button',
'meta' => $meta,
),
$this->cancelText);
}
if (!$this->user) {
throw new Exception(
pht('You must call setUser() when rendering an AphrontDialogView.'));
}
$more = $this->class;
if ($this->flush) {
$more .= ' aphront-dialog-flush';
}
switch ($this->width) {
case self::WIDTH_FORM:
case self::WIDTH_FULL:
$more .= ' aphront-dialog-view-width-'.$this->width;
break;
case self::WIDTH_DEFAULT:
break;
default:
throw new Exception("Unknown dialog width '{$this->width}'!");
}
if ($this->isStandalone) {
$more .= ' aphront-dialog-view-standalone';
}
$attributes = array(
'class' => 'aphront-dialog-view '.$more,
'sigil' => 'jx-dialog',
);
$form_attributes = array(
'action' => $this->submitURI,
'method' => $this->method,
'id' => $this->formID,
);
$hidden_inputs = array();
$hidden_inputs[] = phutil_tag(
'input',
array(
'type' => 'hidden',
'name' => '__dialog__',
'value' => '1',
));
foreach ($this->hidden as $desc) {
list($key, $value) = $desc;
$hidden_inputs[] = javelin_tag(
'input',
array(
'type' => 'hidden',
'name' => $key,
'value' => $value,
'sigil' => 'aphront-dialog-application-input'
));
}
if (!$this->renderAsForm) {
$buttons = array(phabricator_form(
$this->user,
$form_attributes,
array_merge($hidden_inputs, $buttons)));
}
$children = $this->renderChildren();
- if ($this->errors) {
+ $errors = $this->errors;
+
+ $ex = $this->validationException;
+ $exception_errors = null;
+ if ($ex) {
+ foreach ($ex->getErrors() as $error) {
+ $errors[] = $error->getMessage();
+ }
+ }
+
+ if ($errors) {
$children = array(
- id(new AphrontErrorView())->setErrors($this->errors),
+ id(new AphrontErrorView())->setErrors($errors),
$children);
}
$header = new PhabricatorActionHeaderView();
$header->setHeaderTitle($this->title);
$header->setHeaderColor($this->headerColor);
$footer = null;
if ($this->footers) {
$footer = phutil_tag(
'div',
array(
'class' => 'aphront-dialog-foot',
),
$this->footers);
}
$content = array(
phutil_tag(
'div',
array(
'class' => 'aphront-dialog-head',
),
$header),
phutil_tag('div',
array(
'class' => 'aphront-dialog-body grouped',
),
$children),
phutil_tag(
'div',
array(
'class' => 'aphront-dialog-tail grouped',
),
array(
$buttons,
$footer,
)),
);
if ($this->renderAsForm) {
return phabricator_form(
$this->user,
$form_attributes + $attributes,
array($hidden_inputs, $content));
} else {
return javelin_tag(
'div',
$attributes,
$content);
}
}
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, Nov 13, 6:21 PM (12 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
336467
Default Alt Text
(27 KB)

Event Timeline