CMS  Version 3.9
PanelView Class Reference

Public Member Functions

 PanelView ($id, $title)
 
 button ($icon, $text, $tooltip, $action)
 
 control ($control)
 
 toolbar ($toolbar)
 
 writeScript ()
 
 commandMenu ()
 
 drawView ()
 

Public Attributes

 $id
 
 $title
 
 $content
 
 $dialogs
 
 $menu
 
 $script
 
 $buttons
 
 $controls
 
 $toolbars
 

Detailed Description

Definition at line 112 of file panel_view.inc.

Member Function Documentation

◆ button()

PanelView::button (   $icon,
  $text,
  $tooltip,
  $action 
)

Definition at line 134 of file panel_view.inc.

135  {
136  $this->buttons[] = new PanelButton($icon, $text, $tooltip, $action);
137  return $this;
138  }
$icon
Definition: upload.inc:92
$action
Definition: run.php:41

◆ commandMenu()

PanelView::commandMenu ( )

Definition at line 193 of file panel_view.inc.

194  {
195  $this->menu = new ContextMenu($this->id . "_menu", "#{$this->id}_menu_button");
196  $this->menu->trigger = "click";
197 
198  return $this->menu;
199  }

◆ control()

PanelView::control (   $control)

Definition at line 140 of file panel_view.inc.

141  {
142  $this->controls[] = $control;
143  return $this;
144  }

◆ drawView()

PanelView::drawView ( )

Definition at line 201 of file panel_view.inc.

202  {
203  if ($this->menu) $this->dialogs .= $this->menu->writeMenu();
204 
205  $title = is_object($this->title) ? $this->title->getText() : $title;
206  ob_start();
207 ?>
208  <?echo $this->writeScript()?>
209  <?echo $this->dialogs?>
210 
211  <span class="tearoff_title" style="display:none"><?echo $title?></span>
212  <div id="<?echo $this->id?>_header" class="panel_header">
213 <?
214  if ($this->menu)
215  {
216 ?>
217  <img id="<?echo $this->id?>_menu_button" src="/fakoli/images/data_view_menu.png" alt="Panel Menu" style="border: none; display:inline-block;vertical-align: middle"/>
218 <?
219  }
220 
221  if (is_object($this->title))
222  {
223  $this->title->drawControl();
224  }
225  else
226  {
227  echo $this->title;
228  }
229 
230  if (count($this->buttons) > 0)
231  {
232 ?>
233  <div id="<?echo $this->id?>_buttons" class="panel_buttons">
234 <?
235  foreach($this->buttons as $button)
236  {
237  $button->drawControl();
238  }
239 ?>
240  </div>
241 <?
242  }
243 
244  if (count($this->controls) > 0)
245  {
246  foreach($this->controls as $control)
247  {
248  $control->drawControl();
249  }
250  }
251 
252 ?>
253  <div style="height: 0; clear: both"></div>
254 <?
255  if (count($this->toolbars) > 0)
256  {
257  foreach($this->toolbars as $toolbar)
258  {
259  $toolbar->drawToolbar();
260  }
261  }
262 ?>
263  </div>
264  <div id="<?echo $this->id?>_body" class="panel_body">
265  <?echo $this->content?>
266  </div>
267 <?
268  $out = ob_get_contents();
269  ob_end_clean();
270  return $out;
271  }
$out
Definition: page.inc:66
$helpTree style
Definition: tree.inc:46
$bookmark title
$button
Definition: show.inc:6

◆ PanelView()

PanelView::PanelView (   $id,
  $title 
)

Definition at line 125 of file panel_view.inc.

126  {
127  $this->id = $id;
128  $this->title = $title;
129 
130  $this->buttons = array();
131  $this->controls = array();
132  }

◆ toolbar()

PanelView::toolbar (   $toolbar)

Definition at line 146 of file panel_view.inc.

147  {
148  $this->toolbars[] = $toolbar;
149  return $this;
150  }

◆ writeScript()

PanelView::writeScript ( )

Definition at line 152 of file panel_view.inc.

153  {
154  if ($this->menu)
155  {
156  $this->script .= $this->menu->writeScript();
157  }
158 
159  $this->script .= <<<ENDSCRIPT
160 <script type="text/javascript">
161 var {$this->id}_body = document.id('{$this->id}_body');
162 if ({$this->id}_body.panel)
163 {
164  var panel = {$this->id}_body.panel;
165 
166  panel.body = {$this->id}_body;
167  panel.header = document.id('{$this->id}_header');
168 }
169 </script>
170 ENDSCRIPT;
171 
172  if (count($this->controls) > 0)
173  {
174  foreach($this->controls as $control)
175  {
176  $this->script .= $control->writeScript();
177  }
178  }
179 
180  if (count($this->toolbars) > 0)
181  {
182  foreach($this->toolbars as $toolbar)
183  {
184  $this->script .= $toolbar->writeScript();
185  }
186  }
187 
188  if (is_object($this->title)) $script .= $this->title->writeScript();
189 
190  return $this->script;
191  }

Member Data Documentation

◆ $buttons

PanelView::$buttons

Definition at line 121 of file panel_view.inc.

◆ $content

PanelView::$content

Definition at line 117 of file panel_view.inc.

◆ $controls

PanelView::$controls

Definition at line 122 of file panel_view.inc.

◆ $dialogs

PanelView::$dialogs

Definition at line 118 of file panel_view.inc.

◆ $id

PanelView::$id

Definition at line 114 of file panel_view.inc.

◆ $menu

PanelView::$menu

Definition at line 119 of file panel_view.inc.

◆ $script

PanelView::$script

Definition at line 120 of file panel_view.inc.

◆ $title

PanelView::$title

Definition at line 115 of file panel_view.inc.

◆ $toolbars

PanelView::$toolbars

Definition at line 123 of file panel_view.inc.


The documentation for this class was generated from the following file: