Changeset View
Changeset View
Standalone View
Standalone View
src/view/AphrontDialogView.php
Show All 18 Lines | final class AphrontDialogView | ||||
private $method = 'POST'; | private $method = 'POST'; | ||||
private $disableWorkflowOnSubmit; | private $disableWorkflowOnSubmit; | ||||
private $disableWorkflowOnCancel; | private $disableWorkflowOnCancel; | ||||
private $width = 'default'; | private $width = 'default'; | ||||
private $errors = array(); | private $errors = array(); | ||||
private $flush; | private $flush; | ||||
private $validationException; | private $validationException; | ||||
private $objectList; | private $objectList; | ||||
private $resizeX; | |||||
private $resizeY; | |||||
const WIDTH_DEFAULT = 'default'; | const WIDTH_DEFAULT = 'default'; | ||||
const WIDTH_FORM = 'form'; | const WIDTH_FORM = 'form'; | ||||
const WIDTH_FULL = 'full'; | const WIDTH_FULL = 'full'; | ||||
public function setMethod($method) { | public function setMethod($method) { | ||||
$this->method = $method; | $this->method = $method; | ||||
Show All 32 Lines | public function setShortTitle($short_title) { | ||||
$this->shortTitle = $short_title; | $this->shortTitle = $short_title; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getShortTitle() { | public function getShortTitle() { | ||||
return $this->shortTitle; | return $this->shortTitle; | ||||
} | } | ||||
public function setResizeY($resize_y) { | |||||
$this->resizeY = $resize_y; | |||||
return $this; | |||||
} | |||||
public function getResizeY() { | |||||
return $this->resizeY; | |||||
} | |||||
public function setResizeX($resize_x) { | |||||
$this->resizeX = $resize_x; | |||||
return $this; | |||||
} | |||||
public function getResizeX() { | |||||
return $this->resizeX; | |||||
} | |||||
public function addSubmitButton($text = null) { | public function addSubmitButton($text = null) { | ||||
if (!$text) { | if (!$text) { | ||||
$text = pht('Okay'); | $text = pht('Okay'); | ||||
} | } | ||||
$this->submitButton = $text; | $this->submitButton = $text; | ||||
return $this; | return $this; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | if ($this->footers) { | ||||
$footer = phutil_tag( | $footer = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'aphront-dialog-foot', | 'class' => 'aphront-dialog-foot', | ||||
), | ), | ||||
$this->footers); | $this->footers); | ||||
} | } | ||||
$resize = null; | |||||
if ($this->resizeX || $this->resizeY) { | |||||
$resize = javelin_tag( | |||||
'div', | |||||
array( | |||||
'class' => 'aphront-dialog-resize', | |||||
'sigil' => 'jx-dialog-resize', | |||||
'meta' => array( | |||||
'resizeX' => $this->resizeX, | |||||
'resizeY' => $this->resizeY, | |||||
), | |||||
)); | |||||
} | |||||
$tail = null; | $tail = null; | ||||
if ($buttons || $footer) { | if ($buttons || $footer) { | ||||
$tail = phutil_tag( | $tail = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'aphront-dialog-tail grouped', | 'class' => 'aphront-dialog-tail grouped', | ||||
), | ), | ||||
array( | array( | ||||
$buttons, | $buttons, | ||||
$footer, | $footer, | ||||
$resize, | |||||
)); | )); | ||||
} | } | ||||
$content = array( | $content = array( | ||||
phutil_tag( | phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'aphront-dialog-head', | 'class' => 'aphront-dialog-head', | ||||
Show All 33 Lines |