ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilFramesetGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
12 {
13 
18  function __construct()
19  {
20  global $lng;
21 
22  $this->setMainWidth("*");
23  $this->setSideWidth("25%");
24 
25  // default titles (accessibility revision)
26  // should not been overwritten, if no good reason is given
27  $this->setSideFrameTitle($lng->txt("side_frame"));
28  $this->setMainFrameTitle($lng->txt("content_frame"));
29  }
30 
34  function setFramesetTitle($a_fs_title)
35  {
36  $this->frameset_title = $a_fs_title;
37  }
38 
42  function setMainFrameSource($a_main_source)
43  {
44  $this->main_frame_source = $a_main_source;
45  }
46 
50  function setMainFrameTitle($a_main_title)
51  {
52  $this->main_frame_title = $a_main_title;
53  }
54 
58  function setMainFrameName($a_main_name)
59  {
60  $this->main_frame_name = $a_main_name;
61  }
62 
66  function setSideFrameSource($a_side_source)
67  {
68  $this->side_frame_source = $a_side_source;
69  }
70 
74  function setSideFrameTitle($a_side_title)
75  {
76  $this->side_frame_title = $a_side_title;
77  }
78 
82  function setSideFrameName($a_side_name)
83  {
84  $this->side_frame_name = $a_side_name;
85  }
86 
92  function setMainWidth($a_mainwidth)
93  {
94  $this->mainwidth = $a_mainwidth;
95  }
96 
102  function getMainWidth()
103  {
104  return $this->mainwidth;
105  }
106 
112  function setSideWidth($a_sidewidth)
113  {
114  $this->sidewidth = $a_sidewidth;
115  }
116 
122  function getSideWidth()
123  {
124  return $this->sidewidth;
125  }
126 
130  function get()
131  {
132  return $this->show(true);
133  }
134 
135 
139  function show($a_get_only = false)
140  {
141  global $ilSetting;
142 
143  if ($ilSetting->get("tree_frame") == "right")
144  {
145  $main = "LEFT";
146  $side = "RIGHT";
147  }
148  else
149  {
150  $main = "RIGHT";
151  $side = "LEFT";
152  }
153 
154  $tpl = new ilTemplate("tpl.frameset.html", true, false);
155  $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
156 
157  $tpl->setVariable("PAGETITLE", "- ".ilUtil::stripScriptHTML($this->frameset_title));
158  $tpl->setVariable("SRC_".$main, $this->main_frame_source);
159  $tpl->setVariable("SRC_".$side, $this->side_frame_source);
160  $tpl->setVariable("TITLE_".$main, $this->main_frame_title);
161  $tpl->setVariable("TITLE_".$side, $this->side_frame_title);
162  $tpl->setVariable("NAME_".$main, $this->main_frame_name);
163  $tpl->setVariable("NAME_".$side, $this->side_frame_name);
164  $tpl->setVariable("WIDTH_".$main, $this->getMainWidth());
165  $tpl->setVariable("WIDTH_".$side, $this->getSideWidth());
166  if ($ilSetting->get('short_inst_name') != "")
167  {
168  $tpl->setVariable("WINDOW_TITLE",
169  $ilSetting->get('short_inst_name'));
170  }
171  else
172  {
173  $tpl->setVariable("WINDOW_TITLE",
174  "ILIAS");
175  }
176 
177  if ($a_get_only)
178  {
179  return $tpl->get();
180  }
181  else
182  {
183  $tpl->show("DEFAULT", false);
184  }
185  }
186 
187 }