ILIAS  trunk Revision v11.0_alpha-1871-gde1fee8db3d
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjAdvancedEditing Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (int $a_id=0, bool $a_call_by_reference=true)
 
 setRichTextEditor (string $a_js_editor)
 
 setUsedHTMLTags (array $a_html_tags, string $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
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! 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. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static _getUsedHTMLTags (string $a_module="")
 Returns an array of all allowed HTML tags for text editing. More...
 
static _getUsedHTMLTagsAsString (string $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 (int $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 (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", ?int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static getIconForType (string $type)
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, ?\ilDBInterface $ilDB=null)
 

Data Fields

ilSetting $setting
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Additional Inherited Members

- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
LOMServices $lom_services
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjAdvancedEditing

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\lng().

31  {
32  global $DIC;
33 
34  $this->lng = $DIC->language();
35  $this->setting = new ilSetting("advanced_editing");
36  $this->type = "adve";
37  parent::__construct($a_id, $a_call_by_reference);
38  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getAllHTMLTags()

static ilObjAdvancedEditing::_getAllHTMLTags ( )
static

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

Returns
array HTML tags

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

242  : array
243  {
244  return array(
245  "a",
246  "abbr",
247  "acronym",
248  "address",
249  "applet",
250  "area",
251  "b",
252  "base",
253  "basefont",
254  "bdo",
255  "big",
256  "blockquote",
257  "br",
258  "button",
259  "caption",
260  "center",
261  "cite",
262  "code",
263  "col",
264  "colgroup",
265  "dd",
266  "del",
267  "dfn",
268  "dir",
269  "div",
270  "dl",
271  "dt",
272  "em",
273  "fieldset",
274  "font",
275  "form",
276  "h1",
277  "h2",
278  "h3",
279  "h4",
280  "h5",
281  "h6",
282  "hr",
283  "i",
284  "iframe",
285  "img",
286  "input",
287  "ins",
288  "isindex",
289  "kbd",
290  "label",
291  "legend",
292  "li",
293  "link",
294  "map",
295  "menu",
296  "object",
297  "ol",
298  "optgroup",
299  "option",
300  "p",
301  "param",
302  "pre",
303  "q",
304  "s",
305  "samp",
306  "select",
307  "small",
308  "span",
309  "strike",
310  "strong",
311  "sub",
312  "sup",
313  "table",
314  "tbody",
315  "td",
316  "textarea",
317  "tfoot",
318  "th",
319  "thead",
320  "tr",
321  "tt",
322  "u",
323  "ul",
324  "var",
325  "ruby", // Ruby Annotation XHTML module
326  "rbc",
327  "rtc",
328  "rb",
329  "rt",
330  "rp"
331  );
332  }

◆ _getRichTextEditor()

static ilObjAdvancedEditing::_getRichTextEditor ( )
static

Returns the identifier for the Rich Text Editor.

Returns
string Identifier for the Rich Text Editor

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

Referenced by ilRTE\_getRTEClassname(), ilTinyMCE\addRTESupport(), assTextQuestion\getSolutionSubmit(), ilObjAdvancedEditingGUI\getTinyForm(), ilExAssignmentEditorGUI\initAssignmentForm(), ilExSubmissionTextGUI\initAssignmentTextForm(), SurveyQuestionGUI\initEditForm(), ILIAS\Test\Scoring\Manual\TestScoringByQuestionGUI\initJavascript(), ILIAS\Survey\Settings\SettingsFormGUI\withAfterEnd(), and ILIAS\Survey\Settings\SettingsFormGUI\withBeforeStart().

136  : string
137  {
138  return (new ilSetting("advanced_editing"))->get("advanced_editing_javascript_editor", "0");
139  }
+ 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.

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

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

References $DIC.

Referenced by ilTinyMCE\addRTESupport().

349  : int
350  {
351  global $DIC;
352 
353  $ilUser = $DIC->user();
354  if ($ilUser->getPref("show_rte") != '') {
355  return (int) $ilUser->getPref("show_rte");
356  }
357  return 1;
358  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ _getUsedHTMLTags()

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

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 45 of file class.ilObjAdvancedEditing.php.

References ilSetting\get().

Referenced by ilWebDAVMountInstructionsDocumentPurifier\__construct(), ilAccessibilityDocumentHtmlPurifier\__construct(), ILIAS\LegalDocuments\HTMLPurifier\__construct(), assQuestionGUI\addBasicQuestionFormProperties(), ilTinyMCE\addRTESupport(), ilAssQuestionFeedback\buildFeedbackContentFormProperty(), ilAssQuestionHintGUI\buildForm(), ilAssHtmlPurifier\getElementsUsedForAdvancedEditing(), ilHtmlForumPostPurifier\getPurifierConfigInstance(), ilUserImportParser\importEndTag(), ilObjAdvancedEditingGUI\initTagsForm(), assLongMenuGUI\populateQuestionSpecificFormPart(), assClozeTestGUI\populateQuestionSpecificFormPart(), and ilExSubmissionTextGUI\updateAssignmentTextObject().

45  : array
46  {
47  $setting = new ilSetting("advanced_editing");
48  $tags = $setting->get("advanced_editing_used_html_tags_" . $a_module, '');
49  if ($tags !== '') {
50  $usedtags = unserialize($tags, ["allowed_classes" => false]);
51  } elseif ($a_module === 'frm_post' || $a_module === 'exc_ass') {
52  $usedtags = array(
53  "a",
54  "blockquote",
55  "br",
56  "code",
57  "div",
58  "em",
59  "img",
60  "li",
61  "ol",
62  "p",
63  "strong",
64  "u",
65  "ul",
66  "span"
67  );
68  } else {
69  // default: everything but tables
70  $usedtags = array(
71  "a",
72  "blockquote",
73  "br",
74  "cite",
75  "code",
76  "dd",
77  "div",
78  "dl",
79  "dt",
80  "em",
81  "h1",
82  "h2",
83  "h3",
84  "h4",
85  "h5",
86  "h6",
87  "hr",
88  "img",
89  "li",
90  "ol",
91  "p",
92  "pre",
93  "span",
94  "strike",
95  "strong",
96  "sub",
97  "sup",
98  "u",
99  "ul"
100  );
101  }
102 
103  // frm_posts need blockquote and div urgently
104  if ($a_module === 'frm_post') {
105  if (!in_array('div', $usedtags, true)) {
106  $usedtags[] = 'div';
107  }
108 
109  if (!in_array('blockquote', $usedtags, true)) {
110  $usedtags[] = 'blockquote';
111  }
112  }
113 
114  return $usedtags;
115  }
get(string $a_keyword, ?string $a_default_value=null)
get setting
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUsedHTMLTagsAsString()

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

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 122 of file class.ilObjAdvancedEditing.php.

Referenced by ilKprimChoiceWizardInputGUI\cleanupAnswerText(), assQuestionGUI\cleanupAnswerText(), ilObjSurvey\cloneTextblocks(), ilSurveyEditorGUI\saveHeadingObject(), ILIAS\Test\Scoring\Manual\TestScoringByQuestionGUI\saveManScoringByQuestion(), and ILIAS\Test\Scoring\Manual\TestScoringByParticipantGUI\saveManScoringParticipantScreen().

122  : string
123  {
124  $result = "";
125  $tags = self::_getUsedHTMLTags($a_module);
126  foreach ($tags as $tag) {
127  $result .= "<$tag>";
128  }
129  return $result;
130  }
+ Here is the caller graph for this function:

◆ _setRichTextEditorUserState()

static ilObjAdvancedEditing::_setRichTextEditorUserState ( int  $a_state)
static

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

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

References $DIC.

Referenced by ilTinyMCE\addRTESupport(), and ilObjForumGUI\initReplyEditForm().

337  : void
338  {
339  global $DIC;
340 
341  $ilUser = $DIC->user();
342  $ilUser->writePref("show_rte", (string) $a_state);
343  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ getHTMLTags()

& ilObjAdvancedEditing::getHTMLTags ( )

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

Returns
array HTML tags

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

191  : array
192  {
193  $tags = array(
194  "a",
195  "blockquote",
196  "br",
197  "cite",
198  "code",
199  "dd",
200  "div",
201  "dl",
202  "dt",
203  "em",
204  "h1",
205  "h2",
206  "h3",
207  "h4",
208  "h5",
209  "h6",
210  "hr",
211  "img",
212  "li",
213  "object",
214  "ol",
215  "p",
216  "param",
217  "pre",
218  "span",
219  "strike",
220  "strong",
221  "sub",
222  "sup",
223  "table",
224  "td",
225  "tr",
226  "u",
227  "ul",
228  "ruby", // Ruby Annotation XHTML module
229  "rbc",
230  "rtc",
231  "rb",
232  "rt",
233  "rp"
234  );
235  return $tags;
236  }

◆ setRichTextEditor()

ilObjAdvancedEditing::setRichTextEditor ( string  $a_js_editor)

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

References ilSetting\set().

141  : void
142  {
143  $setting = new ilSetting("advanced_editing");
144  $setting->set("advanced_editing_javascript_editor", $a_js_editor);
145  }
set(string $a_key, string $a_val)
+ Here is the call graph for this function:

◆ setUsedHTMLTags()

ilObjAdvancedEditing::setUsedHTMLTags ( array  $a_html_tags,
string  $a_module 
)

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 153 of file class.ilObjAdvancedEditing.php.

References ilObject\$lng, ilSetting\set(), and ilLanguage\txt().

156  : void {
157  $lng = $this->lng;
158 
159  if ($a_module !== '') {
160  $auto_added_tags = array();
161 
162  // frm_posts need blockquote and div urgently
163  if ($a_module === 'frm_post') {
164  if (!in_array('div', $a_html_tags, true)) {
165  $auto_added_tags[] = 'div';
166  }
167 
168  if (!in_array('blockquote', $a_html_tags, true)) {
169  $auto_added_tags[] = 'blockquote';
170  }
171  }
172 
173  $setting = new ilSetting("advanced_editing");
174  $setting->set("advanced_editing_used_html_tags_" . $a_module, serialize(array_merge($a_html_tags, $auto_added_tags)));
175 
176  if (count($auto_added_tags)) {
178  sprintf(
179  $lng->txt('advanced_editing_required_tags'),
180  implode(', ', $auto_added_tags)
181  )
182  );
183  }
184  }
185  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
set(string $a_key, string $a_val)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilLanguage $lng
+ Here is the call graph for this function:

Field Documentation

◆ $setting

ilSetting ilObjAdvancedEditing::$setting

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


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