ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDidacticTemplateSetting Class Reference
+ Collaboration diagram for ilDidacticTemplateSetting:

Public Member Functions

 __construct (int $a_id=0)
 Constructor. More...
 
 getIconHandler ()
 
 getId ()
 
 enable (bool $a_status)
 
 isEnabled ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 getPresentationTitle (string $a_lng="")
 
 getDescription ()
 
 getPresentationDescription (string $a_lng="")
 
 setDescription (string $a_description)
 
 setInfo (string $a_info)
 Set installation info text. More...
 
 getInfo ()
 Get installation info text. More...
 
 setType (int $a_type)
 
 getType ()
 
 hasIconSupport (ilObjectDefinition $definition)
 
 setAssignments (array $a_ass)
 
 getAssignments ()
 
 addAssignment (string $a_obj_type)
 
 getEffectiveFrom ()
 
 setEffectiveFrom (array $effective_from)
 
 isAutoGenerated ()
 
 isExclusive ()
 
 setExclusive (bool $exclusive)
 
 setIconIdentifier (string $icon_identifier)
 
 getIconIdentifier ()
 
 getTranslations ()
 Get all translations from this object. More...
 
 delete ()
 
 save ()
 
 update ()
 
 toXml (ilXmlWriter $writer)
 
 __clone ()
 
 getTranslationObject ()
 
 isEffective (int $a_node_id)
 

Data Fields

const TYPE_CREATION = 1
 

Protected Member Functions

 setId (int $a_id)
 
 getPresentation (string $a_value, string $a_lng)
 
 saveEffectiveNodes ()
 
 deleteEffectiveNodes ()
 
 readEffectiveNodes ()
 
 read ()
 

Private Member Functions

 setAutoGenerated (bool $auto_generated)
 
 saveAssignments ()
 Save assignments in DB. More...
 
 saveAssignment (string $a_obj_type)
 Add one object assignment. More...
 
 deleteAssignments ()
 Delete assignments. More...
 

Private Attributes

int $id = 0
 
bool $enabled = false
 
string $title = ''
 
string $description = ''
 
string $info = ''
 
int $type = self::TYPE_CREATION
 
array $assignments = []
 
array $effective_from = []
 
bool $auto_generated = false
 
bool $exclusive = false
 
string $icon_ide = ''
 
ilDidacticTemplateIconHandler $iconHandler = null
 
ilLanguage $lng
 
ilObjUser $user
 
ilDBInterface $db
 
ilSetting $setting
 
ilTree $tree
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilDidacticTemplateSetting::__construct ( int  $a_id = 0)

Constructor.

Parameters
int$a_id

Definition at line 56 of file class.ilDidacticTemplateSetting.php.

57 {
58 global $DIC;
59
60 $this->lng = $DIC->language();
61 $this->user = $DIC->user();
62 $this->db = $DIC->database();
63 $this->setting = $DIC->settings();
64 $this->tree = $DIC->repositoryTree();
65
66 $this->setId($a_id);
67 $this->read();
68 $this->iconHandler = new ilDidacticTemplateIconHandler($this);
69 }
Icon handler for didactic template custom icons.
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\lng(), read(), setId(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ __clone()

ilDidacticTemplateSetting::__clone ( )

Definition at line 530 of file class.ilDidacticTemplateSetting.php.

531 {
532 $this->setId(0);
533
535 $this->enable(false);
536 $this->setAutoGenerated(false);
537 $this->iconHandler = new ilDidacticTemplateIconHandler($this);
538 }
static appendCopyInfo(string $a_orig_title)

References ilDidacticTemplateCopier\appendCopyInfo(), enable(), getTitle(), setAutoGenerated(), setId(), and setTitle().

+ Here is the call graph for this function:

◆ addAssignment()

ilDidacticTemplateSetting::addAssignment ( string  $a_obj_type)

Definition at line 192 of file class.ilDidacticTemplateSetting.php.

192 : void
193 {
194 $this->assignments[] = $a_obj_type;
195 }

Referenced by read().

+ Here is the caller graph for this function:

◆ delete()

ilDidacticTemplateSetting::delete ( )

Definition at line 284 of file class.ilDidacticTemplateSetting.php.

284 : bool
285 {
286 if ($this->isAutoGenerated()) {
287 return false;
288 }
289
290 // Delete settings
291 $query = 'DELETE FROM didactic_tpl_settings ' .
292 'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
293 $this->db->manipulate($query);
294
295 // Delete obj assignments
296 $query = 'DELETE FROM didactic_tpl_sa ' .
297 'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
298 $this->db->manipulate($query);
299
301 $action->delete();
302 }
304 $this->getTranslationObject()->delete();
305 $this->deleteEffectiveNodes();
306 $this->getIconHandler()->delete();
307
308 return true;
309 }
static getActionsByTemplateId(int $a_tpl_id)
Get actions of one template.

References ilDidacticTemplateObjSettings\deleteByTemplateId(), deleteEffectiveNodes(), ilDidacticTemplateActionFactory\getActionsByTemplateId(), getIconHandler(), getId(), getTranslationObject(), and isAutoGenerated().

Referenced by ilDidacticTemplateSettingsGUI\editImport().

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

◆ deleteAssignments()

ilDidacticTemplateSetting::deleteAssignments ( )
private

Delete assignments.

Definition at line 412 of file class.ilDidacticTemplateSetting.php.

412 : bool
413 {
414 if ($this->isAutoGenerated()) {
415 return false;
416 }
417
418 $query = 'DELETE FROM didactic_tpl_sa ' .
419 'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
420 $this->db->manipulate($query);
421
422 return true;
423 }

References getId(), and isAutoGenerated().

Referenced by update().

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

◆ deleteEffectiveNodes()

ilDidacticTemplateSetting::deleteEffectiveNodes ( )
protected

Definition at line 386 of file class.ilDidacticTemplateSetting.php.

386 : bool
387 {
388 $query = 'DELETE FROM didactic_tpl_en ' .
389 'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
390 $this->db->manipulate($query);
391
392 return true;
393 }

References getId().

Referenced by delete(), and update().

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

◆ enable()

ilDidacticTemplateSetting::enable ( bool  $a_status)

Definition at line 86 of file class.ilDidacticTemplateSetting.php.

86 : void
87 {
88 $this->enabled = $a_status;
89 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ getAssignments()

ilDidacticTemplateSetting::getAssignments ( )

◆ getDescription()

ilDidacticTemplateSetting::getDescription ( )

Definition at line 116 of file class.ilDidacticTemplateSetting.php.

116 : string
117 {
118 return $this->description;
119 }

References $description.

Referenced by getPresentationDescription(), getTranslations(), save(), toXml(), and update().

+ Here is the caller graph for this function:

◆ getEffectiveFrom()

ilDidacticTemplateSetting::getEffectiveFrom ( )
Returns
int[]

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

200 : array
201 {
203 }

References $effective_from.

Referenced by ilDidacticTemplateSettingsGUI\initEditTemplate(), isEffective(), ilDidacticTemplateSettingsTableFilter\isFiltered(), saveEffectiveNodes(), and toXml().

+ Here is the caller graph for this function:

◆ getIconHandler()

ilDidacticTemplateSetting::getIconHandler ( )

◆ getIconIdentifier()

ilDidacticTemplateSetting::getIconIdentifier ( )

Definition at line 238 of file class.ilDidacticTemplateSetting.php.

238 : string
239 {
240 return $this->icon_ide;
241 }

References $icon_ide.

Referenced by ilDidacticTemplateIconHandler\copy(), save(), and update().

+ Here is the caller graph for this function:

◆ getId()

◆ getInfo()

ilDidacticTemplateSetting::getInfo ( )

Get installation info text.

Returns
string

Definition at line 149 of file class.ilDidacticTemplateSetting.php.

149 : string
150 {
151 return $this->info;
152 }

References $info.

Referenced by ilDidacticTemplateSettingsGUI\initEditTemplate(), ilDidacticTemplateSettingsTableFilter\isFiltered(), save(), toXml(), and update().

+ Here is the caller graph for this function:

◆ getPresentation()

ilDidacticTemplateSetting::getPresentation ( string  $a_value,
string  $a_lng 
)
protected

Definition at line 268 of file class.ilDidacticTemplateSetting.php.

268 : string
269 {
270 $lang = $this->getTranslationObject()->getLanguages();
271
272 if (!$lang) {
273 return '';
274 }
275 if (!$a_lng) {
276 $a_lng = $this->user->getCurrentLanguage();
277 }
278 if (!isset($lang[$a_lng])) {
279 $a_lng = $this->getTranslationObject()->getDefaultLanguage();
280 }
281 return $lang[$a_lng][$a_value] ?? '';
282 }
$lang
Definition: xapiexit.php:25

References $lang, getTranslationObject(), and ILIAS\Repository\user().

Referenced by getPresentationDescription(), and getPresentationTitle().

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

◆ getPresentationDescription()

ilDidacticTemplateSetting::getPresentationDescription ( string  $a_lng = "")

Definition at line 121 of file class.ilDidacticTemplateSetting.php.

121 : string
122 {
123 if ($this->isAutoGenerated()) {
124 return $this->lng->txt($this->getDescription());
125 }
126
127 $desc = $this->getPresentation('description', $a_lng);
128 return $desc ?: $this->getDescription();
129 }
getPresentation(string $a_value, string $a_lng)

References getDescription(), getPresentation(), isAutoGenerated(), and ILIAS\Repository\lng().

Referenced by ilDidacticTemplateSettingsGUI\initEditTemplate(), and ilDidacticTemplateSettingsTableFilter\isFiltered().

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

◆ getPresentationTitle()

ilDidacticTemplateSetting::getPresentationTitle ( string  $a_lng = "")

Definition at line 106 of file class.ilDidacticTemplateSetting.php.

106 : string
107 {
108 if ($this->isAutoGenerated()) {
109 return $this->lng->txt($this->getTitle());
110 }
111
112 $tit = $this->getPresentation('title', $a_lng);
113 return $tit ?: $this->getTitle();
114 }

References getPresentation(), getTitle(), isAutoGenerated(), and ILIAS\Repository\lng().

Referenced by ilDidacticTemplateSettingsGUI\initEditTemplate(), and ilDidacticTemplateSettingsTableFilter\isFiltered().

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

◆ getTitle()

ilDidacticTemplateSetting::getTitle ( )

Definition at line 101 of file class.ilDidacticTemplateSetting.php.

101 : string
102 {
103 return $this->title;
104 }

References $title.

Referenced by __clone(), getPresentationTitle(), getTranslations(), save(), toXml(), and update().

+ Here is the caller graph for this function:

◆ getTranslationObject()

ilDidacticTemplateSetting::getTranslationObject ( )

Definition at line 540 of file class.ilDidacticTemplateSetting.php.

541 {
542 return ilMultilingualism::getInstance($this->getId(), "dtpl");
543 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $a_obj_id, string $a_type)

References getId(), and ilMultilingualism\getInstance().

Referenced by delete(), getPresentation(), getTranslations(), and toXml().

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

◆ getTranslations()

ilDidacticTemplateSetting::getTranslations ( )

Get all translations from this object.

Returns
array{title: string, description: string, lang_code: string, lang_default: bool}[]

Definition at line 247 of file class.ilDidacticTemplateSetting.php.

247 : array
248 {
249 $trans = $this->getTranslationObject();
250 $lang = $trans->getLanguages();
251
252 foreach ($lang as $k => $v) {
253 if ($v['lang_default']) {
254 $lang[0] = $v;
255 }
256 }
257
258 // fallback if translation object is empty
259 if (!isset($lang[0])) {
260 $lang[0]['title'] = $this->getTitle();
261 $lang[0]['description'] = $this->getDescription();
262 $lang[0]['lang_code'] = $trans->getDefaultLanguage();
263 }
264
265 return $lang;
266 }

References $lang, getDescription(), getTitle(), and getTranslationObject().

Referenced by ilDidacticTemplateSettingsGUI\initEditTemplate().

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

◆ getType()

ilDidacticTemplateSetting::getType ( )

Definition at line 159 of file class.ilDidacticTemplateSetting.php.

159 : int
160 {
161 return $this->type;
162 }

References $type.

Referenced by save(), toXml(), and update().

+ Here is the caller graph for this function:

◆ hasIconSupport()

ilDidacticTemplateSetting::hasIconSupport ( ilObjectDefinition  $definition)

Definition at line 164 of file class.ilDidacticTemplateSetting.php.

164 : bool
165 {
166 foreach ($this->getAssignments() as $assignment) {
167 if (!$definition->isContainer($assignment)) {
168 return false;
169 }
170 }
171
172 return true;
173 }
isContainer(string $obj_name)
Check if object type is container ('crs','fold','grp' ...)

References getAssignments(), and ilObjectDefinition\isContainer().

+ Here is the call graph for this function:

◆ isAutoGenerated()

◆ isEffective()

ilDidacticTemplateSetting::isEffective ( int  $a_node_id)

Definition at line 545 of file class.ilDidacticTemplateSetting.php.

545 : bool
546 {
547 if (0 === count($this->getEffectiveFrom()) || in_array($a_node_id, $this->getEffectiveFrom())) {
548 return true;
549 }
550
551 foreach ($this->getEffectiveFrom() as $node) {
552 if ($a_node_id > 0 && $this->tree->isGrandChild($node, $a_node_id)) {
553 return true;
554 }
555 }
556
557 return false;
558 }

References getEffectiveFrom().

+ Here is the call graph for this function:

◆ isEnabled()

ilDidacticTemplateSetting::isEnabled ( )

Definition at line 91 of file class.ilDidacticTemplateSetting.php.

91 : bool
92 {
93 return $this->enabled;
94 }

References $enabled.

Referenced by ilDidacticTemplateSettingsGUI\initEditTemplate(), ilDidacticTemplateSettingsTableFilter\isFiltered(), save(), and update().

+ Here is the caller graph for this function:

◆ isExclusive()

ilDidacticTemplateSetting::isExclusive ( )

Definition at line 223 of file class.ilDidacticTemplateSetting.php.

223 : bool
224 {
225 return $this->exclusive;
226 }

References $exclusive.

Referenced by ilDidacticTemplateSettingsGUI\initEditTemplate(), save(), toXml(), and update().

+ Here is the caller graph for this function:

◆ read()

ilDidacticTemplateSetting::read ( )
protected

Definition at line 446 of file class.ilDidacticTemplateSetting.php.

446 : bool
447 {
448 if (!$this->getId()) {
449 return false;
450 }
451 $query = 'SELECT * FROM didactic_tpl_settings dtpl ' .
452 'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
453 $res = $this->db->query($query);
454 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
455 $this->setType((int) $row->type);
456 $this->enable((bool) $row->enabled);
457 $this->setTitle((string) $row->title);
458 $this->setDescription((string) $row->description);
459 $this->setInfo((string) $row->info);
460 $this->setAutoGenerated((bool) $row->auto_generated);
461 $this->setExclusive((bool) $row->exclusive_tpl);
462 $this->setIconIdentifier((string) $row->icon_ide);
463 }
464 $query = 'SELECT * FROM didactic_tpl_sa ' .
465 'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
466 $res = $this->db->query($query);
467 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
468 $this->addAssignment($row->obj_type);
469 }
470 $this->readEffectiveNodes();
471
472 return true;
473 }
setInfo(string $a_info)
Set installation info text.
$res
Definition: ltiservices.php:69

References $res, addAssignment(), enable(), ilDBConstants\FETCHMODE_OBJECT, getId(), readEffectiveNodes(), setAutoGenerated(), setDescription(), setExclusive(), setIconIdentifier(), setInfo(), setTitle(), and setType().

Referenced by __construct().

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

◆ readEffectiveNodes()

ilDidacticTemplateSetting::readEffectiveNodes ( )
protected

Definition at line 395 of file class.ilDidacticTemplateSetting.php.

395 : void
396 {
397 $effective_nodes = [];
398
399 $query = 'SELECT * FROM didactic_tpl_en ' .
400 'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
401 $res = $this->db->query($query);
402 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
403 $effective_nodes[] = (int) $row->node;
404 }
405
406 $this->setEffectiveFrom($effective_nodes);
407 }

References $res, ilDBConstants\FETCHMODE_OBJECT, getId(), ILIAS\Repository\int(), and setEffectiveFrom().

Referenced by read().

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

◆ save()

ilDidacticTemplateSetting::save ( )

Definition at line 311 of file class.ilDidacticTemplateSetting.php.

311 : bool
312 {
313 $this->setId($this->db->nextId('didactic_tpl_settings'));
314 $query = 'INSERT INTO didactic_tpl_settings (id,enabled,title,description,info,type,auto_generated,exclusive_tpl,icon_ide) ' .
315 'VALUES( ' .
316 $this->db->quote($this->getId(), 'integer') . ', ' .
317 $this->db->quote($this->isEnabled(), 'integer') . ', ' .
318 $this->db->quote($this->getTitle(), 'text') . ', ' .
319 $this->db->quote($this->getDescription(), 'text') . ', ' .
320 $this->db->quote($this->getInfo(), 'text') . ', ' .
321 $this->db->quote($this->getType(), 'integer') . ', ' .
322 $this->db->quote((int) $this->isAutoGenerated(), 'integer') . ', ' .
323 $this->db->quote((int) $this->isExclusive(), 'integer') . ', ' .
324 $this->db->quote($this->getIconIdentifier(), ilDBConstants::T_TEXT) . ' ' .
325 ')';
326
327 $this->db->manipulate($query);
328 $this->saveAssignments();
329
330 return true;
331 }
getInfo()
Get installation info text.

References getDescription(), getIconIdentifier(), getId(), getInfo(), getTitle(), getType(), isAutoGenerated(), isEnabled(), isExclusive(), saveAssignments(), setId(), and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

◆ saveAssignment()

ilDidacticTemplateSetting::saveAssignment ( string  $a_obj_type)
private

Add one object assignment.

Parameters
string$a_obj_type

Definition at line 353 of file class.ilDidacticTemplateSetting.php.

353 : void
354 {
355 if ($this->isAutoGenerated()) {
356 return;
357 }
358
359 $query = 'INSERT INTO didactic_tpl_sa (id,obj_type) ' .
360 'VALUES( ' .
361 $this->db->quote($this->getId(), 'integer') . ', ' .
362 $this->db->quote($a_obj_type, 'text') .
363 ')';
364 $this->db->manipulate($query);
365 }

References getId(), and isAutoGenerated().

Referenced by saveAssignments().

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

◆ saveAssignments()

ilDidacticTemplateSetting::saveAssignments ( )
private

Save assignments in DB.

Definition at line 336 of file class.ilDidacticTemplateSetting.php.

336 : bool
337 {
338 if ($this->isAutoGenerated()) {
339 return false;
340 }
341
342 foreach ($this->getAssignments() as $ass) {
343 $this->saveAssignment($ass);
344 }
345
346 return true;
347 }
saveAssignment(string $a_obj_type)
Add one object assignment.

References getAssignments(), isAutoGenerated(), and saveAssignment().

Referenced by save(), and update().

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

◆ saveEffectiveNodes()

ilDidacticTemplateSetting::saveEffectiveNodes ( )
protected

Definition at line 367 of file class.ilDidacticTemplateSetting.php.

367 : void
368 {
369 if (0 === count($this->getEffectiveFrom())) {
370 return;
371 }
372 $values = [];
373 foreach ($this->getEffectiveFrom() as $node) {
374 $values[] = '( ' .
375 $this->db->quote($this->getId(), 'integer') . ', ' .
376 $this->db->quote($node, 'integer') .
377 ')';
378 }
379
380 $query = 'INSERT INTO didactic_tpl_en (id,node) ' .
381 'VALUES ' . implode(', ', $values);
382
383 $this->db->manipulate($query);
384 }

References getEffectiveFrom(), and getId().

Referenced by update().

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

◆ setAssignments()

ilDidacticTemplateSetting::setAssignments ( array  $a_ass)
Parameters
string[]$a_ass
Returns
void

Definition at line 179 of file class.ilDidacticTemplateSetting.php.

179 : void
180 {
181 $this->assignments = $a_ass;
182 }

◆ setAutoGenerated()

ilDidacticTemplateSetting::setAutoGenerated ( bool  $auto_generated)
private

Definition at line 218 of file class.ilDidacticTemplateSetting.php.

218 : void
219 {
220 $this->auto_generated = $auto_generated;
221 }

References $auto_generated.

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setDescription()

ilDidacticTemplateSetting::setDescription ( string  $a_description)

Definition at line 131 of file class.ilDidacticTemplateSetting.php.

131 : void
132 {
133 $this->description = $a_description;
134 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setEffectiveFrom()

ilDidacticTemplateSetting::setEffectiveFrom ( array  $effective_from)
Parameters
int[]$effective_from

Definition at line 208 of file class.ilDidacticTemplateSetting.php.

208 : void
209 {
210 $this->effective_from = $effective_from;
211 }

References $effective_from.

Referenced by readEffectiveNodes().

+ Here is the caller graph for this function:

◆ setExclusive()

ilDidacticTemplateSetting::setExclusive ( bool  $exclusive)

Definition at line 228 of file class.ilDidacticTemplateSetting.php.

228 : void
229 {
230 $this->exclusive = $exclusive;
231 }

References $exclusive.

Referenced by read().

+ Here is the caller graph for this function:

◆ setIconIdentifier()

ilDidacticTemplateSetting::setIconIdentifier ( string  $icon_identifier)

Definition at line 233 of file class.ilDidacticTemplateSetting.php.

233 : void
234 {
235 $this->icon_ide = $icon_identifier;
236 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setId()

ilDidacticTemplateSetting::setId ( int  $a_id)
protected

Definition at line 76 of file class.ilDidacticTemplateSetting.php.

76 : void
77 {
78 $this->id = $a_id;
79 }

Referenced by __clone(), __construct(), and save().

+ Here is the caller graph for this function:

◆ setInfo()

ilDidacticTemplateSetting::setInfo ( string  $a_info)

Set installation info text.

Parameters
string$a_info

Definition at line 140 of file class.ilDidacticTemplateSetting.php.

140 : void
141 {
142 $this->info = $a_info;
143 }

References ILIAS\UI\examples\MessageBox\Info\info().

Referenced by read().

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

◆ setTitle()

ilDidacticTemplateSetting::setTitle ( string  $a_title)

Definition at line 96 of file class.ilDidacticTemplateSetting.php.

96 : void
97 {
98 $this->title = $a_title;
99 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setType()

ilDidacticTemplateSetting::setType ( int  $a_type)

Definition at line 154 of file class.ilDidacticTemplateSetting.php.

154 : void
155 {
156 $this->type = $a_type;
157 }

Referenced by read().

+ Here is the caller graph for this function:

◆ toXml()

ilDidacticTemplateSetting::toXml ( ilXmlWriter  $writer)

Definition at line 475 of file class.ilDidacticTemplateSetting.php.

476 {
477 $type = '';
478 switch ($this->getType()) {
480 $type = 'creation';
481 break;
482 }
483 $writer->xmlStartTag('didacticTemplate', ['type' => $type]);
484 $writer->xmlElement('title', [], $this->getTitle());
485 $writer->xmlElement('description', [], $this->getDescription());
486 $writer = $this->getIconHandler()->toXml($writer);
487 $writer = $this->getTranslationObject()->toXml($writer);
488
489 // info text with p-tags
490 if ($this->getInfo() !== '') {
491 $writer->xmlStartTag('info');
492
493 $info_lines = (array) explode("\n", $this->getInfo());
494 foreach ($info_lines as $info) {
495 $trimmed_info = trim($info);
496 if ($trimmed_info !== '') {
497 $writer->xmlElement('p', [], $trimmed_info);
498 }
499 }
500
501 $writer->xmlEndTag('info');
502 }
503 if ($this->isExclusive()) {
504 $writer->xmlElement("exclusive");
505 }
506 if (count($this->getEffectiveFrom()) > 0) {
507 $writer->xmlStartTag('effectiveFrom', ['nic_id' => $this->setting->get('inst_id')]);
508
509 foreach ($this->getEffectiveFrom() as $node) {
510 $writer->xmlElement('node', [], $node);
511 }
512 $writer->xmlEndTag('effectiveFrom');
513 }
514 // Assignments
515 $writer->xmlStartTag('assignments');
516 foreach ($this->getAssignments() as $assignment) {
517 $writer->xmlElement('assignment', [], $assignment);
518 }
519 $writer->xmlEndTag('assignments');
520 $writer->xmlStartTag('actions');
522 $action->toXml($writer);
523 }
524 $writer->xmlEndTag('actions');
525 $writer->xmlEndTag('didacticTemplate');
526
527 return $writer;
528 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
xmlEndTag(string $tag)
Writes an endtag.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.

References $info, $type, ilDidacticTemplateActionFactory\getActionsByTemplateId(), getAssignments(), getDescription(), getEffectiveFrom(), getIconHandler(), getId(), getInfo(), getTitle(), getTranslationObject(), getType(), isExclusive(), TYPE_CREATION, ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ update()

ilDidacticTemplateSetting::update ( )

Definition at line 425 of file class.ilDidacticTemplateSetting.php.

425 : bool
426 {
427 $query = 'UPDATE didactic_tpl_settings ' .
428 'SET ' .
429 'enabled = ' . $this->db->quote($this->isEnabled(), 'integer') . ', ' .
430 'title = ' . $this->db->quote($this->getTitle(), 'text') . ', ' .
431 'description = ' . $this->db->quote($this->getDescription(), 'text') . ', ' .
432 'info = ' . $this->db->quote($this->getInfo(), 'text') . ', ' .
433 'type = ' . $this->db->quote($this->getType(), 'integer') . ', ' .
434 'exclusive_tpl = ' . $this->db->quote((int) $this->isExclusive(), 'integer') . ', ' .
435 'icon_ide = ' . $this->db->quote($this->getIconIdentifier(), ilDBConstants::T_TEXT) . ' ' .
436 'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
437 $this->db->manipulate($query);
438 $this->deleteAssignments();
439 $this->saveAssignments();
440 $this->deleteEffectiveNodes();
441 $this->saveEffectiveNodes();
442
443 return true;
444 }

References deleteAssignments(), deleteEffectiveNodes(), getDescription(), getIconIdentifier(), getId(), getInfo(), getTitle(), getType(), isEnabled(), isExclusive(), saveAssignments(), saveEffectiveNodes(), and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

Field Documentation

◆ $assignments

array ilDidacticTemplateSetting::$assignments = []
private

Definition at line 37 of file class.ilDidacticTemplateSetting.php.

Referenced by getAssignments().

◆ $auto_generated

bool ilDidacticTemplateSetting::$auto_generated = false
private

Definition at line 40 of file class.ilDidacticTemplateSetting.php.

Referenced by isAutoGenerated(), and setAutoGenerated().

◆ $db

ilDBInterface ilDidacticTemplateSetting::$db
private

Definition at line 48 of file class.ilDidacticTemplateSetting.php.

◆ $description

string ilDidacticTemplateSetting::$description = ''
private

Definition at line 33 of file class.ilDidacticTemplateSetting.php.

Referenced by getDescription().

◆ $effective_from

array ilDidacticTemplateSetting::$effective_from = []
private

Definition at line 39 of file class.ilDidacticTemplateSetting.php.

Referenced by getEffectiveFrom(), and setEffectiveFrom().

◆ $enabled

bool ilDidacticTemplateSetting::$enabled = false
private

Definition at line 31 of file class.ilDidacticTemplateSetting.php.

Referenced by isEnabled().

◆ $exclusive

bool ilDidacticTemplateSetting::$exclusive = false
private

Definition at line 41 of file class.ilDidacticTemplateSetting.php.

Referenced by isExclusive(), and setExclusive().

◆ $icon_ide

string ilDidacticTemplateSetting::$icon_ide = ''
private

Definition at line 42 of file class.ilDidacticTemplateSetting.php.

Referenced by getIconIdentifier().

◆ $iconHandler

ilDidacticTemplateIconHandler ilDidacticTemplateSetting::$iconHandler = null
private

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

Referenced by getIconHandler().

◆ $id

int ilDidacticTemplateSetting::$id = 0
private

Definition at line 30 of file class.ilDidacticTemplateSetting.php.

Referenced by getId().

◆ $info

string ilDidacticTemplateSetting::$info = ''
private

Definition at line 34 of file class.ilDidacticTemplateSetting.php.

Referenced by getInfo(), and toXml().

◆ $lng

ilLanguage ilDidacticTemplateSetting::$lng
private

Definition at line 46 of file class.ilDidacticTemplateSetting.php.

◆ $setting

ilSetting ilDidacticTemplateSetting::$setting
private

Definition at line 49 of file class.ilDidacticTemplateSetting.php.

◆ $title

string ilDidacticTemplateSetting::$title = ''
private

Definition at line 32 of file class.ilDidacticTemplateSetting.php.

Referenced by getTitle().

◆ $tree

ilTree ilDidacticTemplateSetting::$tree
private

Definition at line 50 of file class.ilDidacticTemplateSetting.php.

◆ $type

int ilDidacticTemplateSetting::$type = self::TYPE_CREATION
private

Definition at line 35 of file class.ilDidacticTemplateSetting.php.

Referenced by getType(), and toXml().

◆ $user

ilObjUser ilDidacticTemplateSetting::$user
private

Definition at line 47 of file class.ilDidacticTemplateSetting.php.

◆ TYPE_CREATION

const ilDidacticTemplateSetting::TYPE_CREATION = 1

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