ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilHtmlBlockGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once("./Services/Block/classes/class.ilHtmlBlockGUIGen.php");
25 
36 {
37  static $block_type = "html";
38 
42  function ilHtmlBlockGUI()
43  {
44  global $ilCtrl, $lng;
45 
48 
49  //$this->setImage(ilUtil::getImagePath("icon_feed_s.gif"));
50 
51  $lng->loadLanguageModule("block_html");
52 
53  $this->setLimit(99999);
54  $this->setAvailableDetailLevels(1, 0);
55  $this->setEnableNumInfo(false);
56  }
57 
63  function getBlockType()
64  {
65  return self::$block_type;
66  }
67 
71  static function getScreenMode()
72  {
73  global $ilCtrl;
74 
75  switch($ilCtrl->getCmd())
76  {
77  case "create":
78  case "edit":
79  case "saveHtmlBlock":
80  case "updateHtmlBlock":
81  case "editHtmlBlock":
82  return IL_SCREEN_CENTER;
83  break;
84 
85  default:
86  return IL_SCREEN_SIDE;
87  break;
88  }
89  }
90 
91  function setBlock($a_block)
92  {
93  $this->html_block = $a_block;
94  $this->setTitle($this->html_block->getTitle());
95  $this->setBlockId($this->html_block->getId());
96  }
97 
101  function &executeCommand()
102  {
103  global $ilCtrl;
104 
105  $next_class = $ilCtrl->getNextClass();
106  $cmd = $ilCtrl->getCmd("getHTML");
107 
108  switch ($next_class)
109  {
110  default:
111  return $this->$cmd();
112  }
113  }
114 
118  function getHTML()
119  {
120  global $ilCtrl, $lng, $ilUser;
121 
122  if ($this->getCurrentDetailLevel() == 0)
123  {
124  return "";
125  }
126 
127  return parent::getHTML();
128  }
129 
133  function fillDataSection()
134  {
135  $this->setDataSection($this->html_block->getContent());
136  }
137 
141  function create()
142  {
143  return $this->createHtmlBlock();
144  }
145 
151  public function prepareSaveHtmlBlock(&$a_html_block)
152  {
153  global $ilCtrl;
154 
155  $a_html_block->setType($this->getBlockType());
156  $a_html_block->setContextObjId($ilCtrl->getContextObjId());
157  $a_html_block->setContextObjType($ilCtrl->getContextObjType());
158  }
159 
164  public function saveHtmlBlock()
165  {
166  global $ilCtrl;
167 
168  if ($this->checkInputHtmlBlock())
169  {
171  $ilCtrl->returnToParent($this);
172  }
173  else
174  {
175  return parent::saveHtmlBlock();
176  }
177  }
178 
183  {
184  global $ilCtrl;
185 
186  $ilCtrl->returnToParent($this);
187  }
188 }
189 
190 ?>