ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
class.ilOrgUnitType.php
Go to the documentation of this file.
1 <?php
2 require_once('class.ilOrgUnitTypeTranslation.php');
3 require_once('./Modules/OrgUnit/exceptions/class.ilOrgUnitTypeException.php');
4 require_once('./Modules/OrgUnit/exceptions/class.ilOrgUnitTypePluginException.php');
5 require_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
6 
14 
15  const TABLE_NAME = 'orgu_types';
19  const WEB_DATA_FOLDER = 'orgu_data';
23  protected $id = 0;
27  protected $default_lang = '';
31  protected $owner;
35  protected $create_date;
39  protected $last_update;
43  protected $icon;
47  protected $translations = array();
55  protected static $amd_records_available;
59  protected $orgus;
63  protected $orgus_ids;
67  protected $db;
71  protected $log;
75  protected $user;
79  protected $pluginAdmin;
83  protected $active_plugins;
87  protected $lng;
93  protected static $instances = array();
94 
95 
101  public function __construct($a_id = 0) {
102  global $ilDB, $ilLog, $ilUser, $ilPluginAdmin, $lng;
103  $this->db = $ilDB;
104  $this->log = $ilLog;
105  $this->user = $ilUser;
106  $this->pluginAdmin = $ilPluginAdmin;
107  $this->lng = $lng;
108  if ($a_id) {
109  $this->id = (int)$a_id;
110  $this->read();
111  }
112  }
113 
126  public static function getInstance($a_id) {
127  if (!$a_id) {
128  return NULL;
129  }
130  if (isset(self::$instances[$a_id])) {
131  return self::$instances[$a_id];
132  } else {
133  try {
134  $type = new self($a_id);
135  self::$instances[$a_id] = $type;
136 
137  return $type;
138  } catch (ilOrgUnitTypeException $e) {
139  return NULL;
140  }
141  }
142  }
143 
144 
150  public static function getAllTypes() {
151  global $ilDB;
152  $sql = 'SELECT id FROM ' . self::TABLE_NAME;
153  $set = $ilDB->query($sql);
154  $types = array();
155  while ($rec = $ilDB->fetchObject($set)) {
156  $type = new self($rec->id);
157  $types[] = $type;
158  self::$instances[$rec->id] = $type;
159  }
160 
161  return $types;
162  }
163 
164 
170  public function create() {
171  $default_lang = $this->getDefaultLang();
172  $title = $this->getTranslation('title', $default_lang);
173  if (!$default_lang || !$title) {
174  throw new ilOrgUnitTypeException($this->lng->txt('orgu_type_msg_missing_title_default_language'));
175  }
176 
177  $this->id = $this->db->nextId(self::TABLE_NAME);
178  $this->db->insert(self::TABLE_NAME, array(
179  'id' => array( 'integer', $this->getId() ),
180  'default_lang' => array( 'text', $this->getDefaultLang() ),
181  'owner' => array( 'integer', $this->user->getId() ),
182  'icon' => array( 'text', $this->getIcon() ),
183  'create_date' => array( 'text', date('Y-m-d H:i:s') ),
184  'last_update' => array( 'text', date('Y-m-d H:i:s') ),
185  ));
186 
187  // Create translation(s)
189  foreach ($this->translations as $lang => $trans) {
190  $trans->setOrguTypeId($this->getId());
191  $trans->create();
192  }
193  }
194 
195 
202  public function update() {
203  $title = $this->getTranslation('title', $this->getDefaultLang());
204  if (!$title) {
205  throw new ilOrgUnitTypeException($this->lng->txt('orgu_type_msg_missing_title'));
206  }
207 
208  $disallowed = array();
209  $titles = array();
211  foreach ($this->getActivePlugins() as $plugin) {
212  if (!$plugin->allowUpdate($this->getId())) {
213  $disallowed[] = $plugin;
214  $titles[] = $plugin->getPluginName();
215  }
216  }
217  if (count($disallowed)) {
218  $msg = sprintf($this->lng->txt('orgu_type_msg_updating_prevented'), implode(', ', $titles));
219  throw new ilOrgUnitTypePluginException($msg, $disallowed);
220  }
221 
222  $this->db->update(self::TABLE_NAME, array(
223  'default_lang' => array( 'text', $this->getDefaultLang() ),
224  'owner' => array( 'integer', $this->getOwner() ),
225  'icon' => array( 'text', $this->getIcon() ),
226  'last_update' => array( 'text', date('Y-m-d H:i:s') ),
227  ), array(
228  'id' => array( 'integer', $this->getId() ),
229  ));
230 
231  // Update translation(s)
233  foreach ($this->translations as $trans) {
234  $trans->update();
235  }
236  }
237 
238 
244  public function save() {
245  if ($this->getId()) {
246  $this->update();
247  } else {
248  $this->create();
249  }
250  }
251 
252 
259  public function delete() {
260  $orgus = $this->getOrgUnits(false);
261  if (count($orgus)) {
262  $titles = array();
264  foreach ($orgus as $orgu) {
265  $titles[] = $orgu->getTitle();
266  }
267  throw new ilOrgUnitTypeException(sprintf($this->lng->txt('orgu_type_msg_unable_delete'), implode(', ', $titles)));
268  }
269 
270  $disallowed = array();
271  $titles = array();
273  foreach ($this->getActivePlugins() as $plugin) {
274  if (!$plugin->allowDelete($this->getId())) {
275  $disallowed[] = $plugin;
276  $titles[] = $plugin->getPluginName();
277  }
278  }
279  if (count($disallowed)) {
280  $msg = sprintf($this->lng->txt('orgu_type_msg_deletion_prevented'), implode(', ', $titles));
281  throw new ilOrgUnitTypePluginException($msg, $disallowed);
282  }
283 
284  $sql = 'DELETE FROM ' . self::TABLE_NAME . ' WHERE id = ' . $this->db->quote($this->getId(), 'integer');
285  $this->db->manipulate($sql);
286 
287  // Reset Type of OrgUnits (in Trash)
288  $this->db->update('orgu_data', array(
289  'orgu_type_id' => array( 'integer', 0 ),
290  ), array(
291  'orgu_type_id' => array( 'integer', $this->getId() ),
292  ));
293 
294  // Delete all translations
295  ilOrgUnitTypeTranslation::deleteAllTranslations($this->getId());
296 
297  // Delete icon & folder
298  if (is_file($this->getIconPath(true))) {
299  unlink($this->getIconPath(true));
300  }
301  if (is_dir($this->getIconPath())) {
302  rmdir($this->getIconPath());
303  }
304 
305  // Delete relations to advanced metadata records
306  $sql = 'DELETE FROM orgu_types_adv_md_rec WHERE type_id = ' . $this->db->quote($this->getId(), 'integer');
307  $this->db->manipulate($sql);
308  }
309 
310 
320  public function getTitle($a_lang_code = '') {
321  return $this->getTranslation('title', $a_lang_code);
322  }
323 
324 
332  public function setTitle($a_title, $a_lang_code = '') {
333  $lang = ($a_lang_code) ? $a_lang_code : $this->getDefaultLang();
334  $this->setTranslation('title', $a_title, $lang);
335  }
336 
337 
347  public function getDescription($a_lang_code = '') {
348  return $this->getTranslation('description', $a_lang_code);
349  }
350 
351 
359  public function setDescription($a_description, $a_lang_code = '') {
360  $lang = ($a_lang_code) ? $a_lang_code : $this->getDefaultLang();
361  $this->setTranslation('description', $a_description, $lang);
362  }
363 
364 
372  public function getOrgUnitIds($include_deleted = true) {
373  $cache_key = ($include_deleted) ? 1 : 0;
374  if (is_array($this->orgus_ids[$cache_key])) {
375  return $this->orgus_ids[$cache_key];
376  }
377  if ($include_deleted) {
378  $sql = 'SELECT * FROM orgu_data WHERE orgu_type_id = ' . $this->db->quote($this->getId(), 'integer');
379  } else {
380  $sql =
381  'SELECT DISTINCT orgu_id FROM orgu_data od ' . 'JOIN object_reference oref ON oref.obj_id = od.orgu_id ' . 'WHERE od.orgu_type_id = '
382  . $this->db->quote($this->getId(), 'integer') . ' AND oref.deleted IS NULL';
383  }
384  $set = $this->db->query($sql);
385  $this->orgus_ids[$cache_key] = array();
386  while ($rec = $this->db->fetchObject($set)) {
387  $this->orgus_ids[$cache_key][] = $rec->orgu_id;
388  }
389 
390  return $this->orgus_ids[$cache_key];
391  }
392 
393 
401  public function getOrgUnits($include_deleted = true) {
402  $cache_key = ($include_deleted) ? 1 : 0;
403  if (is_array($this->orgus[$cache_key])) {
404  return $this->orgus[$cache_key];
405  }
406  $this->orgus[$cache_key] = array();
407  $ids = $this->getOrgUnitIds($include_deleted);
408  foreach ($ids as $id) {
409  $orgu = new ilObjOrgUnit($id, false);
410  if (!$include_deleted) {
411  // Check if OrgUnit is in trash (each OrgUnit does only have one reference)
412  $ref_ids = ilObject::_getAllReferences($id);
413  $ref_ids = array_values($ref_ids);
414  $ref_id = $ref_ids[0];
415  if ($orgu->_isInTrash($ref_id)) {
416  continue;
417  }
418  }
419  $this->orgus[$cache_key][] = $orgu;
420  }
421 
422  return $this->orgus[$cache_key];
423  }
424 
425 
433  public function getAssignedAdvancedMDRecords($a_only_active = false) {
434  $active = ($a_only_active) ? 1 : 0; // Cache key
435  if (is_array($this->amd_records_assigned[$active])) {
436  return $this->amd_records_assigned[$active];
437  }
438  $this->amd_records_assigned[$active] = array();
439  $sql = 'SELECT * FROM orgu_types_adv_md_rec WHERE type_id = ' . $this->db->quote($this->getId(), 'integer');
440  $set = $this->db->query($sql);
441  while ($rec = $this->db->fetchObject($set)) {
442  $amd_record = new ilAdvancedMDRecord($rec->rec_id);
443  if ($a_only_active) {
444  if ($amd_record->isActive()) {
445  $this->amd_records_assigned[1][] = $amd_record;
446  }
447  } else {
448  $this->amd_records_assigned[0][] = $amd_record;
449  }
450  }
451 
452  return $this->amd_records_assigned[$active];
453  }
454 
455 
463  public function getAssignedAdvancedMDRecordIds($a_only_active = false) {
464  $ids = array();
466  foreach ($this->getAssignedAdvancedMDRecords($a_only_active) as $record) {
467  $ids[] = $record->getRecordId();
468  }
469 
470  return $ids;
471  }
472 
473 
479  public static function getAvailableAdvancedMDRecords() {
480  if (is_array(self::$amd_records_available)) {
481  return self::$amd_records_available;
482  }
483  self::$amd_records_available = ilAdvancedMDRecord::_getActivatedRecordsByObjectType('orgu', 'orgu_type');
484 
485  return self::$amd_records_available;
486  }
487 
488 
494  public static function getAvailableAdvancedMDRecordIds() {
495  $ids = array();
497  foreach (self::getAvailableAdvancedMDRecords() as $record) {
498  $ids[] = $record->getRecordId();
499  }
500 
501  return $ids;
502  }
503 
504 
515  public function assignAdvancedMDRecord($a_record_id) {
516  if (!in_array($a_record_id, $this->getAssignedAdvancedMDRecordIds())) {
517  if (!in_array($a_record_id, self::getAvailableAdvancedMDRecordIds())) {
518  throw new ilOrgUnitTypeException("AdvancedMDRecord with ID {$a_record_id} cannot be assigned to OrgUnit types");
519  }
521  $disallowed = array();
522  $titles = array();
523  foreach ($this->getActivePlugins() as $plugin) {
524  if (!$plugin->allowAssignAdvancedMDRecord($this->getId(), $a_record_id)) {
525  $disallowed[] = $plugin;
526  $titles[] = $plugin->getPluginName();
527  }
528  }
529  if (count($disallowed)) {
530  $msg = sprintf($this->lng->txt('orgu_type_msg_assign_amd_prevented'), implode(', ', $titles));
531  throw new ilOrgUnitTypePluginException($msg, $disallowed);
532  }
533  $record_ids = $this->getAssignedAdvancedMDRecordIds();
534  $record_ids[] = $a_record_id;
535  $this->db->insert('orgu_types_adv_md_rec', array(
536  'type_id' => array( 'integer', $this->getId() ),
537  'rec_id' => array( 'integer', $a_record_id ),
538  ));
539  // We need to update each OrgUnit from this type and map the selected records to object_id
540  foreach ($this->getOrgUnitIds() as $orgu_id) {
541  ilAdvancedMDRecord::saveObjRecSelection($orgu_id, 'orgu_type', $record_ids);
542  }
543  $this->amd_records_assigned = NULL; // Force reload of assigned objects
544  }
545  }
546 
547 
555  public function deassignAdvancedMdRecord($a_record_id) {
556  $record_ids = $this->getAssignedAdvancedMDRecordIds();
557  $key = array_search($a_record_id, $record_ids);
558  if ($key !== false) {
560  $disallowed = array();
561  $titles = array();
562  foreach ($this->getActivePlugins() as $plugin) {
563  if (!$plugin->allowDeassignAdvancedMDRecord($this->getId(), $a_record_id)) {
564  $disallowed[] = $plugin;
565  $titles[] = $plugin->getPluginName();
566  }
567  }
568  if (count($disallowed)) {
569  $msg = sprintf($this->lng->txt('orgu_type_msg_deassign_amd_prevented'), implode(', ', $titles));
570  throw new ilOrgUnitTypePluginException($msg, $disallowed);
571  }
572  unset($record_ids[$key]);
573  $sql = 'DELETE FROM orgu_types_adv_md_rec
574  WHERE type_id = ' . $this->db->quote($this->getId(), 'integer') . '
575  AND rec_id = ' . $this->db->quote($a_record_id, 'integer');
576  $this->db->query($sql);
577  // We need to update each OrgUnit from this type and map the selected records to object_id
578  foreach ($this->getOrgUnitIds() as $orgu_id) {
579  ilAdvancedMDRecord::saveObjRecSelection($orgu_id, 'orgu_type', $record_ids);
580  }
581  $this->amd_records_assigned = NULL; // Force reload of assigned objects
582  }
583  }
584 
585 
593  public function processAndStoreIconFile(array $file_data) {
594  if (!$this->updateable()) {
595  return false;
596  }
597  if (!count($file_data) || !$file_data['name']) {
598  return false;
599  }
600  if (!is_dir($this->getIconPath())) {
602  }
603  $filename = $this->getIcon() ? $this->getIcon() : $file_data['name'];
604  $return = ilUtil::moveUploadedFile($file_data['tmp_name'], $filename, $this->getIconPath(true), false);
605 
606  // TODO Resize
607  return $return;
608  }
609 
610 
614  public function removeIconFile() {
615  if (!$this->updateable()) {
616  return;
617  }
618  if (is_file($this->getIconPath(true))) {
619  unlink($this->getIconPath(true));
620  $this->setIcon('');
621  }
622  }
623 
624 
637  protected function getTranslation($a_member, $a_lang_code) {
638  $lang = ($a_lang_code) ? $a_lang_code : $this->user->getLanguage();
639  $trans_obj = $this->loadTranslation($lang);
640  if (!is_null($trans_obj)) {
641  $translation = $trans_obj->getMember($a_member);
642  // If the translation does exist but is an empty string and there was no lang code given,
643  // substitute default language anyway because an empty string provides no information
644  if (!$a_lang_code && !$translation) {
645  $trans_obj = $this->loadTranslation($this->getDefaultLang());
646 
647  return $trans_obj->getMember($a_member);
648  }
649 
650  return $translation;
651  } else {
652  // If no lang code was given and there was no translation found, return string in default language
653  if (!$a_lang_code) {
654  $trans_obj = $this->loadTranslation($this->getDefaultLang());
655 
656  return $trans_obj->getMember($a_member);
657  }
658 
659  return NULL;
660  }
661  }
662 
663 
673  protected function setTranslation($a_member, $a_value, $a_lang_code) {
674  $a_value = trim($a_value);
675  // If the value is identical, quit early and do not execute plugin checks
676  $existing_translation = $this->getTranslation($a_member, $a_lang_code);
677  if ($existing_translation == $a_value) {
678  return;
679  }
680  // #19 Title should be unique per language
681  // if ($a_value && $a_member == 'title') {
682  // if (ilOrgUnitTypeTranslation::exists($this->getId(), 'title', $a_lang_code, $a_value)) {
683  // throw new ilOrgUnitTypeException($this->lng->txt('orgu_type_msg_title_already_exists'));
684  // }
685  // }
686  $disallowed = array();
687  $titles = array();
689  foreach ($this->getActivePlugins() as $plugin) {
690  $allowed = true;
691  if ($a_member == 'title') {
692  $allowed = $plugin->allowSetTitle($this->getId(), $a_lang_code, $a_value);
693  } else {
694  if ($a_member == 'description') {
695  $allowed = $plugin->allowSetDescription($this->getId(), $a_lang_code, $a_value);
696  }
697  }
698  if (!$allowed) {
699  $disallowed[] = $plugin;
700  $titles[] = $plugin->getPluginName();
701  }
702  }
703  if (count($disallowed)) {
704  $msg = sprintf($this->lng->txt('orgu_type_msg_setting_member_prevented'), $a_value, implode(', ', $titles));
705  throw new ilOrgUnitTypePluginException($msg, $disallowed);
706  }
707  $trans_obj = $this->loadTranslation($a_lang_code);
708  if (!is_null($trans_obj)) {
709  $trans_obj->setMember($a_member, $a_value);
710  } else {
711  $trans_obj = new ilOrgUnitTypeTranslation();
712  $trans_obj->setOrguTypeId($this->getId());
713  $trans_obj->setLang($a_lang_code);
714  $trans_obj->setMember($a_member, $a_value);
715  $this->translations[$a_lang_code] = $trans_obj;
716  // Create language object here if this type is already in DB.
717  // Otherwise, translations are created when calling create() on this object.
718  if ($this->getId()) {
719  $trans_obj->create();
720  }
721  }
722  }
723 
724 
730  protected function getActivePlugins() {
731  if ($this->active_plugins === NULL) {
732  $active_plugins = $this->pluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, 'OrgUnit', 'orgutypehk');
733  $this->active_plugins = array();
734  foreach ($active_plugins as $pl_name) {
736  $plugin = $this->pluginAdmin->getPluginObject(IL_COMP_MODULE, 'OrgUnit', 'orgutypehk', $pl_name);
737  $this->active_plugins[] = $plugin;
738  }
739  }
740 
741  return $this->active_plugins;
742  }
743 
744 
753  protected function loadTranslation($a_lang_code) {
754  if (isset($this->translations[$a_lang_code])) {
755  return $this->translations[$a_lang_code];
756  } else {
757  $trans_obj = ilOrgUnitTypeTranslation::getInstance($this->getId(), $a_lang_code);
758  if (!is_null($trans_obj)) {
759  $this->translations[$a_lang_code] = $trans_obj;
760 
761  return $trans_obj;
762  }
763  }
764 
765  return NULL;
766  }
767 
768 
774  protected function read() {
775  $sql = 'SELECT * FROM ' . self::TABLE_NAME . ' WHERE id = ' . $this->db->quote($this->id, 'integer');
776  $set = $this->db->query($sql);
777  if (!$this->db->numRows($set)) {
778  throw new ilOrgUnitTypeException("OrgUnit type with id {$this->id} does not exist in database");
779  }
780  $rec = $this->db->fetchObject($set);
781  $this->default_lang = $rec->default_lang; // Don't use Setter because of unnecessary plugin checks
782  $this->setCreateDate($rec->create_date);
783  $this->setLastUpdate($rec->last_update);
784  $this->setOwner($rec->owner);
785  $this->setIcon($rec->icon);
786  }
787 
788 
794  protected function updateable() {
795  foreach ($this->getActivePlugins() as $plugin) {
796  if (!$plugin->allowUpdate($this->getId())) {
797  return false;
798  }
799  }
800 
801  return true;
802  }
803 
804 
812  public function setTranslations($translations) {
813  $this->translations = $translations;
814  }
815 
816 
822  public function getTranslations() {
823  return $this->translations;
824  }
825 
826 
832  public function getAllTranslations() {
833  $translations = ilOrgUnitTypeTranslation::getAllTranslations($this->getId());
835  foreach ($translations as $trans) {
836  $this->translations[$trans->getLang()] = $trans;
837  }
838 
839  return $this->translations;
840  }
841 
842 
846  public function setOwner($owner) {
847  $this->owner = $owner;
848  }
849 
850 
854  public function getOwner() {
855  return $this->owner;
856  }
857 
858 
862  public function setLastUpdate($last_update) {
863  $this->last_update = $last_update;
864  }
865 
866 
870  public function getLastUpdate() {
871  return $this->last_update;
872  }
873 
874 
878  public function getId() {
879  return $this->id;
880  }
881 
882 
895  public function setIcon($icon) {
896  if ($icon AND !preg_match('/\.(svg)$/', $icon)) {
897  throw new ilOrgUnitTypeException('Icon must be set with file extension svg');
898  }
899  $this->icon = $icon;
900  }
901 
902 
906  public function getIcon() {
907  return $this->icon;
908  }
909 
910 
918  public function getIconPath($append_filename = false) {
919  $path = ilUtil::getWebspaceDir() . '/' . self::WEB_DATA_FOLDER . '/' . 'type_' . $this->getId() . '/';
920  if ($append_filename) {
921  $path .= $this->getIcon();
922  }
923 
924  return $path;
925  }
926 
927 
933  public function setDefaultLang($default_lang) {
934  // If the new default_lang is identical, quit early and do not execute plugin checks
935  if ($this->default_lang == $default_lang) {
936  return;
937  }
938  $disallowed = array();
939  $titles = array();
943  foreach ($this->getActivePlugins() as $plugin) {
944  if (!$plugin->allowSetDefaultLanguage($this->getId(), $default_lang)) {
945  $disallowed[] = $plugin;
946  $titles[] = $plugin->getPluginName();
947  }
948  }
949  if (count($disallowed)) {
950  $msg = sprintf($this->lng->txt('orgu_type_msg_setting_default_lang_prevented'), $default_lang, implode(', ', $titles));
951  throw new ilOrgUnitTypePluginException($msg, $disallowed);
952  }
953 
954  $this->default_lang = $default_lang;
955  }
956 
957 
961  public function getDefaultLang() {
962  return $this->default_lang;
963  }
964 
965 
969  public function setCreateDate($create_date) {
970  $this->create_date = $create_date;
971  }
972 
973 
977  public function getCreateDate() {
978  return $this->create_date;
979  }
980 }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
setTranslations($translations)
Getters & Setters.
Class ilOrgUnitTypeException.
save()
Wrapper around create() and update() methods.
updateable()
Helper function to check if this type can be updated.
Class ilOrgUnitType.
processAndStoreIconFile(array $file_data)
Resize and store an icon file for this object.
setTitle($a_title, $a_lang_code='')
Set title of OrgUnit type.
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="")
Get activated records by object type.
static getAllTypes()
Get array of all instances of ilOrgUnitType objects.
static getAvailableAdvancedMDRecords()
Get all available AdvancedMDRecord objects for OrgUnits/Types.
static saveObjRecSelection($a_obj_id, $a_sub_type="", array $a_records=null, $a_delete_before=true)
Save repository object record selection.
static _getAllReferences($a_id)
get all reference ids of object
getOrgUnitIds($include_deleted=true)
Get an array of IDs of ilObjOrgUnit objects using this type.
read()
Read object data from database.
setIcon($icon)
Set new Icon filename.
getIconPath($append_filename=false)
Return the path to the icon.
setCreateDate($create_date)
getTranslation($a_member, $a_lang_code)
Protected.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Class ilObjOrgUnit.
static getInstance($a_id)
Public.
const IL_COMP_MODULE
removeIconFile()
Remove the icon file on disk.
getTranslations()
Returns the loaded translation objects.
$filename
Definition: buildRTE.php:89
loadTranslation($a_lang_code)
Helper function to load a translation.
getOrgUnits($include_deleted=true)
Get an array of ilObjOrgUnit objects using this type.
Class ilOrgUnitTypeTranslation This class represents a translation for a given ilOrgUnit object and l...
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
$path
Definition: index.php:22
global $ilDB
Class ilOrgUnitTypePluginException This exception is thrown whenever one or multiple ilOrgUnitTypeHoo...
getAssignedAdvancedMDRecords($a_only_active=false)
Get assigned AdvancedMDRecord objects.
const WEB_DATA_FOLDER
Folder in ILIAS webdir to store the icons.
static getInstance($a_orgu_type_id, $a_lang_code)
Public.
setLastUpdate($last_update)
static getWebspaceDir($mode="filesystem")
get webspace directory
getTitle($a_lang_code='')
Get the title of an OrgUnit type.
getDescription($a_lang_code='')
Get the description of an OrgUnit type.
setDescription($a_description, $a_lang_code='')
Set description of OrgUnit type.