ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMediaPoolPage Class Reference

Class ilMediaPoolPage. More...

+ Inheritance diagram for ilMediaPoolPage:
+ Collaboration diagram for ilMediaPoolPage:

Public Member Functions

 getParentType ()
 Get parent type. More...
 
 update ($a_validate=true, $a_no_history=false)
 update object data More...
 
 read ()
 Read media_pool data. More...
 
 delete ()
 delete media_pool page and al related data More...
 
 getUsages ($a_incl_hist=true)
 get all usages of current media object More...
 
- Public Member Functions inherited from ilPageObject
 __construct ($a_id=0, $a_old_nr=0, $a_lang="-")
 Constructor public. More...
 
 afterConstructor ()
 After constructor. More...
 
 getParentType ()
 Get parent type. More...
 
 initPageConfig ()
 Init page config. More...
 
 setLanguage ($a_val)
 Set language. More...
 
 getLanguage ()
 Get language. More...
 
 setPageConfig ($a_val)
 Set page config object. More...
 
 getPageConfig ()
 Get page config object. More...
 
 setRenderMd5 ($a_rendermd5)
 Set Render MD5. More...
 
 getRenderMd5 ()
 Get Render MD5. More...
 
 setRenderedContent ($a_renderedcontent)
 Set Rendered Content. More...
 
 getRenderedContent ()
 Get Rendered Content. More...
 
 setRenderedTime ($a_renderedtime)
 Set Rendered Time. More...
 
 getRenderedTime ()
 Get Rendered Time. More...
 
 setLastChange ($a_lastchange)
 Set Last Change. More...
 
 getLastChange ()
 Get Last Change. More...
 
 setLastChangeUser ($a_val)
 Set last change user. More...
 
 getLastChangeUser ()
 Get last change user. More...
 
 setShowActivationInfo ($a_val)
 Set show page activation info. More...
 
 getShowActivationInfo ()
 Get show page activation info. More...
 
 read ()
 Read page data. More...
 
 buildDom ($a_force=false)
 
 freeDom ()
 
 getDom ()
 Deprecated php4DomDocument. More...
 
 getDomDoc ()
 Get dom doc (php5 dom document) More...
 
 setId ($a_id)
 set id More...
 
 getId ()
 
 setParentId ($a_id)
 
 getParentId ()
 
 addUpdateListener (&$a_object, $a_method, $a_parameters="")
 
 callUpdateListeners ()
 
 setActive ($a_active)
 set activation More...
 
 getActive ($a_check_scheduled_activation=false)
 get activation More...
 
 setActivationStart ($a_activationstart)
 Set Activation Start. More...
 
 getActivationStart ()
 Get Activation Start. More...
 
 setActivationEnd ($a_activationend)
 Set Activation End. More...
 
 getActivationEnd ()
 Get Activation End. More...
 
 getContentObject ($a_hier_id, $a_pc_id="")
 Get a content object of the page. More...
 
getContentNode ($a_hier_id, $a_pc_id="")
 Get content node from dom. More...
 
 checkForTag ($a_content_tag, $a_hier_id, $a_pc_id="")
 Get content node from dom. More...
 
 lookforhier ($a_hier_id)
 
getNode ()
 
 setXMLContent ($a_xml, $a_encoding="UTF-8")
 set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD, omit MetaData, use utf-8! More...
 
 appendXMLContent ($a_xml)
 append xml content to page setXMLContent must be called before and the same encoding must be used More...
 
 getXMLContent ($a_incl_head=false)
 get xml content of page More...
 
 copyXmlContent ($a_clone_mobs=false)
 Copy content of page; replace page components with copies where necessary (e.g. More...
 
 handleCopiedContent ($a_dom, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content. More...
 
 newIIMCopies ($temp_dom)
 Replaces media objects in interactive images with copies of the interactive images. More...
 
 newMobCopies ($temp_dom)
 Replaces media objects with copies. More...
 
 newQuestionCopies (&$temp_dom)
 Replaces existing question content elements with new copies. More...
 
 removeQuestions (&$temp_dom)
 Remove questions from document. More...
 
 countPageContents ()
 Remove questions from document. More...
 
 getXMLFromDom ($a_incl_head=false, $a_append_mobs=false, $a_append_bib=false, $a_append_str="", $a_omit_pageobject_tag=false)
 get xml content of page from dom (use this, if any changes are made to the document) More...
 
 getLanguageVariablesXML ()
 Get language variables as XML. More...
 
 appendLangVarXML (&$xml, $var)
 
 getFirstParagraphText ()
 
 setParagraphContent ($a_hier_id, $a_content)
 Set content of paragraph. More...
 
 setContainsIntLink ($a_contains_link)
 lm parser set this flag to true, if the page contains intern links (this method should only be called by the import parser) More...
 
 containsIntLink ()
 returns true, if page was marked as containing an intern link (via setContainsIntLink) (this method should only be called by the import parser) More...
 
 setImportMode ($a_val)
 Set import mode. More...
 
 getImportMode ()
 Get import mode. More...
 
 needsImportParsing ($a_parse="")
 
 setContainsQuestion ($a_val)
 Set contains question. More...
 
 getContainsQuestion ()
 Get contains question. More...
 
 collectMediaObjects ($a_inline_only=true)
 get all media objects, that are referenced and used within the page More...
 
 getInternalLinks ($a_cnt_multiple=false)
 get all internal links that are used within the page More...
 
 getMultimediaXML ()
 get a xml string that contains all media object elements, that are referenced by any media alias in the page More...
 
 getMediaAliasElement ($a_mob_id, $a_nr=1)
 get complete media object (alias) element More...
 
 validateDom ()
 Validate the page content agains page DTD. More...
 
 addHierIDs ()
 Add hierarchical ID (e.g. More...
 
 getHierIds ()
 get all hierarchical ids More...
 
 getFirstRowIds ()
 get ids of all first table rows More...
 
 getFirstColumnIds ()
 get ids of all first table columns More...
 
 getListItemIds ()
 get ids of all list items More...
 
 getFileItemIds ()
 get ids of all file items More...
 
 stripHierIDs ()
 strip all hierarchical id attributes out of the dom tree More...
 
 getHierIdsForPCIds ($a_pc_ids)
 Get hier ids for a set of pc ids. More...
 
 addFileSizes ()
 add file sizes More...
 
 resolveIntLinks ($a_link_map=null)
 Resolves all internal link targets of the page, if targets are available (after import) More...
 
 resolveMediaAliases ($a_mapping, $a_reuse_existing_by_import=false)
 Resolve media aliases (after import) More...
 
 resolveIIMMediaAliases ($a_mapping)
 Resolve iim media aliases (in ilContObjParse) More...
 
 resolveFileItems ($a_mapping)
 Resolve file items (after import) More...
 
 resolveQuestionReferences ($a_mapping)
 Resolve all quesion references (after import) More...
 
 moveIntLinks ($a_from_to)
 Move internal links from one destination to another. More...
 
 handleImportRepositoryLink ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 
 handleRepositoryLinksOnCopy ($a_mapping, $a_source_ref_id)
 Handle repository links on copy process. More...
 
 createFromXML ()
 Create new page object with current xml content. More...
 
 updateFromXML ()
 Updates page object with current xml content. More...
 
 afterUpdate ()
 After update. More...
 
 update ($a_validate=true, $a_no_history=false)
 update complete page content in db (dom xml content is used) More...
 
 delete ()
 delete page object More...
 
 saveStyleUsage ($a_domdoc, $a_old_nr=0)
 Save all style class/template usages. More...
 
 deleteStyleUsages ($a_old_nr=0)
 Delete style usages. More...
 
 getLastUpdateOfIncludedElements ()
 Get last update of included elements (media objects and files). More...
 
 deleteInternalLinks ()
 Delete internal links. More...
 
 saveInternalLinks ($a_domdoc)
 save internal links of page More...
 
 create ()
 create new page (with current xml data) More...
 
 deleteContent ($a_hid, $a_update=true, $a_pcid="")
 delete content object with hierarchical id $a_hid More...
 
 deleteContents ($a_hids, $a_update=true, $a_self_ass=false)
 Delete multiple content objects. More...
 
 cutContents ($a_hids)
 Copy contents to clipboard and cut them from the page. More...
 
 copyContents ($a_hids)
 Copy contents to clipboard. More...
 
 pasteContents ($a_hier_id, $a_self_ass=false)
 Paste contents from pc clipboard. More...
 
 switchEnableMultiple ($a_hids, $a_update=true, $a_self_ass=false)
 (De-)activate elements More...
 
 deleteContentFromHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id >= $a_hid More...
 
 deleteContentBeforeHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id < $a_hid More...
 
 insertContent (&$a_cont_obj, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent More...
 
 insertContentNode (&$a_cont_node, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent More...
 
 moveContentBefore ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 moveContentAfter ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 bbCode2XML (&$a_content)
 transforms bbCode to corresponding xml More...
 
 insertInstIntoIDs ($a_inst, $a_res_ref_to_obj_id=true)
 inserts installation id into ids (e.g. More...
 
 checkPCIds ()
 Check, whether (all) page content hashes are set. More...
 
 getAllPCIds ()
 Get all pc ids. More...
 
 existsPCId ($a_pc_id)
 existsPCId More...
 
 generatePcId ($a_pc_ids=false)
 Generate new pc id. More...
 
 insertPCIds ()
 Insert Page Content IDs. More...
 
 getPageContentsHashes ()
 Get page contents hashes. More...
 
 getQuestionIds ()
 Get question ids. More...
 
 send_paragraph ($par_id, $filename)
 
 getFO ()
 get fo page content More...
 
 registerOfflineHandler ($handler)
 
 getOfflineHandler ()
 Get offline handler. More...
 
 containsDeactivatedElements ($a_content)
 Check whether content contains deactivated elements. More...
 
 getHistoryEntries ()
 Get History Entries. More...
 
 getHistoryEntry ($a_old_nr)
 Get History Entry. More...
 
 getHistoryInfo ($a_nr)
 Get information about a history entry, its predecessor and its successor. More...
 
 addChangeDivClasses ($a_hashes)
 
 compareVersion ($a_left, $a_right)
 Compares to revisions of the page. More...
 
 increaseViewCnt ()
 Increase view cnt. More...
 
 writeRenderedContent ($a_content, $a_md5)
 Write rendered content. More...
 
 containsIntLinks ($a_content)
 Check whether content contains internal links. More...
 
 performAutomaticModifications ()
 Perform automatic modifications (may be overwritten by sub classes) More...
 
 saveInitialOpenedContent ($a_type, $a_id, $a_target)
 Save initial opened content. More...
 
 getInitialOpenedContent ()
 Get initial opened content. More...
 
 beforePageContentUpdate ($a_page_content)
 Before page content update. More...
 
 copy ($a_id, $a_parent_type="", $a_parent_id=0, $a_clone_mobs=false)
 Copy page. More...
 
 copyPageToTranslation ($a_target_lang)
 Copy page to translation. More...
 
 getEditLock ()
 Get page lock. More...
 
 releasePageLock ()
 Release page lock. More...
 
 getEditLockInfo ()
 Get edit lock info. More...
 
 getContentTemplates ()
 Get content templates. More...
 
 getAllFileObjIds ()
 Get all file object ids. More...
 
 resolveResources ($ref_mapping)
 Resolve resources. More...
 

Static Public Member Functions

static deleteAllPagesOfMediaPool ($a_media_pool_id)
 delete media pool page and al related data More...
 
static exists ($a_media_pool_id, $a_title)
 Checks whether a page with given title exists. More...
 
static lookupTitle ($a_page_id)
 Lookup title. More...
 
static _mediaPoolPageExists ($a_media_pool_id, $a_title)
 Check whether page exists in media pool or not. More...
 
static lookupUsages ($a_id, $a_incl_hist=true)
 Lookup usages of media object. More...
 
- Static Public Member Functions inherited from ilPageObject
static _exists ($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
 Checks whether page exists. More...
 
static _existsAndNotEmpty ($a_parent_type, $a_id, $a_lang="-")
 Checks whether page exists and is not empty (may return true on some empty pages) More...
 
static preloadActivationDataByParentId ($a_parent_id)
 Preload activation data by Parent Id. More...
 
static _lookupActive ($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
 lookup activation status More...
 
static _isScheduledActivation ($a_id, $a_parent_type, $a_lang="-")
 Check whether page is activated by time schedule. More...
 
static _writeActive ($a_id, $a_parent_type, $a_active, $a_reset_scheduled_activation=true, $a_lang="-")
 write activation status More...
 
static _lookupActivationData ($a_id, $a_parent_type, $a_lang="-")
 Lookup activation data. More...
 
static lookupParentId ($a_id, $a_type)
 Lookup parent id. More...
 
static _writeParentId ($a_parent_type, $a_pg_id, $a_par_id)
 Write parent id. More...
 
static _handleImportRepositoryLinks ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 Change targest of repository links. More...
 
static _moveContentAfterHierId (&$a_source_page, &$a_target_page, $a_hid)
 move content of hierarchical id >= $a_hid to other page More...
 
static _lookupContainsDeactivatedElements ($a_id, $a_parent_type, $a_lang="-")
 lookup whether page contains deactivated elements More...
 
static getRecentChanges ($a_parent_type, $a_parent_id, $a_period=30, $a_lang="")
 Get recent pages changes for parent object. More...
 
static getAllPages ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all pages for parent object. More...
 
static getNewPages ($a_parent_type, $a_parent_id, $a_lang="-")
 Get new pages. More...
 
static getParentObjectContributors ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all contributors for parent object. More...
 
static getPageContributors ($a_parent_type, $a_page_id, $a_lang="-")
 Get all contributors for parent object. More...
 
static getPagesWithLinks ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all pages for parent object that contain internal links. More...
 
static lookupTranslations ($a_parent_type, $a_id)
 Lookup translations. More...
 
static truncateHTML ($a_text, $a_length=100, $a_ending='...', $a_exact=false, $a_consider_html=true)
 Truncate (html) string. More...
 
static getLastChangeByParent ($a_parent_type, $a_parent_id, $a_lang="")
 Get all pages for parent object. More...
 

Additional Inherited Members

- Data Fields inherited from ilPageObject
 $id
 
 $ilias
 
 $dom
 
 $xml
 
 $encoding
 
 $node
 
 $cur_dtd = "ilias_pg_5_2.dtd"
 
 $contains_int_link
 
 $needs_parsing
 
 $parent_type
 
 $parent_id
 
 $update_listeners
 
 $update_listener_cnt
 
 $offline_handler
 
 $dom_builded
 
 $history_saved
 
 $language = "-"
 
- Static Public Attributes inherited from ilPageObject
static $exists = array()
 
- Protected Member Functions inherited from ilPageObject
 __afterUpdate ($a_domdoc, $a_xml, $a_creation=false, $a_empty=false)
 After update event handler (internal). More...
 
 __beforeDelete ()
 Before deletion handler (internal). More...
 
 __afterHistoryEntry ($a_old_domdoc, $a_old_content, $a_old_nr)
 Before deletion handler (internal). More...
 
- Protected Attributes inherited from ilPageObject
 $import_mode = false
 
 $log
 
- Static Protected Attributes inherited from ilPageObject
static $activation_data = array()
 

Detailed Description

Class ilMediaPoolPage.

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

Definition at line 14 of file class.ilMediaPoolPage.php.

Member Function Documentation

◆ _mediaPoolPageExists()

static ilMediaPoolPage::_mediaPoolPageExists (   $a_media_pool_id,
  $a_title 
)
static

Check whether page exists in media pool or not.

Parameters
intmedia pool id
stringpage name
Returns
boolean page exists true/false

Definition at line 137 of file class.ilMediaPoolPage.php.

References $ilDB.

138  {
139  global $ilDB;
140 // todo
141 /*
142  $query = "SELECT id FROM il_media_pool_page".
143  " WHERE media_pool_id = ".$ilDB->quote($a_media_pool_id, "integer").
144  " AND title = ".$ilDB->quote($a_title, "text");
145  $set = $ilDB->query($query);
146 
147  $pages = array();
148  if ($rec = $ilDB->fetchAssoc($set))
149  {
150  return true;
151  }
152 */
153  return false;
154  }
global $ilDB

◆ delete()

ilMediaPoolPage::delete ( )

delete media_pool page and al related data

public

Definition at line 57 of file class.ilMediaPoolPage.php.

References $ilDB.

58  {
59  global $ilDB;
60 
61 
62  // delete internal links information to this page
63 // include_once("./Services/Link/classes/class.ilInternalLink.php");
64 // ilInternalLink::_deleteAllLinksToTarget("mep", $this->getId());
65 
66 
67  // delete co page
68  parent::delete();
69 
70  return true;
71  }
global $ilDB

◆ deleteAllPagesOfMediaPool()

static ilMediaPoolPage::deleteAllPagesOfMediaPool (   $a_media_pool_id)
static

delete media pool page and al related data

public

Definition at line 78 of file class.ilMediaPoolPage.php.

References $ilDB.

79  {
80  global $ilDB;
81 
82 // todo
83 /*
84  $query = "SELECT * FROM il_media_pool_page".
85  " WHERE media_pool_id = ".$ilDB->quote($a_media_pool_id, "integer");
86  $set = $ilDB->query($query);
87 
88  while($rec = $ilDB->fetchAssoc($set))
89  {
90  $mp_page = new ilMediaPoolPage($rec["id"]);
91  $mp_page->delete();
92  }
93 */
94  }
global $ilDB

◆ exists()

static ilMediaPoolPage::exists (   $a_media_pool_id,
  $a_title 
)
static

Checks whether a page with given title exists.

Definition at line 99 of file class.ilMediaPoolPage.php.

References $ilDB.

100  {
101  global $ilDB;
102 
103 // todo
104 /*
105 
106  $query = "SELECT * FROM il_media_pool_page".
107  " WHERE media_pool_id = ".$ilDB->quote($a_media_pool_id, "integer").
108  " AND title = ".$ilDB->quote($a_title, "text");
109  $set = $ilDB->query($query);
110  if($rec = $ilDB->fetchAssoc($set))
111  {
112  return true;
113  }
114 */
115  return false;
116  }
global $ilDB

◆ getParentType()

ilMediaPoolPage::getParentType ( )

Get parent type.

Returns
string parent type

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

22  {
23  return "mep";
24  }

◆ getUsages()

ilMediaPoolPage::getUsages (   $a_incl_hist = true)

get all usages of current media object

Definition at line 159 of file class.ilMediaPoolPage.php.

References ilPageObject\getId().

160  {
161  return self::lookupUsages($this->getId(), $a_incl_hist);
162  }
+ Here is the call graph for this function:

◆ lookupTitle()

static ilMediaPoolPage::lookupTitle (   $a_page_id)
static

Lookup title.

Definition at line 121 of file class.ilMediaPoolPage.php.

References $ilDB, and ilMediaPoolItem\lookupTitle().

Referenced by ilObjUser\getClipboardObjects(), ilObjMediaPoolGUI\insertFromClipboard(), ilPageObjectGUI\showPage(), and ilPageEditorGUI\showSnippetInfo().

122  {
123  global $ilDB;
124 
125  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
126  return ilMediaPoolItem::lookupTitle($a_page_id);
127  }
static lookupTitle($a_id)
Lookup title.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupUsages()

static ilMediaPoolPage::lookupUsages (   $a_id,
  $a_incl_hist = true 
)
static

Lookup usages of media object.

Todo:
: This should be all in one context -> mob id table

Definition at line 169 of file class.ilMediaPoolPage.php.

References $ilDB, $ret, ilPageObject\_exists(), and array.

Referenced by ilObjMediaObjectAccess\checkAccessMob().

170  {
171  global $ilDB;
172 
173  // get usages in pages
174  $q = "SELECT * FROM page_pc_usage WHERE pc_id = ".
175  $ilDB->quote($a_id, "integer").
176  " AND pc_type = ".$ilDB->quote("incl", "text");
177 
178  if (!$a_incl_hist)
179  {
180  $q.= " AND usage_hist_nr = ".$ilDB->quote(0, "integer");
181  }
182 
183  $us_set = $ilDB->query($q);
184  $ret = array();
185  while($us_rec = $ilDB->fetchAssoc($us_set))
186  {
187  $ut = "";
188  if(is_int(strpos($us_rec["usage_type"], ":")))
189  {
190  $us_arr = explode(":", $us_rec["usage_type"]);
191  $ut = $us_arr[1];
192  $ct = $us_arr[0];
193  }
194 
195  // check whether page exists
196  $skip = false;
197  if ($ut == "pg")
198  {
199  include_once("./Services/COPage/classes/class.ilPageObject.php");
200  if (!ilPageObject::_exists($ct, $us_rec["usage_id"]))
201  {
202  $skip = true;
203  }
204  }
205 
206  if (!$skip)
207  {
208  $ret[] = array("type" => $us_rec["usage_type"],
209  "id" => $us_rec["usage_id"],
210  "hist_nr" => $us_rec["usage_hist_nr"]);
211  }
212  }
213 
214  // get usages in media pools
215  $q = "SELECT DISTINCT mep_id FROM mep_tree JOIN mep_item ON (child = obj_id) WHERE mep_item.obj_id = ".
216  $ilDB->quote($a_id, "integer")." AND mep_item.type = ".$ilDB->quote("pg", "text");
217  $us_set = $ilDB->query($q);
218  while($us_rec = $ilDB->fetchAssoc($us_set))
219  {
220  $ret[] = array("type" => "mep",
221  "id" => $us_rec["mep_id"]);
222  }
223 
224  return $ret;
225  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Create styles array
The data for the language used.
global $ilDB
$ret
Definition: parser.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilMediaPoolPage::read ( )

Read media_pool data.

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

References $ilDB.

44  {
45  global $ilDB;
46 
47  // get co page
48  parent::read();
49  }
global $ilDB

◆ update()

ilMediaPoolPage::update (   $a_validate = true,
  $a_no_history = false 
)

update object data

public

Returns
boolean

Definition at line 32 of file class.ilMediaPoolPage.php.

References $ilDB.

33  {
34  global $ilDB;
35  parent::update($a_validate, $a_no_history);
36 
37  return true;
38  }
global $ilDB

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