ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjAdvancedEditing Class Reference

Class ilObjAdvancedEditing. More...

+ Inheritance diagram for ilObjAdvancedEditing:
+ Collaboration diagram for ilObjAdvancedEditing:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor @access public. More...
 
 update ()
 update object data More...
 
 delete ()
 delete object and all related data More...
 
 setRichTextEditor ($a_js_editor)
 Sets wheather a Rich Text Editor should be used or not. More...
 
 setUsedHTMLTags ($a_html_tags, $a_module)
 Writes an array with allowed HTML tags to the ILIAS settings. More...
 
getHTMLTags ()
 Returns an array of all possible HTML tags for text editing. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static _getUsedHTMLTags ($a_module="")
 Returns an array of all allowed HTML tags for text editing. More...
 
static _getUsedHTMLTagsAsString ($a_module="")
 Returns a string of all allowed HTML tags for text editing. More...
 
static _getRichTextEditor ()
 Returns the identifier for the Rich Text Editor. More...
 
static _getAllHTMLTags ()
 Returns an array of all possible HTML tags for text editing. More...
 
static _setRichTextEditorUserState ($a_state)
 Sets the state of the rich text editor visibility for the current user. More...
 
static _getRichTextEditorUserState ()
 Gets the state of the rich text editor visibility for the current user. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date @global type $ilDB. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data@access public More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

 $setting
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Additional Inherited Members

- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjAdvancedEditing::__construct (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor @access public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Reimplemented from ilObject.

Definition at line 44 of file class.ilObjAdvancedEditing.php.

45 {
46 global $DIC;
47
48 $this->lng = $DIC->language();
49 include_once "./Services/Administration/classes/class.ilSetting.php";
50 $this->setting = new ilSetting("advanced_editing");
51 $this->type = "adve";
52 parent::__construct($a_id, $a_call_by_reference);
53 }
ILIAS Setting Class.
global $DIC
Definition: saml.php:7

References $DIC.

Member Function Documentation

◆ _getAllHTMLTags()

static ilObjAdvancedEditing::_getAllHTMLTags ( )
static

Returns an array of all possible HTML tags for text editing.

Returns an array of all possible HTML tags for text editing

Returns
array HTML tags

Definition at line 327 of file class.ilObjAdvancedEditing.php.

328 {
329 $tags = array(
330 "a",
331 "abbr",
332 "acronym",
333 "address",
334 "applet",
335 "area",
336 "b",
337 "base",
338 "basefont",
339 "bdo",
340 "big",
341 "blockquote",
342 "br",
343 "button",
344 "caption",
345 "center",
346 "cite",
347 "code",
348 "col",
349 "colgroup",
350 "dd",
351 "del",
352 "dfn",
353 "dir",
354 "div",
355 "dl",
356 "dt",
357 "em",
358 "fieldset",
359 "font",
360 "form",
361 "h1",
362 "h2",
363 "h3",
364 "h4",
365 "h5",
366 "h6",
367 "hr",
368 "i",
369 "iframe",
370 "img",
371 "input",
372 "ins",
373 "isindex",
374 "kbd",
375 "label",
376 "legend",
377 "li",
378 "link",
379 "map",
380 "menu",
381 "object",
382 "ol",
383 "optgroup",
384 "option",
385 "p",
386 "param",
387 "pre",
388 "q",
389 "s",
390 "samp",
391 "select",
392 "small",
393 "span",
394 "strike",
395 "strong",
396 "sub",
397 "sup",
398 "table",
399 "tbody",
400 "td",
401 "textarea",
402 "tfoot",
403 "th",
404 "thead",
405 "tr",
406 "tt",
407 "u",
408 "ul",
409 "var",
410 "ruby", // Ruby Annotation XHTML module
411 "rbc",
412 "rtc",
413 "rb",
414 "rt",
415 "rp"
416 );
417 return $tags;
418 }
$tags
Definition: croninfo.php:19

References $tags.

◆ _getRichTextEditor()

static ilObjAdvancedEditing::_getRichTextEditor ( )
static

Returns the identifier for the Rich Text Editor.

Returns the identifier for the Rich Text Editor

Returns
string Identifier for the Rich Text Editor

Definition at line 200 of file class.ilObjAdvancedEditing.php.

201 {
202 include_once "./Services/Administration/classes/class.ilSetting.php";
203 $setting = new ilSetting("advanced_editing");
204 $js = $setting->get("advanced_editing_javascript_editor");
205 return $js;
206 }
$js

References $js, and $setting.

Referenced by ilRTE\_getRTEClassname(), ilTinyMCE\addRTESupport(), and ilNewsItemGUI\isRteActivated().

+ Here is the caller graph for this function:

◆ _getRichTextEditorUserState()

static ilObjAdvancedEditing::_getRichTextEditorUserState ( )
static

Gets the state of the rich text editor visibility for the current user.

Gets the state of the rich text editor visibility for the current user

Returns
integer 0 if the RTE should be disabled, 1 otherwise

Definition at line 443 of file class.ilObjAdvancedEditing.php.

444 {
445 global $DIC;
446
447 $ilUser = $DIC->user();
448 if (strlen($ilUser->getPref("show_rte")) > 0) {
449 return $ilUser->getPref("show_rte");
450 }
451 return 1;
452 }
$ilUser
Definition: imgupload.php:18

References $DIC, and $ilUser.

Referenced by ilTinyMCE\addRTESupport().

+ Here is the caller graph for this function:

◆ _getUsedHTMLTags()

static ilObjAdvancedEditing::_getUsedHTMLTags (   $a_module = "")
static

Returns an array of all allowed HTML tags for text editing.

Returns an array of all allowed HTML tags for text editing

Parameters
string$a_moduleName of the module or object which uses the tags
Returns
array HTML tags

Definition at line 99 of file class.ilObjAdvancedEditing.php.

100 {
101 $usedtags = array();
102 include_once "./Services/Administration/classes/class.ilSetting.php";
103 $setting = new ilSetting("advanced_editing");
104 $tags = $setting->get("advanced_editing_used_html_tags_" . $a_module);
105 if (strlen($tags)) {
106 $usedtags = unserialize($tags);
107 } else {
108 if ($a_module == 'frm_post' || $a_module == 'exc_ass') {
109 $usedtags = array(
110 "a",
111 "blockquote",
112 "br",
113 "code",
114 "div",
115 "em",
116 "img",
117 "li",
118 "ol",
119 "p",
120 "strong",
121 "u",
122 "ul",
123 "span"
124 );
125 } else {
126 // default: everything but tables
127 $usedtags = array(
128 "a",
129 "blockquote",
130 "br",
131 "cite",
132 "code",
133 "dd",
134 "div",
135 "dl",
136 "dt",
137 "em",
138 "h1",
139 "h2",
140 "h3",
141 "h4",
142 "h5",
143 "h6",
144 "hr",
145 "img",
146 "li",
147 "ol",
148 "p",
149 "pre",
150 "span",
151 "strike",
152 "strong",
153 "sub",
154 "sup",
155 "u",
156 "ul"
157 );
158 }
159 }
160
161 // frm_posts need blockquote and div urgently
162 if ($a_module === 'frm_post') {
163 if (!in_array('div', $usedtags)) {
164 $usedtags[] = 'div';
165 }
166
167 if (!in_array('blockquote', $usedtags)) {
168 $usedtags[] = 'blockquote';
169 }
170 }
171
172 return $usedtags;
173 }

References $setting, and $tags.

Referenced by _getUsedHTMLTagsAsString(), assClozeTestGUI\addBasicQuestionFormProperties(), assQuestionGUI\addBasicQuestionFormProperties(), ilTinyMCE\addRTESupport(), ilAssQuestionFeedback\buildFeedbackContentFormProperty(), ilAssQuestionHintGUI\buildForm(), ilAssHtmlPurifier\getElementsUsedForAdvancedEditing(), ilHtmlForumPostPurifier\getPurifierConfigInstance(), SurveyQuestionGUI\initEditForm(), ilSurveyEditorGUI\initHeadingForm(), ilObjSurveyGUI\initPropertiesForm(), ilObjAdvancedEditingGUI\initTagsForm(), assClozeTestGUI\populateQuestionSpecificFormPart(), assLongMenuGUI\populateQuestionSpecificFormPart(), ilSurveyPageGUI\renderPage(), and ilExSubmissionTextGUI\updateAssignmentTextObject().

+ Here is the caller graph for this function:

◆ _getUsedHTMLTagsAsString()

static ilObjAdvancedEditing::_getUsedHTMLTagsAsString (   $a_module = "")
static

Returns a string of all allowed HTML tags for text editing.

Returns a string of all allowed HTML tags for text editing

Parameters
string$a_moduleName of the module or object which uses the tags
Returns
string Used HTML tags

Definition at line 183 of file class.ilObjAdvancedEditing.php.

184 {
185 $result = "";
187 foreach ($tags as $tag) {
188 $result .= "<$tag>";
189 }
190 return $result;
191 }
$result
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
if(function_exists( 'posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag
Definition: cron.php:35

References $result, $tag, $tags, and _getUsedHTMLTags().

Referenced by ilEssayKeywordWizardInputGUI\checkInput(), ilKprimChoiceWizardInputGUI\checkInput(), ilMatchingWizardInputGUI\checkInput(), ilMultipleChoiceWizardInputGUI\checkInput(), ilSingleChoiceWizardInputGUI\checkInput(), ilObjSurvey\cloneTextblocks(), ilSurveyEditorGUI\saveHeadingObject(), ilTestScoringGUI\saveManScoringParticipantScreen(), ilContainerGUI\savePageContentObject(), ilObjTestSettingsGeneralGUI\saveTestFinishProperties(), and ilObjTestSettingsGeneralGUI\saveTestIntroProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _setRichTextEditorUserState()

static ilObjAdvancedEditing::_setRichTextEditorUserState (   $a_state)
static

Sets the state of the rich text editor visibility for the current user.

Sets the state of the rich text editor visibility for the current user

Parameters
integer$a_state0 if the RTE should be disabled, 1 otherwise

Definition at line 427 of file class.ilObjAdvancedEditing.php.

428 {
429 global $DIC;
430
431 $ilUser = $DIC->user();
432 $ilUser->writePref("show_rte", $a_state);
433 }

References $DIC, and $ilUser.

Referenced by ilTinyMCE\addRTESupport().

+ Here is the caller graph for this function:

◆ delete()

ilObjAdvancedEditing::delete ( )

delete object and all related data

@access public

Returns
boolean true if all object data were removed; false if only a references were removed

Definition at line 79 of file class.ilObjAdvancedEditing.php.

80 {
81 // always call parent delete function first!!
82 if (!parent::delete()) {
83 return false;
84 }
85
86 //put here your module specific stuff
87
88 return true;
89 }

◆ getHTMLTags()

& ilObjAdvancedEditing::getHTMLTags ( )

Returns an array of all possible HTML tags for text editing.

Returns an array of all possible HTML tags for text editing

Returns
array HTML tags

Definition at line 273 of file class.ilObjAdvancedEditing.php.

274 {
275 $tags = array(
276 "a",
277 "blockquote",
278 "br",
279 "cite",
280 "code",
281 "dd",
282 "div",
283 "dl",
284 "dt",
285 "em",
286 "h1",
287 "h2",
288 "h3",
289 "h4",
290 "h5",
291 "h6",
292 "hr",
293 "img",
294 "li",
295 "object",
296 "ol",
297 "p",
298 "param",
299 "pre",
300 "span",
301 "strike",
302 "strong",
303 "sub",
304 "sup",
305 "table",
306 "td",
307 "tr",
308 "u",
309 "ul",
310 "ruby", // Ruby Annotation XHTML module
311 "rbc",
312 "rtc",
313 "rb",
314 "rt",
315 "rp"
316 );
317 return $tags;
318 }

References $tags.

◆ setRichTextEditor()

ilObjAdvancedEditing::setRichTextEditor (   $a_js_editor)

Sets wheather a Rich Text Editor should be used or not.

Sets wheather a Rich Text Editor should be used or not

Parameters
boolean$a_js_editorA boolean indicating if the JS editor should be used or not

Definition at line 215 of file class.ilObjAdvancedEditing.php.

216 {
217 include_once "./Services/Administration/classes/class.ilSetting.php";
218 $setting = new ilSetting("advanced_editing");
219 $setting->set("advanced_editing_javascript_editor", $a_js_editor);
220 }

References $setting.

◆ setUsedHTMLTags()

ilObjAdvancedEditing::setUsedHTMLTags (   $a_html_tags,
  $a_module 
)

Writes an array with allowed HTML tags to the ILIAS settings.

Writes an array with allowed HTML tags to the ILIAS settings

Parameters
array$a_html_tagsAn array containing the allowed HTML tags
string$a_moduleThe name of the module or object which uses the tags
Exceptions
ilAdvancedEditingRequiredTagsException

Definition at line 232 of file class.ilObjAdvancedEditing.php.

233 {
235
236 if (strlen($a_module)) {
237 $auto_added_tags = array();
238
239 // frm_posts need blockquote and div urgently
240 if ($a_module == 'frm_post') {
241 if (!in_array('div', $a_html_tags)) {
242 $auto_added_tags[] = 'div';
243 }
244
245 if (!in_array('blockquote', $a_html_tags)) {
246 $auto_added_tags[] = 'blockquote';
247 }
248 }
249
250 include_once "./Services/Administration/classes/class.ilSetting.php";
251 $setting = new ilSetting("advanced_editing");
252 $setting->set("advanced_editing_used_html_tags_" . $a_module, serialize(array_merge((array) $a_html_tags, $auto_added_tags)));
253
254 if (count($auto_added_tags)) {
255 require_once 'Services/AdvancedEditing/exceptions/class.ilAdvancedEditingRequiredTagsException.php';
257 sprintf(
258 $lng->txt('advanced_editing_required_tags'),
259 implode(', ', $auto_added_tags)
260 )
261 );
262 }
263 }
264 }
sprintf('%.4f', $callTime)
Class for advanced editing exception handling in ILIAS.

References ilObject\$lng, $setting, and sprintf.

◆ update()

ilObjAdvancedEditing::update ( )

update object data

@access public

Returns
boolean

Reimplemented from ilObject.

Definition at line 61 of file class.ilObjAdvancedEditing.php.

62 {
63 if (!parent::update()) {
64 return false;
65 }
66
67 // put here object specific stuff
68
69 return true;
70 }
update($pash, $contents, Config $config)

References League\Flysystem\Adapter\Polyfill\update().

+ Here is the call graph for this function:

Field Documentation

◆ $setting

ilObjAdvancedEditing::$setting

The documentation for this class was generated from the following file: