50 if (!isset($this->htmlOptions[
'id'])) {
51 $this->htmlOptions[
'id'] = $this->getId();
54 if ($this->autoOpen ===
false && !isset($this->options[
'show'])) {
55 $this->options[
'show'] =
false;
58 $classes = array(
'modal');
60 if ($this->fade ===
true) {
64 if (!empty($classes)) {
65 $classes = implode(
' ', $classes);
66 if (isset($this->htmlOptions[
'class'])) {
67 $this->htmlOptions[
'class'] .=
' ' . $classes;
69 $this->htmlOptions[
'class'] = $classes;
72 echo CHtml::openTag(
'div', $this->htmlOptions);
80 echo CHtml::closeTag(
'div');
92 $booster->registerAssetJs(
'bootstrap-modalmanager.js', CClientScript::POS_HEAD);
93 $booster->registerAssetCss(
'bootstrap-modalmanager.css');
95 $options = !empty($this->format) ? CJavaScript::encode(array(
'format' => $this->format)) :
'';
98 echo
"jQuery('#{$id}').modalmanager({$options})";
99 foreach ($this->events as $event => $handler) {
100 echo
".on('{$event}', " . CJavaScript::encode($handler) .
")";
103 Yii::app()->getClientScript()->registerScript(__CLASS__ .
'#' . $this->getId(), ob_get_clean() .
';');
105 foreach ($this->events as $name => $handler) {
106 $handler = CJavaScript::encode($handler);
107 Yii::app()->getClientScript()->registerScript(
108 __CLASS__ .
'#' . $id .
'_' . $name,
109 "jQuery('#{$id}').on('{$name}', {$handler});"