26 protected $initialDialogValue = NULL;
28 public function __construct ($simplePlugin, $attribute, $value = [])
30 $this->attribute = $attribute;
31 $this->dialog =
new $this->dialogClass(
'new');
33 $base = $simplePlugin->dn;
35 $base = $simplePlugin->base;
37 $this->dialog->base = $base;
38 $this->dialog->set_acl_category($simplePlugin->acl_category);
40 $this->initialDialogValue = $value;
41 foreach ($this->dialog->attributes as $attr) {
42 if (isset($value[$attr])) {
43 $this->dialog->$attr = $value[$attr];
51 return parent::render().$this->buttons();
54 protected function buttons ()
56 return '<div style="width:100%; text-align:right; clear:both; float:none;">'.
57 ' <input type="submit" name="'.$this->post_finish.
'" value="'.
msgPool::saveButton().
'"/> '.
58 ' <input type="submit" formnovalidate="formnovalidate" name="'.$this->post_cancel.
'" value="'.
msgPool::cancelButton().
'"/>'.
62 protected function handleFinish ()
64 $this->dialog->update();
65 $msgs = $this->dialog->check();
67 msg_dialog::displayChecks($msgs);
72 foreach ($this->dialog->attributes as $attr) {
73 $value[$attr] = $this->dialog->$attr;
76 $this->attribute->addValue(
'', $value);
80 protected function handleCancel ()
82 if ($this->initialDialogValue !== NULL) {
83 $this->attribute->addValue(
'', $this->initialDialogValue);
render()
Render the dialog and returns the HTML code.
GenericDialog using a simplePlugin based class as dialog.
static cancelButton($escape=TRUE)
Text for a cancel button.
static saveButton($escape=TRUE)
Text for a save button.
Generic dialog base class.