20 parent::__construct(
$js);
21 $this->params = array(
22 "dialogClass" =>
"no-close"
29 $jsonButtons = array();
30 foreach ($this->buttons as $button) {
31 $jsonButtons[] = $button->getParams();
33 $allParams[
"buttons"] = $jsonButtons;
34 $this->jquery_code_for_compile[] =
"$( '" . $this->attachTo .
"' ).dialog(" . $this->
getParamsAsJSON($allParams) .
");";
35 $result = implode(
"", $this->jquery_code_for_compile);
36 $result = str_ireplace(
"\"%",
"", $result);
37 $result = str_ireplace(
"%\"",
"", $result);
38 $result = str_ireplace(
"\\n",
"", $result);
39 $result = str_ireplace(
"\\t",
"", $result);
48 public function attach($identifier) {
49 $this->attachTo = $identifier;
52 public function addCancelBtn($caption =
"Annuler", $position = NULL) {
60 public function addButton($caption, $jsCode, $position = NULL) {
64 private function insertBtn($insert, $position = NULL) {
65 if ($position != NULL) {
66 $this->buttons = array_splice($this->buttons, $position, 0, $insert);
68 $this->buttons[] = $insert;
Base component for JQuery UI visuals components.
JQuery UI Dialog Component.
insertBtn($insert, $position=NULL)
addButton($caption, $jsCode, $position=NULL)
addCancelBtn($caption="Annuler", $position=NULL)
addSubmitBtn(JsUtils $js, $url, $form, $responseElement, $caption="Valider", $position=NULL)