ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjLTIAdministration Class Reference
+ Inheritance diagram for ilObjLTIAdministration:
+ Collaboration diagram for ilObjLTIAdministration:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 
 getLTIObjectTypes ()
 
 getLTIRoles ()
 
 saveConsumerObjectTypes ($a_consumer_id, $a_obj_types)
 
 getActiveObjectTypes ($a_consumer_id)
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor 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 public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title 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 public More...
 
 getLastUpdateDate ()
 get last update date 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) 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 lookupLTISettingsRefId ()
 Lookup ref_id. More...
 
static readReleaseObjects ()
 Read released objects. 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 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 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...
 

Additional Inherited Members

- 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
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Detailed Description

Definition at line 12 of file class.ilObjLTIAdministration.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 14 of file class.ilObjLTIAdministration.php.

15  {
16  $this->type = "ltis";
17  parent::__construct($a_id, $a_call_by_reference);
18  }

Member Function Documentation

◆ getActiveObjectTypes()

ilObjLTIAdministration::getActiveObjectTypes (   $a_consumer_id)
Parameters
integer$a_consumer_id
Returns
array consumer active objects

Definition at line 75 of file class.ilObjLTIAdministration.php.

References $a_type, ilObject\$db, $DIC, $GLOBALS, $ilDB, $query, $res, $result, $row, array, and ilLTIToolConsumer\fromExternalConsumerId().

76  {
77  global $DIC;
78  $ilDB = $DIC['ilDB'];
79 
80  $result = $ilDB->query("SELECT object_type FROM lti_ext_consumer_otype WHERE consumer_id = " . $ilDB->quote($a_consumer_id, "integer"));
81 
82  $obj_ids = array();
83  while ($record = $ilDB->fetchAssoc($result)) {
84  array_push($obj_ids, $record['object_type']);
85  }
86  return $obj_ids;
87  }
$result
global $DIC
Definition: saml.php:7
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

◆ getLTIObjectTypes()

ilObjLTIAdministration::getLTIObjectTypes ( )
Returns
string[] Array of lti provider supportting object types

Definition at line 23 of file class.ilObjLTIAdministration.php.

24  {
25  $obj_def = new ilObjectDefinition();
26  return $obj_def->getLTIProviderTypes();
27  }
parses the objects.xml it handles the xml-description of all ilias objects

◆ getLTIRoles()

ilObjLTIAdministration::getLTIRoles ( )
Returns
array available roles for LTI

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

References ilObject\$rbacreview, and array.

33  {
34  global $rbacreview;
35 
36  require_once("Services/AccessControl/classes/class.ilObjRole.php");
37 
38  $global_roles = $rbacreview->getGlobalRoles();
39 
40  $filtered_roles = array_diff($global_roles, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID));
41 
42  $roles = array();
43  foreach ($filtered_roles as $role) {
44  $obj_role = new ilObjRole($role);
45  $roles[$role] = $obj_role->getTitle();
46  }
47 
48  return $roles;
49  }
Class ilObjRole.
Create styles array
The data for the language used.

◆ lookupLTISettingsRefId()

static ilObjLTIAdministration::lookupLTISettingsRefId ( )
static

Lookup ref_id.

Definition at line 137 of file class.ilObjLTIAdministration.php.

References $GLOBALS, $res, $row, and array.

Referenced by ilLTIProviderObjectSettingGUI\hasSettingsAccess().

138  {
139  $res = $GLOBALS['DIC']->database()->queryF(
140  '
141  SELECT object_reference.ref_id FROM object_reference, tree, object_data
142  WHERE tree.parent = %s
143  AND object_data.type = %s
144  AND object_reference.ref_id = tree.child
145  AND object_reference.obj_id = object_data.obj_id',
146  array('integer', 'text'),
147  array(SYSTEM_FOLDER_ID, 'ltis')
148  );
149  while ($row = $GLOBALS['DIC']->database()->fetchAssoc($res)) {
150  $lti_ref_id = $row['ref_id'];
151  }
152  return $lti_ref_id;
153  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ readReleaseObjects()

static ilObjLTIAdministration::readReleaseObjects ( )
static

Read released objects.

Definition at line 158 of file class.ilObjLTIAdministration.php.

References ilObject\$db, $GLOBALS, $query, $res, $row, $rows, and ilLoggerFactory\getLogger().

Referenced by ilLTIProviderReleasedObjectsTableGUI\parse().

159  {
160  $db = $GLOBALS['DIC']->database();
161 
162  $query = 'select ref_id, title from lti2_consumer join lti_ext_consumer ' .
163  'on id = ext_consumer_id where enabled = ' . $db->quote(1, 'integer');
164  $res = $db->query($query);
165 
166  ilLoggerFactory::getLogger('lti')->debug($query);
167 
168  $rows = [];
169  while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
170  $item['ref_id'] = $row->ref_id;
171  $item['title'] = $row->title;
172 
173  $rows[] = $item;
174  }
175  return $rows;
176  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
foreach($_POST as $key=> $value) $res
$query
$rows
Definition: xhr_table.php:10
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveConsumerObjectTypes()

ilObjLTIAdministration::saveConsumerObjectTypes (   $a_consumer_id,
  $a_obj_types 
)
Parameters
integer$a_consumer_id
array$a_obj_types

Definition at line 55 of file class.ilObjLTIAdministration.php.

References $ilDB, $query, and array.

56  {
57  global $ilDB;
58 
59  $ilDB->manipulate("DELETE FROM lti_ext_consumer_otype WHERE consumer_id = " . $ilDB->quote($a_consumer_id, "integer"));
60 
61  if ($a_obj_types) {
62  $query = "INSERT INTO lti_ext_consumer_otype (consumer_id, object_type) VALUES (%s, %s)";
63  $types = array("integer", "text");
64  foreach ($a_obj_types as $ot) {
65  $values = array($a_consumer_id, $ot);
66  $ilDB->manipulateF($query, $types, $values);
67  }
68  }
69  }
$query
Create styles array
The data for the language used.
global $ilDB

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