86 private ?
string $url =
null;
144 if (!empty($this->documentTarget)) {
145 $placement = new \stdClass();
147 if (!is_null($this->displayHeight)) {
150 if (!is_null($this->displayWidth)) {
153 if (!empty($this->windowTarget)) {
170 if (!empty($this->documentTarget)) {
171 $placement = new \stdClass();
172 switch ($this->documentTarget) {
174 if (!empty($this->url)) {
177 if (!is_null($this->displayWidth)) {
180 if (!is_null($this->displayHeight)) {
185 if (!is_null($this->displayWidth)) {
188 if (!is_null($this->displayHeight)) {
191 if (!is_null($this->windowTarget)) {
194 if (!is_null($this->windowFeatures)) {
199 if (!empty($this->
html)) {
226 if (isset($item->{
'@type'})) {
228 if (isset($item->placementAdvice->presentationDocumentTarget)) {
233 if (isset($item->placementAdvice->displayWidth)) {
236 if (isset($item->placementAdvice->displayHeight)) {
239 if (isset($item->placementAdvice->windowTarget)) {
243 if (isset($item->url)) {
248 if (isset($item->embed)) {
250 } elseif (isset($item->iframe)) {
252 } elseif (isset($item->window)) {
262 if (isset($item->{$documentTarget}->height)) {
263 $displayHeight = $item->{$documentTarget}->height;
265 if (isset($item->{$documentTarget}->targetName)) {
266 $windowTarget = $item->{$documentTarget}->targetName;
268 if (isset($item->{$documentTarget}->windowFeatures)) {
269 $windowFeatures = $item->{$documentTarget}->windowFeatures;
271 if (isset($item->{$documentTarget}->src)) {
272 $url = $item->{$documentTarget}->src;
274 if (isset($item->{$documentTarget}->html)) {
275 $html = $item->{$documentTarget}->html;
279 if (!empty($documentTarget)) {
280 $obj =
new Placement($documentTarget, $displayWidth, $displayHeight, $windowTarget, $windowFeatures,
$url, $html);
Class to represent a content-item placement object.
const TYPE_EMBED
Embed placement type.
string $windowFeatures
Comma-separated list of window features.
string $url
URL of iframe src.
int $displayWidth
Width of item location.
static fromJsonObject(object $item, string $documentTarget=null)
Generate the Placement object from an item.
string $html
HTML to be embedded.
toJsonldObject()
Generate the JSON-LD object representation of the placement.
string $documentTarget
Location to open content in.
const TYPE_WINDOW
Window placement type.
string $windowTarget
Name of window target.
const TYPE_POPUP
Popup placement type.
const TYPE_FRAME
Frame placement type.
int $displayHeight
Height of item location.
toJsonObject()
Generate the JSON object representation of the placement.
const TYPE_IFRAME
iFrame placement type.
__construct(string $documentTarget, ?int $displayWidth=null, ?int $displayHeight=null, ?string $windowTarget=null, ?string $windowFeatures=null, string $url=null, ?string $html=null)
Class constructor.
const TYPE_OVERLAY
Overlay placement type.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...