mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-21 04:01:30 +01:00
39 lines
882 B
PHP
39 lines
882 B
PHP
|
<?php
|
||
|
|
||
|
final class PHUIFormMultiSubmitControl extends AphrontFormControl {
|
||
|
|
||
|
private $buttons = array();
|
||
|
|
||
|
public function addBackButton($label = null) {
|
||
|
if ($label === null) {
|
||
|
$label = pht("\xC2\xAB Back");
|
||
|
}
|
||
|
return $this->addButton('__back__', $label, 'grey');
|
||
|
}
|
||
|
|
||
|
public function addSubmitButton($label) {
|
||
|
return $this->addButton('__submit__', $label);
|
||
|
}
|
||
|
|
||
|
public function addButton($name, $label, $class = null) {
|
||
|
$this->buttons[] = phutil_tag(
|
||
|
'input',
|
||
|
array(
|
||
|
'type' => 'submit',
|
||
|
'name' => $name,
|
||
|
'value' => $label,
|
||
|
'class' => $class,
|
||
|
'disabled' => $this->getDisabled() ? 'disabled' : null,
|
||
|
));
|
||
|
}
|
||
|
|
||
|
protected function getCustomControlClass() {
|
||
|
return 'phui-form-control-multi-submit';
|
||
|
}
|
||
|
|
||
|
protected function renderInput() {
|
||
|
return array_reverse($this->buttons);
|
||
|
}
|
||
|
|
||
|
}
|