CMS  Version 3.9
tearoff.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::using("panel_layout");
3 
4 $uri = $_GET["uri"];
5 $default = $_GET["defaultPanel"];
6 
7 $script .= <<<ENDSCRIPT
8 <script type="text/javascript">
9 var layout;
10 
11 function stretch()
12 {
13  var cw = window.innerWidth == undefined ?
14  ((document.documentElement.clientWidth == 0) ? document.body.clientWidth : document.documentElement.clientWidth)
15  : window.innerWidth;
16  var ch = window.innerHeight == undefined ?
17  ((document.documentElement.clientHeight == 0) ? document.body.clientHeight : document.documentElement.clientHeight)
18  : window.innerHeight;
19 
20  document.id('tearoff').setStyles({width: cw, height: ch});
21  layout.calculateLayout();
22 }
23 
24 window.addEvent('domready', function()
25 {
26  layout = new PanelLayout();
27  layout.setup('tearoff', {stretch: true, replace: true,
28  onLoad: function()
29  {
30  var titleField = document.id('tearoff').getElement(".tearoff_title");
31  if (titleField != null) document.title = titleField.get('text');
32  }
33  });
34 
35  layout.addSlots('.slot');
36  stretch();
37 
38  var panel = layout.dockAndLoad('main', '{$uri}', 'slot1', {stretch: true});
39  window.addEvent('resize', stretch);
40  layout.options.defaultPanel = '$default';
41 
42 });
43 </script>
44 ENDSCRIPT;
45 ?>
46 <div id="tearoff" style="width: 100%">
47  <div id="slot1" class="slot">
48  </div>
49 </div>
$helpTree style
Definition: tree.inc:46
$helpTree width
Definition: tree.inc:45
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
$desc height
Definition: event_edit.inc:64
$form layout
$uri
Definition: tearoff.inc:4
$default
Definition: tearoff.inc:5
$script
Definition: tearoff.inc:7