ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPCMediaObject Class Reference

Class ilPCMediaObject. More...

+ Inheritance diagram for ilPCMediaObject:
+ Collaboration diagram for ilPCMediaObject:

Public Member Functions

 init ()
 Init page content component. More...
 
 readMediaObject ($a_mob_id=0)
 Read/get Media Object. More...
 
 setNode ($a_node)
 
 setDom (&$a_dom)
 set dom object More...
 
 setHierId ($a_hier_id)
 set hierarchical edit id More...
 
 setMediaObject ($a_mediaobject)
 Set Media Object. More...
 
 getMediaObject ()
 Get Media Object. More...
 
 createMediaObject ()
 
 create (&$a_pg_obj, $a_hier_id)
 Create pc media object. More...
 
 createAlias (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create an media alias in page. More...
 
 updateObjectReference ()
 Updates the media object referenced by the media alias. More...
 
 dumpXML ()
 Dump node xml. More...
 
 setClass ($a_class)
 Set Style Class of table. More...
 
 getClass ()
 Get characteristic of section. More...
 
 modifyPageContentPostXsl ($a_html, $a_mode, $a_abstract_only=false)
 
 getJavascriptFiles ($a_mode)
 
 getCssFiles ($a_mode)
 
 getStandardMediaAliasItem ()
 
 getFullscreenMediaAliasItem ()
 
- Public Member Functions inherited from ilPageContent
 __construct ($a_pg_obj)
 Constructor. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 init ()
 Init object. More...
 
 getType ()
 Get type of page content. More...
 
 setNode ($a_node)
 Set xml node of page content. More...
 
getNode ()
 Get xml node of page content. More...
 
 getJavascriptFiles ($a_mode)
 Get Javascript files. More...
 
 getCssFiles ($a_mode)
 Get css files. More...
 
 getOnloadCode ($a_mode)
 Get on load code. More...
 
 setHierId ($a_hier_id)
 Set hierarchical ID in xml structure. More...
 
 getHierId ()
 Get hierarchical id. More...
 
 lookupHierId ()
 Get hierarchical id from dom. More...
 
 readHierId ()
 Read PC Id. More...
 
 setPcId ($a_pcid)
 Set PC Id. More...
 
 getPCId ()
 Get PC Id. More...
 
 setFileDownloadLink ($a_download_link)
 Set file download link. More...
 
 getFileDownloadLink ()
 Get file download link. More...
 
 setProfileBackUrl ($url)
 
 getProfileBackUrl ()
 
 setFullscreenLink ($a_fullscreen_link)
 Set fullscreen link. More...
 
 getFullscreenLink ()
 Get fullscreen link. More...
 
 setSourcecodeDownloadScript ($script_name)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 readPCId ()
 Read PC Id. More...
 
 writePCId ($a_pc_id)
 Write pc id. More...
 
 setEnabled ($value)
 Set Enabled value for page content component. More...
 
 enable ()
 Enable page content. More...
 
 disable ()
 Disable page content. More...
 
 isEnabled ()
 Check whether page content is enabled. More...
 
 createPageContentNode ($a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 modifyPageContentPostXsl ($a_output, $a_mode, $a_abstract_only=false)
 Modify page content after xsl. More...
 
 getModel ()
 Get model. More...
 

Static Public Member Functions

static getLangVars ()
 Get lang vars needed for editing. More...
 
static afterPageUpdate ($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete ($a_page)
 Before page is being deleted. More...
 
static afterPageHistoryEntry ($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
 After page history entry has been created. More...
 
static saveMobUsage ($a_page, $a_domdoc, $a_old_nr=0)
 Save all usages of media objects (media aliases, media objects, internal links) More...
 
- Static Public Member Functions inherited from ilPageContent
static incEdId ($ed_id)
 Increases an hierarchical editing id at lowest level (last number) More...
 
static decEdId ($ed_id)
 Decreases an hierarchical editing id at lowest level (last number) More...
 
static haveSameContainer ($ed_id1, $ed_id2)
 Check, if two ids are in same container. More...
 
static sortHierIds ($a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId ($a, $b)
 Check whether Hier ID $a is greater than Hier ID $b. More...
 
static getLangVars ()
 Get lang vars needed for editing. More...
 
static handleCopiedContent (DOMDocument $a_domdoc, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content. More...
 
static afterPageUpdate ($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete ($a_page)
 Before page is being deleted. More...
 
static afterPageHistoryEntry ($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
 After page history entry has been created. More...
 

Protected Attributes

 $user
 
 $mob_node
 
 $ui
 
 $mediaobject
 
 $lng
 
- Protected Attributes inherited from ilPageContent
 $profile_back_url
 
 $file_download_link
 
 $fullscreen_link
 
 $sourcecode_download_script
 
 $log
 

Additional Inherited Members

- Data Fields inherited from ilPageContent
 $hier_id
 
 $node
 
 $dom
 
 $page_lang
 
- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type. More...
 

Detailed Description

Class ilPCMediaObject.

Media content object (see ILIAS DTD)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 16 of file class.ilPCMediaObject.php.

Member Function Documentation

◆ afterPageHistoryEntry()

static ilPCMediaObject::afterPageHistoryEntry (   $a_page,
DOMDocument  $a_old_domdoc,
  $a_old_xml,
  $a_old_nr 
)
static

After page history entry has been created.

Parameters
object$a_pagepage object
DOMDocument$a_old_domdocold dom document
string$a_old_xmlold xml
integer$a_old_nrhistory number

Definition at line 360 of file class.ilPCMediaObject.php.

361  {
362  self::saveMobUsage($a_page, $a_old_domdoc, $a_old_nr);
363  }

◆ afterPageUpdate()

static ilPCMediaObject::afterPageUpdate (   $a_page,
DOMDocument  $a_domdoc,
  $a_xml,
  $a_creation 
)
static

After page has been updated (or created)

Parameters
object$a_pagepage object
DOMDocument$a_domdocdom document
string$a_xmlxml
bool$a_creationtrue on creation, otherwise false

Definition at line 296 of file class.ilPCMediaObject.php.

References ilObject\_exists(), ilObjMediaObject\_getMobsOfObject(), and ilObject\_lookupType().

297  {
298  if (!$a_page->getImportMode()) {
299  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
301  $a_page->getParentType() . ":pg",
302  $a_page->getId(),
303  0,
304  $a_page->getLanguage()
305  );
306  self::saveMobUsage($a_page, $a_domdoc);
307  foreach ($mob_ids as $mob) { // check, whether media object can be deleted
308  if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob") {
309  $mob_obj = new ilObjMediaObject($mob);
310  $usages = $mob_obj->getUsages(false);
311  if (count($usages) == 0) { // delete, if no usage exists
312  $mob_obj->delete();
313  }
314  }
315  }
316  }
317  }
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
Class ilObjMediaObject.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ beforePageDelete()

static ilPCMediaObject::beforePageDelete (   $a_page)
static

Before page is being deleted.

Parameters
object$a_pagepage object

Definition at line 324 of file class.ilPCMediaObject.php.

References ilObjMediaObject\_deleteAllUsages(), ilObject\_exists(), ilObjMediaObject\_getMobsOfObject(), and ilObject\_lookupType().

325  {
326  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
328  $a_page->getParentType() . ":pg",
329  $a_page->getId(),
330  0,
331  $a_page->getLanguage()
332  );
333 
335  $a_page->getParentType() . ":pg",
336  $a_page->getId(),
337  false,
338  $a_page->getLanguage()
339  );
340 
341  foreach ($mob_ids as $mob) { // check, whether media object can be deleted
342  if (ilObject::_exists($mob) && ilObject::_lookupType($mob) == "mob") {
343  $mob_obj = new ilObjMediaObject($mob);
344  $usages = $mob_obj->getUsages(false);
345  if (count($usages) == 0) { // delete, if no usage exists
346  $mob_obj->delete();
347  }
348  }
349  }
350  }
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _deleteAllUsages($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
static
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
Class ilObjMediaObject.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ create()

ilPCMediaObject::create ( $a_pg_obj,
  $a_hier_id 
)

Create pc media object.

Definition at line 116 of file class.ilPCMediaObject.php.

References ilPageContent\createPageContentNode().

117  {
118  $this->node = $this->createPageContentNode();
119  }
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
+ Here is the call graph for this function:

◆ createAlias()

ilPCMediaObject::createAlias ( $a_pg_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Create an media alias in page.

Parameters
object$a_pg_objpage object
string$a_hier_idhierarchical ID w

Definition at line 127 of file class.ilPCMediaObject.php.

References getMediaObject(), and IL_INSERT_AFTER.

128  {
129  $this->node = $this->dom->create_element("PageContent");
130  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
131  $this->mob_node = $this->dom->create_element("MediaObject");
132  $this->mob_node = $this->node->append_child($this->mob_node);
133  $this->mal_node = $this->dom->create_element("MediaAlias");
134  $this->mal_node = $this->mob_node->append_child($this->mal_node);
135  $this->mal_node->set_attribute("OriginId", "il__mob_" . $this->getMediaObject()->getId());
136 
137  // standard view
138  $item_node = $this->dom->create_element("MediaAliasItem");
139  $item_node = $this->mob_node->append_child($item_node);
140  $item_node->set_attribute("Purpose", "Standard");
141  $media_item = $this->getMediaObject()->getMediaItem("Standard");
142 
143  $layout_node = $this->dom->create_element("Layout");
144  $layout_node = $item_node->append_child($layout_node);
145  if ($media_item->getWidth() > 0) {
146  //$layout_node->set_attribute("Width", $media_item->getWidth());
147  }
148  if ($media_item->getHeight() > 0) {
149  //$layout_node->set_attribute("Height", $media_item->getHeight());
150  }
151  $layout_node->set_attribute("HorizontalAlign", "Left");
152 
153  // caption
154  if ($media_item->getCaption() != "") {
155  $cap_node = $this->dom->create_element("Caption");
156  $cap_node = $item_node->append_child($cap_node);
157  $cap_node->set_attribute("Align", "bottom");
158  $cap_node->set_content($media_item->getCaption());
159  }
160 
161  // text representation
162  if ($media_item->getTextRepresentation() != "") {
163  $tr_node = $this->dom->create_element("TextRepresentation");
164  $tr_node = $item_node->append_child($tr_node);
165  $tr_node->set_content($media_item->getTextRepresentation());
166  }
167 
168  $pars = $media_item->getParameters();
169  foreach ($pars as $par => $val) {
170  $par_node = $this->dom->create_element("Parameter");
171  $par_node = $item_node->append_child($par_node);
172  $par_node->set_attribute("Name", $par);
173  $par_node->set_attribute("Value", $val);
174  }
175 
176  // fullscreen view
177  $fullscreen_item = $this->getMediaObject()->getMediaItem("Fullscreen");
178  if (is_object($fullscreen_item)) {
179  $item_node = $this->dom->create_element("MediaAliasItem");
180  $item_node = $this->mob_node->append_child($item_node);
181  $item_node->set_attribute("Purpose", "Fullscreen");
182 
183  // width and height
184  $layout_node = $this->dom->create_element("Layout");
185  $layout_node = $item_node->append_child($layout_node);
186  if ($fullscreen_item->getWidth() > 0) {
187  $layout_node->set_attribute("Width", $fullscreen_item->getWidth());
188  }
189  if ($fullscreen_item->getHeight() > 0) {
190  $layout_node->set_attribute("Height", $fullscreen_item->getHeight());
191  }
192 
193  // caption
194  if ($fullscreen_item->getCaption() != "") {
195  $cap_node = $this->dom->create_element("Caption");
196  $cap_node = $item_node->append_child($cap_node);
197  $cap_node->set_attribute("Align", "bottom");
198  $cap_node->set_content($fullscreen_item->getCaption());
199  }
200 
201  // text representation
202  if ($fullscreen_item->getTextRepresentation() != "") {
203  $tr_node = $this->dom->create_element("TextRepresentation");
204  $tr_node = $item_node->append_child($tr_node);
205  $tr_node->set_content($fullscreen_item->getTextRepresentation());
206  }
207 
208  $pars = $fullscreen_item->getParameters();
209  foreach ($pars as $par => $val) {
210  $par_node = $this->dom->create_element("Parameter");
211  $par_node = $item_node->append_child($par_node);
212  $par_node->set_attribute("Name", $par);
213  $par_node->set_attribute("Value", $val);
214  }
215  }
216  }
getMediaObject()
Get Media Object.
const IL_INSERT_AFTER
+ Here is the call graph for this function:

◆ createMediaObject()

ilPCMediaObject::createMediaObject ( )

Definition at line 108 of file class.ilPCMediaObject.php.

References setMediaObject().

109  {
110  $this->setMediaObject(new ilObjMediaObject());
111  }
Class ilObjMediaObject.
setMediaObject($a_mediaobject)
Set Media Object.
+ Here is the call graph for this function:

◆ dumpXML()

ilPCMediaObject::dumpXML ( )

Dump node xml.

Definition at line 236 of file class.ilPCMediaObject.php.

References $xml.

237  {
238  $xml = $this->dom->dump_node($this->node);
239  return $xml;
240  }
$xml
Definition: metadata.php:332

◆ getClass()

ilPCMediaObject::getClass ( )

Get characteristic of section.

Returns
string characteristic

Definition at line 268 of file class.ilPCMediaObject.php.

269  {
270  if (is_object($this->mob_node)) {
271  $mal_node = $this->mob_node->first_child();
272  if (is_object($mal_node)) {
273  $class = $mal_node->get_attribute("Class");
274  return $class;
275  }
276  }
277  }

◆ getCssFiles()

ilPCMediaObject::getCssFiles (   $a_mode)

Definition at line 493 of file class.ilPCMediaObject.php.

References ilPlayerUtil\getCssFilePaths().

494  {
495  $js_files = ilPlayerUtil::getCssFilePaths();
496 
497  return $js_files;
498  }
static getCssFilePaths()
Get css file paths.
+ Here is the call graph for this function:

◆ getFullscreenMediaAliasItem()

ilPCMediaObject::getFullscreenMediaAliasItem ( )
Returns
ilMediaAliasItem

Definition at line 517 of file class.ilPCMediaObject.php.

References ilPageContent\getHierId(), getMediaObject(), ilPageContent\getPage(), and getStandardMediaAliasItem().

518  {
519  $std_alias_item = new ilMediaAliasItem(
520  $this->dom,
521  $this->getHierId(),
522  "Fullscreen",
523  $this->getPcId()
524  );
525  return $std_alias_item;
526  }
Class ilMediaAliasItem.
getHierId()
Get hierarchical id.
+ Here is the call graph for this function:

◆ getJavascriptFiles()

ilPCMediaObject::getJavascriptFiles (   $a_mode)

Definition at line 483 of file class.ilPCMediaObject.php.

References ilPlayerUtil\getJsFilePaths(), and iljQueryUtil\getLocalMaphilightPath().

484  {
485  $js_files = ilPlayerUtil::getJsFilePaths();
486  $js_files[] = iljQueryUtil::getLocalMaphilightPath();
487  return $js_files;
488  }
static getJsFilePaths()
Get js file paths.
static getLocalMaphilightPath()
Get local path of maphilight file.
+ Here is the call graph for this function:

◆ getLangVars()

static ilPCMediaObject::getLangVars ( )
static

Get lang vars needed for editing.

Returns
array array of lang var keys

Definition at line 283 of file class.ilPCMediaObject.php.

284  {
285  return array("pc_mob");
286  }

◆ getMediaObject()

ilPCMediaObject::getMediaObject ( )

Get Media Object.

Returns
object Media Object

Definition at line 103 of file class.ilPCMediaObject.php.

References $mediaobject.

Referenced by ilPCMediaObjectQuickEdit\__construct(), createAlias(), getFullscreenMediaAliasItem(), and updateObjectReference().

104  {
105  return $this->mediaobject;
106  }
Class ilObjMediaObject.
+ Here is the caller graph for this function:

◆ getStandardMediaAliasItem()

ilPCMediaObject::getStandardMediaAliasItem ( )
Returns
ilMediaAliasItem

Definition at line 503 of file class.ilPCMediaObject.php.

References ilPageContent\getHierId().

Referenced by getFullscreenMediaAliasItem().

504  {
505  $std_alias_item = new ilMediaAliasItem(
506  $this->dom,
507  $this->getHierId(),
508  "Standard",
509  $this->getPcId()
510  );
511  return $std_alias_item;
512  }
Class ilMediaAliasItem.
getHierId()
Get hierarchical id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

ilPCMediaObject::init ( )

Init page content component.

Definition at line 43 of file class.ilPCMediaObject.php.

References $DIC, ilPageContent\setType(), ui(), and user().

44  {
45  global $DIC;
46 
47  $this->user = $DIC->user();
48  $this->setType("media");
49  $this->ui = $DIC->ui();
50  $this->lng = $DIC->language();
51  }
setType($a_type)
Set Type.
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
ui()
Definition: ui.php:5
+ Here is the call graph for this function:

◆ modifyPageContentPostXsl()

ilPCMediaObject::modifyPageContentPostXsl (   $a_html,
  $a_mode,
  $a_abstract_only = false 
)

Definition at line 438 of file class.ilPCMediaObject.php.

References $ilUser, $user, ilObjMediaObject\_getDirectory(), ilObjMediaObject\_getMobsOfObject(), ilPageContent\getPage(), and ui().

439  {
441 
442  if ($a_mode == "offline") {
443  $page = $this->getPage();
444 
446  $page->getParentType() . ":pg",
447  $page->getId(),
448  0,
449  $page->getLanguage()
450  );
451  foreach ($mob_ids as $mob_id) {
452  $mob = new ilObjMediaObject($mob_id);
453  $srts = $mob->getSrtFiles();
454  foreach ($srts as $srt) {
455  if ($ilUser->getLanguage() == $srt["language"]) {
456  $srt_content = file_get_contents(ilObjMediaObject::_getDirectory($mob->getId()) . "/" . $srt["full_path"]);
457  $a_html = str_replace("[[[[[mobsubtitle;il__mob_" . $mob->getId() . "_Standard]]]]]", $srt_content, $a_html);
458  }
459  }
460  }
461  }
462 
463  if ($a_abstract_only) {
464  return $a_html;
465  }
466 
467  // add fullscreen modals
468  $page = $this->getPage();
469  $suffix = "-" . $page->getParentType() . "-" . $page->getId();
470  $modal = $this->ui->factory()->modal()->roundtrip(
471  $this->lng->txt("cont_fullscreen"),
472  $this->ui->factory()->legacy("<iframe class='il-copg-mob-fullscreen' id='il-copg-mob-fullscreen" . $suffix . "'></iframe>")
473  );
474  $show_signal = $modal->getShowSignal();
475 
476  return $a_html . "<div class='il-copg-mob-fullscreen-modal'>" . $this->ui->renderer()->render($modal) . "</div><script>$(function () { il.COPagePres.setFullscreenModalShowSignal('" .
477  $show_signal . "', '" . $suffix . "'); });</script>";
478  }
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _getDirectory($a_mob_id)
Get absolute directory.
ui()
Definition: ui.php:5
Class ilObjMediaObject.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ readMediaObject()

ilPCMediaObject::readMediaObject (   $a_mob_id = 0)

Read/get Media Object.

Parameters
intmedia object ID

Definition at line 58 of file class.ilPCMediaObject.php.

References setMediaObject().

59  {
60  if ($a_mob_id > 0) {
61  $mob = new ilObjMediaObject($a_mob_id);
62  $this->setMediaObject($mob);
63  }
64  }
Class ilObjMediaObject.
setMediaObject($a_mediaobject)
Set Media Object.
+ Here is the call graph for this function:

◆ saveMobUsage()

static ilPCMediaObject::saveMobUsage (   $a_page,
  $a_domdoc,
  $a_old_nr = 0 
)
static

Save all usages of media objects (media aliases, media objects, internal links)

Parameters
string$a_xmlxml data of page

Definition at line 370 of file class.ilPCMediaObject.php.

References ilPageContent\$node, ilObjMediaObject\_deleteAllUsages(), ilObject\_lookupType(), and ilObjMediaObject\_saveUsage().

371  {
372  $usages = array();
373 
374  // media aliases
375  $xpath = new DOMXPath($a_domdoc);
376  $nodes = $xpath->query('//MediaAlias');
377  foreach ($nodes as $node) {
378  $id_arr = explode("_", $node->getAttribute("OriginId"));
379  $mob_id = $id_arr[count($id_arr) - 1];
380  if ($mob_id > 0 && $id_arr[1] == "") {
381  $usages[$mob_id] = true;
382  }
383  }
384 
385  // media objects
386  $xpath = new DOMXPath($a_domdoc);
387  $nodes = $xpath->query('//MediaObject/MetaData/General/Identifier');
388  foreach ($nodes as $node) {
389  $mob_entry = $node->getAttribute("Entry");
390  $mob_arr = explode("_", $mob_entry);
391  $mob_id = $mob_arr[count($mob_arr) - 1];
392  if ($mob_id > 0 && $mob_arr[1] == "") {
393  $usages[$mob_id] = true;
394  }
395  }
396 
397  // internal links
398  $xpath = new DOMXPath($a_domdoc);
399  $nodes = $xpath->query("//IntLink[@Type='MediaObject']");
400  foreach ($nodes as $node) {
401  $mob_target = $node->getAttribute("Target");
402  $mob_arr = explode("_", $mob_target);
403  //echo "<br>3<br>";
404  //echo $mob_target."<br>";
405  //var_dump($mob_arr);
406  $mob_id = $mob_arr[count($mob_arr) - 1];
407  if ($mob_id > 0 && $mob_arr[1] == "") {
408  $usages[$mob_id] = true;
409  }
410  }
411 
412  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
414  $a_page->getParentType() . ":pg",
415  $a_page->getId(),
416  $a_old_nr,
417  $a_page->getLanguage()
418  );
419  foreach ($usages as $mob_id => $val) {
420  // save usage, if object exists...
421  if (ilObject::_lookupType($mob_id) == "mob") {
423  $mob_id,
424  $a_page->getParentType() . ":pg",
425  $a_page->getId(),
426  $a_old_nr,
427  $a_page->getLanguage()
428  );
429  }
430  }
431 
432  return $usages;
433  }
static _deleteAllUsages($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
static
static _lookupType($a_id, $a_reference=false)
lookup object type
static _saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Save usage of mob within another container (e.g.
+ Here is the call graph for this function:

◆ setClass()

ilPCMediaObject::setClass (   $a_class)

Set Style Class of table.

Parameters
string$a_classclass

Definition at line 247 of file class.ilPCMediaObject.php.

248  {
249  if (is_object($this->mob_node)) {
250  $mal_node = $this->mob_node->first_child();
251  if (is_object($mal_node)) {
252  if (!empty($a_class)) {
253  $mal_node->set_attribute("Class", $a_class);
254  } else {
255  if ($mal_node->has_attribute("Class")) {
256  $mal_node->remove_attribute("Class");
257  }
258  }
259  }
260  }
261  }

◆ setDom()

ilPCMediaObject::setDom ( $a_dom)

set dom object

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

76  {
77  $this->dom = $a_dom;
78  }

◆ setHierId()

ilPCMediaObject::setHierId (   $a_hier_id)

set hierarchical edit id

Definition at line 83 of file class.ilPCMediaObject.php.

84  {
85  $this->hier_id = $a_hier_id;
86  }

◆ setMediaObject()

ilPCMediaObject::setMediaObject (   $a_mediaobject)

Set Media Object.

Parameters
object$a_mediaobjectMedia Object

Definition at line 93 of file class.ilPCMediaObject.php.

Referenced by createMediaObject(), and readMediaObject().

94  {
95  $this->mediaobject = $a_mediaobject;
96  }
+ Here is the caller graph for this function:

◆ setNode()

ilPCMediaObject::setNode (   $a_node)

Definition at line 66 of file class.ilPCMediaObject.php.

67  {
68  parent::setNode($a_node); // this is the PageContent node
69  $this->mob_node = $a_node->first_child();
70  }

◆ updateObjectReference()

ilPCMediaObject::updateObjectReference ( )

Updates the media object referenced by the media alias.

This makes only sense, after the media object has changed. (-> change object reference function)

Definition at line 223 of file class.ilPCMediaObject.php.

References getMediaObject().

224  {
225  if (is_object($this->mob_node)) {
226  $this->mal_node = $this->mob_node->first_child();
227  if (is_object($this->mal_node) && $this->mal_node->node_name() == "MediaAlias") {
228  $this->mal_node->set_attribute("OriginId", "il__mob_" . $this->getMediaObject()->getId());
229  }
230  }
231  }
getMediaObject()
Get Media Object.
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilPCMediaObject::$lng
protected

Definition at line 38 of file class.ilPCMediaObject.php.

◆ $mediaobject

ilPCMediaObject::$mediaobject
protected

Definition at line 33 of file class.ilPCMediaObject.php.

Referenced by getMediaObject().

◆ $mob_node

ilPCMediaObject::$mob_node
protected

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

◆ $ui

ilPCMediaObject::$ui
protected

Definition at line 28 of file class.ilPCMediaObject.php.

◆ $user

ilPCMediaObject::$user
protected

Definition at line 21 of file class.ilPCMediaObject.php.

Referenced by modifyPageContentPostXsl().


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