00001 <?php 00002 /* 00003 +-----------------------------------------------------------------------------+ 00004 | ILIAS open source | 00005 +-----------------------------------------------------------------------------+ 00006 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne | 00007 | | 00008 | This program is free software; you can redistribute it and/or | 00009 | modify it under the terms of the GNU General Public License | 00010 | as published by the Free Software Foundation; either version 2 | 00011 | of the License, or (at your option) any later version. | 00012 | | 00013 | This program is distributed in the hope that it will be useful, | 00014 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00015 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00016 | GNU General Public License for more details. | 00017 | | 00018 | You should have received a copy of the GNU General Public License | 00019 | along with this program; if not, write to the Free Software | 00020 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 00021 +-----------------------------------------------------------------------------+ 00022 */ 00023 00024 include_once("./Services/Block/classes/class.ilHtmlBlockGUIGen.php"); 00025 00035 class ilHtmlBlockGUI extends ilHtmlBlockGUIGen 00036 { 00037 static $block_type = "html"; 00038 00042 function ilHtmlBlockGUI() 00043 { 00044 global $ilCtrl, $lng; 00045 00046 parent::__construct(); 00047 parent::ilBlockGUI(); 00048 00049 //$this->setImage(ilUtil::getImagePath("icon_feed_s.gif")); 00050 00051 $lng->loadLanguageModule("block_html"); 00052 00053 $this->setLimit(99999); 00054 $this->setAvailableDetailLevels(1, 0); 00055 $this->setEnableNumInfo(false); 00056 } 00057 00063 function getBlockType() 00064 { 00065 return self::$block_type; 00066 } 00067 00071 static function getScreenMode() 00072 { 00073 global $ilCtrl; 00074 00075 switch($ilCtrl->getCmd()) 00076 { 00077 case "create": 00078 case "edit": 00079 case "saveHtmlBlock": 00080 case "updateHtmlBlock": 00081 case "editHtmlBlock": 00082 return IL_SCREEN_CENTER; 00083 break; 00084 00085 default: 00086 return IL_SCREEN_SIDE; 00087 break; 00088 } 00089 } 00090 00091 function setBlock($a_block) 00092 { 00093 $this->html_block = $a_block; 00094 $this->setTitle($this->html_block->getTitle()); 00095 $this->setBlockId($this->html_block->getId()); 00096 } 00097 00101 function &executeCommand() 00102 { 00103 global $ilCtrl; 00104 00105 $next_class = $ilCtrl->getNextClass(); 00106 $cmd = $ilCtrl->getCmd("getHTML"); 00107 00108 switch ($next_class) 00109 { 00110 default: 00111 return $this->$cmd(); 00112 } 00113 } 00114 00118 function getHTML() 00119 { 00120 global $ilCtrl, $lng, $ilUser; 00121 00122 if ($this->getCurrentDetailLevel() == 0) 00123 { 00124 return ""; 00125 } 00126 00127 return parent::getHTML(); 00128 } 00129 00133 function fillDataSection() 00134 { 00135 $this->setDataSection($this->html_block->getContent()); 00136 } 00137 00141 function create() 00142 { 00143 return $this->createHtmlBlock(); 00144 } 00145 00151 public function prepareSaveHtmlBlock(&$a_html_block) 00152 { 00153 global $ilCtrl; 00154 00155 $a_html_block->setType($this->getBlockType()); 00156 $a_html_block->setContextObjId($ilCtrl->getContextObjId()); 00157 $a_html_block->setContextObjType($ilCtrl->getContextObjType()); 00158 } 00159 00164 public function saveHtmlBlock() 00165 { 00166 global $ilCtrl; 00167 00168 if ($this->checkInputHtmlBlock()) 00169 { 00170 parent::saveHtmlBlock(); 00171 $ilCtrl->returnToParent($this); 00172 } 00173 else 00174 { 00175 return parent::saveHtmlBlock(); 00176 } 00177 } 00178 00182 function cancelSaveHtmlBlock() 00183 { 00184 global $ilCtrl; 00185 00186 $ilCtrl->returnToParent($this); 00187 } 00188 } 00189 00190 ?>
1.7.1