LTI Integration Library 4.10.3
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
MediaType/ResourceHandler.php
1<?php
2
3namespace ceLTIc\LTI\MediaType;
4
6use ceLTIc\LTI\Profile;
7
16{
17
23 public $resource_type = null;
24
30 public $resource_name = null;
31
37 public $description = null;
38
44 public $icon_info = null;
45
51 public $message = null;
52
59 function __construct($tool, $resourceHandler)
60 {
61 $this->resource_type = new \stdClass;
62 $this->resource_type->code = $resourceHandler->item->id;
63 $this->resource_name = new \stdClass;
64 $this->resource_name->default_value = $resourceHandler->item->name;
65 $this->resource_name->key = "{$resourceHandler->item->id}.resource.name";
66 $this->description = new \stdClass;
67 $this->description->default_value = $resourceHandler->item->description;
68 $this->description->key = "{$resourceHandler->item->id}.resource.description";
69 $icon_info = new \stdClass;
70 $icon_info->default_location = new \stdClass;
71 $icon_info->default_location->path = $resourceHandler->icon;
72 $icon_info->key = "{$resourceHandler->item->id}.icon.path";
73 $this->icon_info = array();
74 $this->icon_info[] = $icon_info;
75 $this->message = array();
76 foreach ($resourceHandler->requiredMessages as $message) {
77 $this->message[] = new Message($message, $tool->platform->profile->capability_offered);
78 }
79 foreach ($resourceHandler->optionalMessages as $message) {
80 if (in_array($message->type, $tool->platform->profile->capability_offered)) {
81 $this->message[] = new Message($message, $tool->platform->profile->capability_offered);
82 }
83 }
84 }
85
86}
Class to represent an LTI Message.
Class to represent an LTI Resource Handler.
__construct($tool, $resourceHandler)
Class constructor.
Class to represent an LTI Tool.
Definition Tool.php:24