Class to represent a content-item object.
More...
|
| | __construct ($type, $placementAdvices=null, $id=null) |
| | Class constructor.
|
| |
| | setUrl ($url) |
| | Set a URL value for the content-item.
|
| |
| | setMediaType ($mediaType) |
| | Set a media type value for the content-item.
|
| |
| | setTitle ($title) |
| | Set a title value for the content-item.
|
| |
| | setText ($text) |
| | Set a link text value for the content-item.
|
| |
| | setHtml ($html) |
| | Set an HTML embed value for the content-item.
|
| |
| | addPlacementAdvice ($placementAdvice) |
| | Add a placement for the content-item.
|
| |
| | setIcon ($icon) |
| | Set an icon image for the content-item.
|
| |
| | setThumbnail ($thumbnail) |
| | Set a thumbnail image for the content-item.
|
| |
| | setHideOnCreate ($hideOnCreate) |
| | Set whether the content-item should be hidden from learners by default.
|
| |
|
| static string | toJson ($items, $ltiVersion=Util::LTI_VERSION1) |
| | Wrap the content items to form a complete application/vnd.ims.lti.v1.contentitems+json media type instance.
|
| |
| static array | fromJson ($items) |
| | Generate an array of Item objects from their JSON representation.
|
| |
| static Item LtiLinkItem FileItem | fromJsonItem ($item) |
| | Generate an Item object from its JSON or JSON-LD representation.
|
| |
|
|
const | TYPE_LINK = 'link' |
| | Type for link content-item.
|
| |
|
const | TYPE_LTI_LINK = 'ltiResourceLink' |
| | Type for LTI link content-item.
|
| |
|
const | TYPE_LTI_ASSIGNMENT = 'ltiAssignment' |
| | Type for LTI assignment content-item.
|
| |
|
const | TYPE_FILE = 'file' |
| | Type for file content-item.
|
| |
|
const | TYPE_HTML = 'html' |
| | Type for HTML content-item.
|
| |
|
const | TYPE_IMAGE = 'image' |
| | Type for image content-item.
|
| |
|
const | LTI_LINK_MEDIA_TYPE = 'application/vnd.ims.lti.v1.ltilink' |
| | Media type for LTI launch links.
|
| |
|
const | LTI_ASSIGNMENT_MEDIA_TYPE = 'application/vnd.ims.lti.v1.ltiassignment' |
| | Media type for LTI assignment links.
|
| |
Class to represent a content-item object.
- Author
- Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com
- Copyright
- SPV Software Products
- Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3
◆ __construct()
| __construct |
( |
|
$type, |
|
|
|
$placementAdvices = null, |
|
|
|
$id = null |
|
) |
| |
Class constructor.
- Parameters
-
| string | $type | Class type of content-item |
| Placement[] | Placement | $placementAdvices | Array of Placement objects (or single placement object) for item (optional) |
| string | $id | URL of content-item (optional) |
Reimplemented in ContentItem.
Referenced by LtiAssignmentItem\__construct().
◆ addPlacementAdvice()
| addPlacementAdvice |
( |
|
$placementAdvice | ) |
|
Add a placement for the content-item.
- Parameters
-
| Placement | $placementAdvice | Placement advice object |
◆ fromJson()
| static array fromJson |
( |
|
$items | ) |
|
|
static |
Generate an array of Item objects from their JSON representation.
- Parameters
-
| object | $items | A JSON object representing Content-Items |
- Returns
- array Array of Item objects
◆ fromJsonItem()
Generate an Item object from its JSON or JSON-LD representation.
- Parameters
-
| object | $item | A JSON or JSON-LD object representing a content-item |
- Returns
- Item|LtiLinkItem|FileItem The content-item object
◆ fromJsonObject()
Extract content-item details from its JSON representation.
- Parameters
-
| object | $item | A JSON object representing a content-item |
Reimplemented in FileItem, and LtiLinkItem.
◆ setHideOnCreate()
| setHideOnCreate |
( |
|
$hideOnCreate | ) |
|
Set whether the content-item should be hidden from learners by default.
- Parameters
-
| bool | null | $hideOnCreate | True if the item should be hidden from learners |
◆ setHtml()
Set an HTML embed value for the content-item.
- Parameters
-
| string | $html | HTML text value |
◆ setIcon()
Set an icon image for the content-item.
- Parameters
-
| Image | $icon | Icon image object |
◆ setMediaType()
| setMediaType |
( |
|
$mediaType | ) |
|
◆ setText()
Set a link text value for the content-item.
- Parameters
-
| string | $text | Link text value |
◆ setThumbnail()
| setThumbnail |
( |
|
$thumbnail | ) |
|
Set a thumbnail image for the content-item.
- Parameters
-
| Image | $thumbnail | Thumbnail image object |
◆ setTitle()
Set a title value for the content-item.
- Parameters
-
◆ setUrl()
Set a URL value for the content-item.
- Parameters
-
◆ toJson()
Wrap the content items to form a complete application/vnd.ims.lti.v1.contentitems+json media type instance.
- Parameters
-
| mixed | $items | An array of content items or a single item |
| string | $ltiVersion | LTI version in use |
- Returns
- string
◆ toJsonldObject()
| object toJsonldObject |
( |
| ) |
|
|
protected |
Wrap the content item to form an item complying with the application/vnd.ims.lti.v1.contentitems+json media type.
- Returns
- object
Reimplemented in FileItem, and LtiLinkItem.
◆ toJsonObject()
The documentation for this class was generated from the following file: