00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00034 require_once "class.ilObject.php";
00035
00036 class ilObjAdvancedEditing extends ilObject
00037 {
00038 var $setting;
00039
00046 function ilObjAdvancedEditing($a_id = 0,$a_call_by_reference = true)
00047 {
00048 include_once "./Services/Administration/classes/class.ilSetting.php";
00049 $this->setting = new ilSetting("advanced_editing");
00050 $this->type = "adve";
00051 $this->ilObject($a_id,$a_call_by_reference);
00052 }
00053
00060 function update()
00061 {
00062 if (!parent::update())
00063 {
00064 return false;
00065 }
00066
00067
00068
00069 return true;
00070 }
00071
00079 function ilClone($a_parent_ref)
00080 {
00081 global $rbacadmin;
00082
00083
00084 $new_ref_id = parent::ilClone($a_parent_ref);
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 return $new_ref_id;
00100 }
00101
00108 function delete()
00109 {
00110
00111 if (!parent::delete())
00112 {
00113 return false;
00114 }
00115
00116
00117
00118 return true;
00119 }
00120
00130 function initDefaultRoles()
00131 {
00132 global $rbacadmin;
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144 return $roles ? $roles : array();
00145 }
00146
00160 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
00161 {
00162 global $tree;
00163
00164 switch ($a_event)
00165 {
00166 case "link":
00167
00168
00169
00170
00171 break;
00172
00173 case "cut":
00174
00175
00176
00177 break;
00178
00179 case "copy":
00180
00181
00182
00183
00184 break;
00185
00186 case "paste":
00187
00188
00189
00190 break;
00191
00192 case "new":
00193
00194
00195
00196 break;
00197 }
00198
00199
00200 if ($a_node_id==$_GET["ref_id"])
00201 {
00202 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
00203 $parent_type = $parent_obj->getType();
00204 if($parent_type == $this->getType())
00205 {
00206 $a_node_id = (int) $tree->getParentId($a_node_id);
00207 }
00208 }
00209
00210 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
00211 }
00212
00221 function &_getUsedHTMLTags($a_module = "")
00222 {
00223 $usedtags = array();
00224 include_once "./Services/Administration/classes/class.ilSetting.php";
00225 $setting = new ilSetting("advanced_editing");
00226 $tags = $setting->get("advanced_editing_used_html_tags_" . $a_module);
00227 if (strlen($tags))
00228 {
00229 $usedtags = unserialize($tags);
00230 }
00231 else
00232 {
00233
00234 $usedtags = array(
00235 "a",
00236 "blockquote",
00237 "br",
00238 "cite",
00239 "code",
00240 "div",
00241 "em",
00242 "h1",
00243 "h2",
00244 "h3",
00245 "h4",
00246 "h5",
00247 "h6",
00248 "hr",
00249 "img",
00250 "li",
00251 "ol",
00252 "object",
00253 "p",
00254 "pre",
00255 "span",
00256 "strike",
00257 "strong",
00258 "sub",
00259 "sup",
00260 "u",
00261 "ul"
00262 );
00263 }
00264 return $usedtags;
00265 }
00266
00275 function &_getUsedHTMLTagsAsString($a_module = "")
00276 {
00277 $result = "";
00278 $tags =& ilObjAdvancedEditing::_getUsedHTMLTags($a_module);
00279 foreach ($tags as $tag)
00280 {
00281 $result .= "<$tag>";
00282 }
00283 return $result;
00284 }
00285
00293 function _getRichTextEditor()
00294 {
00295 include_once "./Services/Administration/classes/class.ilSetting.php";
00296 $setting = new ilSetting("advanced_editing");
00297 $js = $setting->get("advanced_editing_javascript_editor");
00298 return $js;
00299 }
00300
00308 function _setRichTextEditor($a_js_editor)
00309 {
00310 include_once "./Services/Administration/classes/class.ilSetting.php";
00311 $setting = new ilSetting("advanced_editing");
00312 $setting->set("advanced_editing_javascript_editor", $a_js_editor);
00313 }
00314
00323 function _setUsedHTMLTags($a_html_tags, $a_module)
00324 {
00325 if (strlen($a_module))
00326 {
00327 include_once "./Services/Administration/classes/class.ilSetting.php";
00328 $setting = new ilSetting("advanced_editing");
00329 $setting->set("advanced_editing_used_html_tags_" . $a_module, serialize($a_html_tags));
00330 }
00331 }
00332
00340 function &getHTMLTags()
00341 {
00342 $tags = array(
00343 "a",
00344 "blockquote",
00345 "br",
00346 "cite",
00347 "code",
00348 "div",
00349 "em",
00350 "h1",
00351 "h2",
00352 "h3",
00353 "h4",
00354 "h5",
00355 "h6",
00356 "hr",
00357 "img",
00358 "li",
00359 "object",
00360 "ol",
00361 "p",
00362 "pre",
00363 "span",
00364 "strike",
00365 "strong",
00366 "sub",
00367 "sup",
00368 "table",
00369 "td",
00370 "tr",
00371 "u",
00372 "ul",
00373 "ruby",
00374 "rbc",
00375 "rtc",
00376 "rb",
00377 "rt",
00378 "rp"
00379 );
00380 return $tags;
00381 }
00382
00390 function &_getAllHTMLTags()
00391 {
00392 $tags = array(
00393 "a",
00394 "abbr",
00395 "acronym",
00396 "address",
00397 "applet",
00398 "area",
00399 "b",
00400 "base",
00401 "basefont",
00402 "bdo",
00403 "big",
00404 "blockquote",
00405 "br",
00406 "button",
00407 "caption",
00408 "center",
00409 "cite",
00410 "code",
00411 "col",
00412 "colgroup",
00413 "dd",
00414 "del",
00415 "dfn",
00416 "dir",
00417 "div",
00418 "dl",
00419 "dt",
00420 "em",
00421 "fieldset",
00422 "font",
00423 "form",
00424 "h1",
00425 "h2",
00426 "h3",
00427 "h4",
00428 "h5",
00429 "h6",
00430 "hr",
00431 "i",
00432 "iframe",
00433 "img",
00434 "input",
00435 "ins",
00436 "isindex",
00437 "kbd",
00438 "label",
00439 "legend",
00440 "li",
00441 "link",
00442 "map",
00443 "menu",
00444 "object",
00445 "ol",
00446 "optgroup",
00447 "option",
00448 "p",
00449 "param",
00450 "pre",
00451 "q",
00452 "s",
00453 "samp",
00454 "select",
00455 "small",
00456 "span",
00457 "strike",
00458 "strong",
00459 "sub",
00460 "sup",
00461 "table",
00462 "tbody",
00463 "td",
00464 "textarea",
00465 "tfoot",
00466 "th",
00467 "thead",
00468 "tr",
00469 "tt",
00470 "u",
00471 "ul",
00472 "var",
00473 "ruby",
00474 "rbc",
00475 "rtc",
00476 "rb",
00477 "rt",
00478 "rp"
00479 );
00480 return $tags;
00481 }
00482
00490 function _getAllHTMLTagsAsString()
00491 {
00492 $result = "";
00493 $tags =& ilObjAdvancedEditing::_getAllHTMLTags();
00494 foreach ($tags as $tag)
00495 {
00496 $result .= "<$tag>";
00497 }
00498 return $result;
00499 }
00500
00501
00502 }
00503 ?>