ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ToolProfile.php
Go to the documentation of this file.
1<?php
2
5
16{
17
19
25 function __construct($toolProvider)
26 {
27
28 $this->lti_version = 'LTI-2p0';
29
30 if (!empty($toolProvider->product)) {
31 $this->product_instance = new \stdClass;
32 }
33 if (!empty($toolProvider->product->id)) {
34 $this->product_instance->guid = $toolProvider->product->id;
35 }
36 if (!empty($toolProvider->product->name)) {
37 $this->product_instance->product_info = new \stdClass;
38 $this->product_instance->product_info->product_name = new \stdClass;
39 $this->product_instance->product_info->product_name->default_value = $toolProvider->product->name;
40 $this->product_instance->product_info->product_name->key = 'tool.name';
41 }
42 if (!empty($toolProvider->product->description)) {
43 $this->product_instance->product_info->description = new \stdClass;
44 $this->product_instance->product_info->description->default_value = $toolProvider->product->description;
45 $this->product_instance->product_info->description->key = 'tool.description';
46 }
47 if (!empty($toolProvider->product->url)) {
48 $this->product_instance->guid = $toolProvider->product->url;
49 }
50 if (!empty($toolProvider->product->version)) {
51 $this->product_instance->product_info->product_version = $toolProvider->product->version;
52 }
53 if (!empty($toolProvider->vendor)) {
54 $this->product_instance->product_info->product_family = new \stdClass;
55 $this->product_instance->product_info->product_family->vendor = new \stdClass;
56 }
57 if (!empty($toolProvider->vendor->id)) {
58 $this->product_instance->product_info->product_family->vendor->code = $toolProvider->vendor->id;
59 }
60 if (!empty($toolProvider->vendor->name)) {
61 $this->product_instance->product_info->product_family->vendor->vendor_name = new \stdClass;
62 $this->product_instance->product_info->product_family->vendor->vendor_name->default_value = $toolProvider->vendor->name;
63 $this->product_instance->product_info->product_family->vendor->vendor_name->key = 'tool.vendor.name';
64 }
65 if (!empty($toolProvider->vendor->description)) {
66 $this->product_instance->product_info->product_family->vendor->description = new \stdClass;
67 $this->product_instance->product_info->product_family->vendor->description->default_value = $toolProvider->vendor->description;
68 $this->product_instance->product_info->product_family->vendor->description->key = 'tool.vendor.description';
69 }
70 if (!empty($toolProvider->vendor->url)) {
71 $this->product_instance->product_info->product_family->vendor->website = $toolProvider->vendor->url;
72 }
73 if (!empty($toolProvider->vendor->timestamp)) {
74 $this->product_instance->product_info->product_family->vendor->timestamp = date('Y-m-d\TH:i:sP', $toolProvider->vendor->timestamp);
75 }
76
77 $this->resource_handler = array();
78 foreach ($toolProvider->resourceHandlers as $resourceHandler) {
79 $this->resource_handler[] = new ResourceHandler($toolProvider, $resourceHandler);
80 }
81 if (!empty($toolProvider->baseUrl)) {
82 $this->base_url_choice = array();
83 $this->base_url_choice[] = new \stdClass;
84 $this->base_url_choice[0]->default_base_url = $toolProvider->baseUrl;
85 }
86
87 }
88
89}
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
Class to represent an LTI Resource Handler.
Class to represent an LTI Tool Profile.
Definition: ToolProfile.php:16
__construct($toolProvider)
Class constructor.
Definition: ToolProfile.php:25
Class to represent an LTI Tool Provider.