ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilPageObject Class Reference

Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD) More...

+ Inheritance diagram for ilPageObject:
+ Collaboration diagram for ilPageObject:

Public Member Functions

 __construct (int $a_id=0, int $a_old_nr=0, string $a_lang="-")
 
 setContentIdManager (\ILIAS\COPage\ID\ContentIdManager $content_id_manager)
 
 afterConstructor ()
 
 getParentType ()
 
 initPageConfig ()
 
 setLanguage (string $a_val)
 Set language. More...
 
 getLanguage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 setConcreteLang (string $a_val)
 
 getConcreteLang ()
 
 getPageConfig ()
 
 setRenderMd5 (string $a_rendermd5)
 
 getRenderMd5 ()
 
 setRenderedContent (string $a_renderedcontent)
 
 getRenderedContent ()
 
 setRenderedTime (string $a_renderedtime)
 
 getRenderedTime ()
 
 setLastChange (string $a_lastchange)
 
 getLastChange ()
 
 setLastChangeUser (int $a_val)
 
 getLastChangeUser ()
 
 setShowActivationInfo (bool $a_val)
 
 getShowActivationInfo ()
 
 getCreationUserId ()
 
 read ()
 Read page data. More...
 
 buildDom (bool $a_force=false)
 
 freeDom ()
 
 getDomDoc ()
 Get dom doc (DOMDocument) More...
 
 setId (int $a_id)
 
 getId ()
 
 setParentId (int $a_id)
 
 getParentId ()
 
 addUpdateListener (object $a_object, string $a_method, $a_parameters="")
 
 callUpdateListeners ()
 
 setActive (bool $a_active)
 
 getActive (bool $a_check_scheduled_activation=false)
 
 setActivationStart (?string $a_activationstart)
 
 getActivationStart ()
 
 setActivationEnd (?string $a_activationend)
 Set Activation End. More...
 
 getActivationEnd ()
 
 getContentObject (string $a_hier_id, string $a_pc_id="")
 Get a content object of the page. More...
 
 getContentObjectForPcId (string $pcid)
 Get content object for pc id. More...
 
 getParentContentObjectForPcId (string $pcid)
 Get parent content object for pc id. More...
 
 getContentDomNode (string $a_hier_id, string $a_pc_id="")
 
 getDomNodeForPCId (string $pc_id)
 
 setXMLContent (string $a_xml, string $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 (string $a_xml)
 
   append xml content to page
   setXMLContent must be called before and the same encoding must be used

s More...

 
 getXMLContent (bool $a_incl_head=false)
 get xml content of page More...
 
 copyXmlContent (bool $a_clone_mobs=false, int $a_new_parent_id=0, int $obj_copy_id=0, bool $self_ass=true)
 Copy content of page; replace page components with copies where necessary (e.g. More...
 
 handleDeleteContent (?DOMNode $a_node=null, $move_operation=false)
 Handle content before deletion This currently treats only plugged content If no node is given, then the whole dom will be scanned. More...
 
 getXMLFromDom (bool $a_incl_head=false, bool $a_append_mobs=false, bool $a_append_bib=false, string $a_append_str="", bool $a_omit_pageobject_tag=false, int $style_id=0)
 get xml content of page from dom (use this, if any changes are made to the document) More...
 
 getLanguageVariablesXML (int $style_id=0)
 Get language variables as XML. More...
 
 getFirstParagraphText ()
 
 getParagraphForPCID (string $pcid)
 
 setContainsIntLink (bool $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) todo: move to ilLMPageObject !? 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 (bool $a_val)
 
 getImportMode ()
 
 needsImportParsing (?bool $a_parse=null)
 
 setContainsQuestion (bool $a_val)
 
 getContainsQuestion ()
 
 collectMediaObjects (bool $a_inline_only=true)
 get all media objects, that are referenced and used within the page More...
 
 getInternalLinks ()
 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 (int $a_mob_id, int $a_nr=1)
 get complete media object (alias) element More...
 
 validateDom (bool $throw=false)
 Validate the page content agains page DTD. More...
 
 addHierIDs ()
 Add hierarchical ID (e.g. More...
 
 getHierIds ()
 
 stripHierIDs ()
 
 stripPCIDs ()
 
 getHierIdsForPCIds (array $a_pc_ids)
 Get hier ids for a set of pc ids. More...
 
 getHierIdForPcId (string $pcid)
 
 getPCIdsForHierIds (array $hier_ids)
 Get hier ids for a set of pc ids. More...
 
 getPCIdForHierId (string $hier_id)
 
 addFileSizes ()
 add file sizes More...
 
 resolveIntLinks (array $a_link_map=null)
 Resolves all internal link targets of the page, if targets are available (after import) More...
 
 resolveMediaAliases (array $a_mapping, bool $a_reuse_existing_by_import=false)
 Resolve media aliases (after import) More...
 
 resolveIIMMediaAliases (array $a_mapping)
 Resolve iim media aliases (in ilContObjParse) More...
 
 resolveFileItems (array $a_mapping)
 Resolve file items (after import) More...
 
 resolveQuestionReferences (array $a_mapping)
 Resolve all quesiont references (after import) More...
 
 moveIntLinks (array $a_from_to)
 Move internal links from one destination to another. More...
 
 handleRepositoryLinksOnCopy (array $a_mapping, int $a_source_ref_id)
 Handle repository links on copy process. More...
 
 setEmptyPageXml ()
 
 createFromXML ()
 Create new page object with current xml content. More...
 
 updateFromXML ()
 Updates page object with current xml content This function is currently (8 beta) called by: More...
 
 afterUpdate (DOMDocument $domdoc, string $xml)
 After update. More...
 
 update (bool $a_validate=true, bool $a_no_history=false)
 update complete page content in db (dom xml content is used) More...
 
 delete ()
 
 saveStyleUsage (DOMDocument $a_domdoc, int $a_old_nr=0)
 Save all style class/template usages. More...
 
 deleteStyleUsages (int $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 (DOMDocument $a_domdoc)
 save internal links of page More...
 
 create (bool $a_import=false)
 create new page (with current xml data) More...
 
 deleteContent (string $a_hid, bool $a_update=true, string $a_pcid="", bool $move_operation=false)
 delete content object with hierarchical id $a_hid More...
 
 deleteContents (array $a_hids, bool $a_update=true, bool $a_self_ass=false, bool $move_operation=false)
 Delete multiple content objects. More...
 
 cutContents (array $a_hids)
 Copy contents to clipboard and cut them from the page. More...
 
 copyContents (array $a_hids)
 Copy contents to clipboard. More...
 
 pasteContents (string $a_hier_id, bool $a_self_ass=false)
 Paste contents from pc clipboard. More...
 
 switchEnableMultiple (array $a_hids, bool $a_update=true, bool $a_self_ass=false)
 (De-)activate elements More...
 
 insertContent (ilPageContent $a_cont_obj, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="", bool $remove_placeholder=true)
 insert a content node before/after a sibling or as first child of a parent More...
 
 insertContentNode (DOMNode $a_cont_node, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent More...
 
 moveContentAfter (string $a_source, string $a_target, string $a_spcid="", string $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 insertInstIntoIDs (string $a_inst, bool $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...
 
 hasDuplicatePCIds ()
 
 getDuplicatePCIds ()
 Get all duplicate PC Ids. More...
 
 generatePCId ()
 
 insertPCIds ()
 Insert Page Content IDs. More...
 
 sendParagraph (string $par_id, string $filename)
 
 registerOfflineHandler (object $handler)
 
 getOfflineHandler ()
 
 containsDeactivatedElements (string $a_content)
 Check whether content contains deactivated elements. More...
 
 getHistoryEntries ()
 Get History Entries. More...
 
 getHistoryEntry (int $a_old_nr)
 Get History Entry. More...
 
 getHistoryInfo (int $a_nr)
 Get information about a history entry, its predecessor and its successor. More...
 
 preparePageForCompare (ilPageObject $page)
 
 increaseViewCnt ()
 Increase view cnt. More...
 
 writeRenderedContent (string $a_content, string $a_md5)
 Write rendered content. More...
 
 containsIntLinks (string $a_content)
 Check whether content contains internal links. More...
 
 performAutomaticModifications ()
 Perform automatic modifications (may be overwritten by sub classes) More...
 
 saveInitialOpenedContent (string $a_type, int $a_id, string $a_target)
 Save initial opened content. More...
 
 getInitialOpenedContent ()
 Get initial opened content. More...
 
 beforePageContentUpdate (ilPageContent $a_page_content)
 Before page content update Note: This one is "work in progress", currently only text paragraphs call this hook It is called before the page content object invokes the update procedure of ilPageObject. More...
 
 copy (int $a_id, string $a_parent_type="", int $a_new_parent_id=0, bool $a_clone_mobs=false, int $obj_copy_id=0, bool $overwrite_existing=true)
 Copy page. More...
 
 copyPageToTranslation (string $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...
 
 getEffectiveEditLockTime ()
 
 resolveResources (array $ref_mapping)
 Resolve resources. More...
 
 getRepoObjId ()
 Get object id of repository object that contains this page, return 0 if page does not belong to a repo object. More...
 
 getPCModel ()
 Get page component model. More...
 
 assignCharacteristic (array $targets, string $char_par, string $char_sec, string $char_med)
 Assign characteristic. More...
 

Static Public Member Functions

static _exists (string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
 Checks whether page exists. More...
 
static _existsAndNotEmpty (string $a_parent_type, int $a_id, string $a_lang="-")
 Checks whether page exists and is not empty (may return true on some empty pages) More...
 
static preloadActivationDataByParentId (int $a_parent_id)
 Preload activation data by Parent Id. More...
 
static _lookupActive (int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
 lookup activation status More...
 
static _isScheduledActivation (int $a_id, string $a_parent_type, string $a_lang="-")
 Check whether page is activated by time schedule. More...
 
static _writeActive (int $a_id, string $a_parent_type, bool $a_active)
 write activation status More...
 
static _lookupActivationData (int $a_id, string $a_parent_type, string $a_lang="-")
 Lookup activation data. More...
 
static lookupParentId (int $a_id, string $a_type)
 
static _writeParentId (string $a_parent_type, int $a_pg_id, int $a_par_id)
 
static _lookupContainsDeactivatedElements (int $a_id, string $a_parent_type, string $a_lang="-")
 lookup whether page contains deactivated elements More...
 
static getRecentChanges (string $a_parent_type, int $a_parent_id, int $a_period=30, string $a_lang="")
 Get recent pages changes for parent object. More...
 
static getAllPages (string $a_parent_type, int $a_parent_id, string $a_lang="-")
 Get all pages for parent object. More...
 
static getNewPages (string $a_parent_type, int $a_parent_id, string $a_lang="-")
 Get new pages. More...
 
static getParentObjectContributors (string $a_parent_type, int $a_parent_id, string $a_lang="-")
 Get all contributors for parent object. More...
 
static getPageContributors (string $a_parent_type, int $a_page_id, string $a_lang="-")
 Get all contributors for parent object. More...
 
static getPagesWithLinks (string $a_parent_type, int $a_parent_id, string $a_lang="-")
 Get all pages for parent object that contain internal links. More...
 
static lookupTranslations (string $a_parent_type, int $a_id)
 Lookup translations. More...
 
static truncateHTML (string $a_text, int $a_length=100, string $a_ending='...', bool $a_exact=false, bool $a_consider_html=true)
 Truncate (html) string. More...
 
static getLastChangeByParent (string $a_parent_type, int $a_parent_id, string $a_lang="")
 Get all pages for parent object. More...
 

Data Fields

int $old_nr
 
DOMDocument $dom = null
 
string $xml = ""
 
string $encoding = ""
 
DomNode $node
 
string $cur_dtd = "ilias_pg_9.dtd"
 
bool $contains_int_link = false
 
bool $needs_parsing = false
 
string $parent_type = ""
 
int $parent_id = 0
 
array $update_listeners = []
 
int $update_listener_cnt = 0
 
object $offline_handler = null
 
bool $dom_builded = false
 
bool $history_saved = false
 
int $last_change_user = 0
 

Static Public Attributes

static array $exists = array()
 

Protected Member Functions

 getIliasAbsolutePath ()
 
 getLangVarXML (string $var)
 
 __afterUpdate (DOMDocument $a_domdoc, string $a_xml, bool $a_creation=false, bool $a_empty=false)
 After update event handler (internal). More...
 
 isTranslationPage ()
 
 __beforeDelete ()
 Before deletion handler (internal). More...
 
 __afterDelete ()
 
 afterDelete ()
 
 __afterHistoryEntry (DOMDocument $a_old_domdoc, string $a_old_content, int $a_old_nr)
 
 getContentManager ()
 
 setCopyProperties (ilPageObject $new_page)
 
 setTranslationProperties (self $transl_page)
 

Protected Attributes

ILIAS COPage Dom DomUtil $dom_util
 
ILIAS COPage Link LinkManager $link
 
ILIAS COPage PC PCDefinition $pc_definition
 
int $create_user = 0
 
array $id_elements
 
bool $page_not_found = false
 
bool $show_page_act_info = false
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilObjUser $user
 
ilLanguage $lng
 
ilTree $tree
 
int $id
 
string $language = "-"
 
bool $import_mode = false
 
ilLogger $log
 
array $page_record = array()
 
bool $active = false
 
ilPageConfig $page_config
 
string $rendermd5 = ""
 
string $renderedcontent = ""
 
string $renderedtime = ""
 
string $lastchange = ""
 
bool $contains_question = false
 
array $hier_ids = []
 
string $activationstart = null
 
string $activationend = null
 
ILIAS COPage ReadingTime ReadingTimeManager $reading_time_manager
 
 $concrete_lang = ""
 
ILIAS COPage ID ContentIdManager $content_id_manager
 
ILIAS COPage Page PageManager $page_manager
 
ILIAS COPage Style StyleManager $style_manager
 
ILIAS COPage PC DomainService $pc_service
 

Static Protected Attributes

static array $activation_data = array()
 

Detailed Description

Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 50 of file class.ilPageObject.php.

Constructor & Destructor Documentation

◆ __construct()

ilPageObject::__construct ( int  $a_id = 0,
int  $a_old_nr = 0,
string  $a_lang = "-" 
)
final

Definition at line 107 of file class.ilPageObject.php.

References $DIC, afterConstructor(), ilLoggerFactory\getLogger(), getParentType(), initPageConfig(), ILIAS\Repository\link(), ILIAS\Repository\lng(), read(), setActive(), setLanguage(), and ILIAS\Repository\user().

111  {
112  global $DIC;
113  $this->obj_definition = $DIC["objDefinition"];
114  $this->db = $DIC->database();
115  $this->user = $DIC->user();
116  $this->lng = $DIC->language();
117  $this->tree = $DIC->repositoryTree();
118  $this->log = ilLoggerFactory::getLogger('copg');
119 
120  $this->reading_time_manager = new ILIAS\COPage\ReadingTime\ReadingTimeManager();
121 
122  $this->parent_type = $this->getParentType();
123  $this->id = $a_id;
124  $this->setLanguage($a_lang);
125 
126  $this->contains_int_link = false;
127  $this->needs_parsing = false;
128  $this->update_listeners = array();
129  $this->update_listener_cnt = 0;
130  $this->dom_builded = false;
131  $this->page_not_found = false;
132  $this->old_nr = $a_old_nr;
133  $this->encoding = "UTF-8";
134  $this->id_elements =
135  array("PageContent",
136  "TableRow",
137  "TableData",
138  "ListItem",
139  "FileItem",
140  "Section",
141  "Tab",
142  "ContentPopup",
143  "GridCell"
144  );
145  $this->setActive(true);
146  $this->show_page_act_info = false;
147 
148  if ($a_id != 0) {
149  $this->read();
150  }
151 
152  $this->initPageConfig();
153  $this->afterConstructor();
154  $domain = $DIC->copage()
155  ->internal()
156  ->domain();
157  $this->content_id_manager = $domain
158  ->contentIds($this);
159  $this->page_manager = $domain->page();
160  $this->pc_service = $domain->pc();
161  $this->pc_definition = $domain->pc()->definition();
162  $this->link = $domain->link();
163  $this->style_manager = $domain->style();
164  $this->dom_util = $domain->domUtil();
165  }
static getLogger(string $a_component_id)
Get component logger.
read()
Read page data.
global $DIC
Definition: feed.php:28
setLanguage(string $a_val)
Set language.
link(string $caption, string $href, bool $new_viewport=false)
setActive(bool $a_active)
+ Here is the call graph for this function:

Member Function Documentation

◆ __afterDelete()

ilPageObject::__afterDelete ( )
finalprotected

Definition at line 1678 of file class.ilPageObject.php.

References afterDelete().

Referenced by delete().

1678  : void
1679  {
1680  $this->afterDelete();
1681  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __afterHistoryEntry()

ilPageObject::__afterHistoryEntry ( DOMDocument  $a_old_domdoc,
string  $a_old_content,
int  $a_old_nr 
)
finalprotected

Definition at line 1687 of file class.ilPageObject.php.

References saveStyleUsage().

Referenced by update().

1691  : void {
1692  // save style usage
1693  $this->saveStyleUsage($a_old_domdoc, $a_old_nr);
1694 
1695  // pc classes hook
1696  $defs = $this->pc_definition->getPCDefinitions();
1697  foreach ($defs as $def) {
1698  $cl = $def["pc_class"];
1699  call_user_func(
1700  $def["pc_class"] . '::afterPageHistoryEntry',
1701  $this,
1702  $a_old_domdoc,
1703  $a_old_content,
1704  $a_old_nr
1705  );
1706  }
1707  }
saveStyleUsage(DOMDocument $a_domdoc, int $a_old_nr=0)
Save all style class/template usages.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __afterUpdate()

ilPageObject::__afterUpdate ( DOMDocument  $a_domdoc,
string  $a_xml,
bool  $a_creation = false,
bool  $a_empty = false 
)
finalprotected

After update event handler (internal).

The hooks are e.g. for storing any dependent relations/references in the database.

Definition at line 1367 of file class.ilPageObject.php.

References afterUpdate(), callUpdateListeners(), saveInternalLinks(), and saveStyleUsage().

Referenced by createFromXML(), update(), and updateFromXML().

1372  : void {
1373  // we do not need this if we are creating an empty page
1374  if (!$a_creation || !$a_empty) {
1375  // save internal link information
1376  // the page object is responsible to do this, since it "offers" the
1377  // internal link feature pc and page classes
1378  $this->saveInternalLinks($a_domdoc);
1379 
1380  // save style usage
1381  $this->saveStyleUsage($a_domdoc);
1382 
1383  // save estimated reading time
1384  $this->reading_time_manager->saveTime($this);
1385 
1386  // pc classes hook
1387  $defs = $this->pc_definition->getPCDefinitions();
1388  foreach ($defs as $def) {
1389  $cl = $def["pc_class"];
1390  call_user_func($def["pc_class"] . '::afterPageUpdate', $this, $a_domdoc, $a_xml, $a_creation);
1391  }
1392  }
1393 
1394  // call page hook
1395  $this->afterUpdate($a_domdoc, $a_xml);
1396 
1397  // call update listeners
1398  $this->callUpdateListeners();
1399  }
saveStyleUsage(DOMDocument $a_domdoc, int $a_old_nr=0)
Save all style class/template usages.
saveInternalLinks(DOMDocument $a_domdoc)
save internal links of page
afterUpdate(DOMDocument $domdoc, string $xml)
After update.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __beforeDelete()

ilPageObject::__beforeDelete ( )
finalprotected

Before deletion handler (internal).

Definition at line 1668 of file class.ilPageObject.php.

Referenced by delete().

1668  : void
1669  {
1670  // pc classes hook
1671  $defs = $this->pc_definition->getPCDefinitions();
1672  foreach ($defs as $def) {
1673  $cl = $def["pc_class"];
1674  call_user_func($def["pc_class"] . '::beforePageDelete', $this);
1675  }
1676  }
+ Here is the caller graph for this function:

◆ _exists()

static ilPageObject::_exists ( string  $a_parent_type,
int  $a_id,
string  $a_lang = "",
bool  $a_no_cache = false 
)
static

Checks whether page exists.

Parameters
string$a_langlanguage code, if empty language independent existence is checked

Definition at line 331 of file class.ilPageObject.php.

References $DIC, ilDBInterface\fetchAssoc(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by ilDclDetailedViewDefinitionGUI\__construct(), ilImprintGUI\__construct(), ilInternalLink\_exists(), ilContainer\_exportContainerSettings(), ilPageObjectGUI\checkLangPageAvailable(), ilObjContentObject\checkStructure(), ILIAS\Blog\Export\BlogHtmlExport\collectAllPagesPageElements(), copy(), ilObjectCopyGUI\copyParentPage(), ilObjForum\delete(), ilObjMediaPool\deleteChild(), assQuestion\deletePageOfQuestion(), ilObjContentPage\doCloneObject(), ilObjContentPage\doDelete(), ILIAS\ContentPage\PageMetrics\PageMetricsService\doesPageExistsForLanguage(), ilForumPageCommandForwarder\doesPageExistsForLanguage(), ilContentPagePageCommandForwarder\doesPageExistsForLanguage(), assQuestion\ensureHintPageObjectExists(), ilAssQuestionFeedback\ensurePageObjectDeleted(), ilAssQuestionFeedbackPageObjectCommandForwarder\ensurePageObjectExists(), ilAssQuestionHintPageObjectCommandForwarder\ensurePageObjectExists(), ilAssQuestionFeedback\ensurePageObjectExists(), ilLMPageObjectGUI\executeCommand(), ilContainerStartObjectsGUI\executeCommand(), ilLOEditorGUI\executeCommand(), ilObjectCopyGUI\executeNextStepAfterSourceSelection(), ILIAS\Wiki\Export\WikiHtmlExport\exportHTMLPages(), ILIAS\Blog\Export\BlogHtmlExport\exportHTMLPages(), ILIAS\Portfolio\Export\PortfolioHtmlExport\exportHTMLPages(), ILIAS\LearningModule\Export\LMHtmlExport\exportHTMLPages(), ILIAS\Wiki\Export\WikiHtmlExport\exportHTMLPagesPrint(), ILIAS\Portfolio\Export\PortfolioHtmlExport\exportHTMLPagesPrint(), ilObjContentObject\exportXMLPageObjects(), ilLearningModuleImporter\finalProcessing(), ilObjItemGroup\fixContainerItemGroupRefsAfterCloning(), ilObjContentObject\fixTree(), ilAuthLoginPageEditorGUI\forwardToPageObject(), ilContainerGUI\forwardToPageObject(), ilObjUser\getClipboardObjects(), ilContainer\getCompleteDescriptions(), ilObjectTranslation\getEffectiveContentLang(), ilPageMultiLang\getEffectiveLang(), ilPageLayout\getLayoutsAsArray(), ilLMPresentationGUI\getLMPage(), ilLMContentRendererGUI\getLMPageGUI(), ilLMPresentationGUI\getLMPageGUI(), ilContainerExporter\getXmlExportTailDependencies(), ilLearningSequenceExporter\getXmlExportTailDependencies(), ilPCQuestion\handleCopiedContent(), ilObjLearningSequence\hasContentPage(), ilCOPageImporter\importXmlRepresentation(), ilMediaPoolPage\lookupUsages(), ilObjMediaObject\lookupUsages(), ilPCContentInclude\modifyPageContentPostXsl(), ilQuestionPageParser\processPagesToParse(), ilWikiPage\rename(), ilObjForum\update(), ilObjContentObject\validatePages(), and ilContainerXmlWriter\writeSubitems().

336  : bool {
337  global $DIC;
338 
339  $db = $DIC->database();
340 
341  if (!$a_no_cache && isset(self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang])) {
342  return self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang];
343  }
344 
345  $and_lang = "";
346  if ($a_lang != "") {
347  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
348  }
349 
350  $query = "SELECT page_id FROM page_object WHERE page_id = " . $db->quote($a_id, "integer") . " " .
351  "AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang;
352  $set = $db->query($query);
353  if ($row = $db->fetchAssoc($set)) {
354  self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang] = true;
355  return true;
356  } else {
357  self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang] = false;
358  return false;
359  }
360  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _existsAndNotEmpty()

static ilPageObject::_existsAndNotEmpty ( string  $a_parent_type,
int  $a_id,
string  $a_lang = "-" 
)
static

Checks whether page exists and is not empty (may return true on some empty pages)

Definition at line 365 of file class.ilPageObject.php.

References ilPageUtil\_existsAndNotEmpty().

369  : bool {
370  return ilPageUtil::_existsAndNotEmpty($a_parent_type, $a_id, $a_lang);
371  }
static _existsAndNotEmpty(string $a_parent_type, int $a_id, string $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages) ...
+ Here is the call graph for this function:

◆ _isScheduledActivation()

static ilPageObject::_isScheduledActivation ( int  $a_id,
string  $a_parent_type,
string  $a_lang = "-" 
)
static

Check whether page is activated by time schedule.

Definition at line 548 of file class.ilPageObject.php.

References $DIC, ilDBInterface\fetchAssoc(), and ilDBInterface\queryF().

Referenced by ilLMPagesTableGUI\fillRow(), ilChapterHierarchyFormGUI\getChildIcon(), ilLMEditorExplorerGUI\getNodeIcon(), ilPublicSectionExplorerGUI\getNodeIcon(), and ilLMTOCExplorerGUI\getNodeIcon().

552  : bool {
553  global $DIC;
554 
555  $db = $DIC->database();
556 
557  // language must be set at least to "-"
558  if ($a_lang == "") {
559  $a_lang = "-";
560  }
561 
562  //echo "<br>";
563  //var_dump(self::$activation_data); exit;
564  if (isset(self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang])) {
565  $rec = self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang];
566  } else {
567  $set = $db->queryF(
568  "SELECT active, activation_start, activation_end FROM page_object WHERE page_id = %s" .
569  " AND parent_type = %s AND lang = %s",
570  array("integer", "text", "text"),
571  array($a_id, $a_parent_type, $a_lang)
572  );
573  $rec = $db->fetchAssoc($set);
574  }
575 
576  if (!$rec["active"] && $rec["activation_start"] != "") {
577  return true;
578  }
579 
580  return false;
581  }
fetchAssoc(ilDBStatement $statement)
global $DIC
Definition: feed.php:28
queryF(string $query, array $types, array $values)
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupActivationData()

static ilPageObject::_lookupActivationData ( int  $a_id,
string  $a_parent_type,
string  $a_lang = "-" 
)
static

Lookup activation data.

Definition at line 610 of file class.ilPageObject.php.

References $DIC, ilDBInterface\fetchAssoc(), and ilDBInterface\queryF().

Referenced by ilLMPageObject\_getPresentationTitle(), ilLMTracker\_isNodeVisible(), ilLMNavigationStatus\determineStatus(), ilLMNavigationStatus\getPredecessorPageId(), ilLMNavigationStatus\getSuccessorPageId(), and ilLMContentRendererGUI\renderDeactivatedPageMessage().

614  : array {
615  global $DIC;
616 
617  $db = $DIC->database();
618 
619  // language must be set at least to "-"
620  if ($a_lang == "") {
621  $a_lang = "-";
622  }
623 
624  if (isset(self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang])) {
625  $rec = self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang];
626  } else {
627  $set = $db->queryF(
628  "SELECT active, activation_start, activation_end, show_activation_info FROM page_object WHERE page_id = %s" .
629  " AND parent_type = %s AND lang = %s",
630  array("integer", "text", "text"),
631  array($a_id, $a_parent_type, $a_lang)
632  );
633  $rec = $db->fetchAssoc($set);
634  if (!$rec) {
635  return [
636  "active" => 1,
637  "activation_start" => null,
638  "activation_end" => null,
639  "show_activation_info" => 0
640  ];
641  }
642  }
643 
644  return $rec;
645  }
fetchAssoc(ilDBStatement $statement)
global $DIC
Definition: feed.php:28
queryF(string $query, array $types, array $values)
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupActive()

static ilPageObject::_lookupActive ( int  $a_id,
string  $a_parent_type,
bool  $a_check_scheduled_activation = false,
string  $a_lang = "-" 
)
static

lookup activation status

Definition at line 504 of file class.ilPageObject.php.

References $DIC, ilDBInterface\fetchAssoc(), ilUtil\now(), and ilDBInterface\queryF().

Referenced by ilLMPageObject\_getPresentationTitle(), ilLMTracker\_isNodeVisible(), ilStructureObjectGUI\activatePages(), ilObjContentObjectGUI\activatePages(), ilLMNavigationRendererGUI\addDropdown(), ilObjBlog\deliverRSS(), ilLMNavigationStatus\determineStatus(), ilLMPagesTableGUI\fillRow(), ilObjBlogGUI\filterInactivePostings(), ilChapterHierarchyFormGUI\getChildIcon(), ilChapterHierarchyFormGUI\getChildIconAlt(), ilObjBlogGUI\getKeywords(), ilObjBlogGUI\getListItems(), ilLPStatusVisitedPages\getLMPages(), ilLMTOCExplorerGUI\getNodeHref(), ilLMEditorExplorerGUI\getNodeIcon(), ilPublicSectionExplorerGUI\getNodeIcon(), ilLMTOCExplorerGUI\getNodeIcon(), ilLMEditorExplorerGUI\getNodeIconAlt(), ilLMNavigationStatus\getPredecessorPageId(), ilLMNavigationStatus\getSuccessorPageId(), ilBlogDraftsDerivedTaskProvider\getTasks(), ilLMTOCExplorerGUI\isNodeClickable(), ilObjBlogGUI\renderList(), ilObjBlogGUI\renderNavigationByAuthors(), ilObjBlogGUI\renderNavigationByDate(), ilLMPresentationGUI\showPrintView(), and ilLMPresentationGUI\showPrintViewSelection().

509  : bool {
510  global $DIC;
511 
512  $db = $DIC->database();
513 
514  // language must be set at least to "-"
515  if ($a_lang == "") {
516  $a_lang = "-";
517  }
518 
519  if (isset(self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang])) {
520  $rec = self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang];
521  } else {
522  $set = $db->queryF(
523  "SELECT active, activation_start, activation_end FROM page_object WHERE page_id = %s" .
524  " AND parent_type = %s AND lang = %s",
525  array("integer", "text", "text"),
526  array($a_id, $a_parent_type, $a_lang)
527  );
528  $rec = $db->fetchAssoc($set);
529  if (!$rec) {
530  return true;
531  }
532  }
533 
534  $rec["n"] = ilUtil::now();
535  if (!$rec["active"] && $a_check_scheduled_activation) {
536  if ($rec["n"] >= $rec["activation_start"] &&
537  $rec["n"] <= $rec["activation_end"]) {
538  return true;
539  }
540  }
541 
542  return (bool) $rec["active"];
543  }
fetchAssoc(ilDBStatement $statement)
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: feed.php:28
queryF(string $query, array $types, array $values)
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupContainsDeactivatedElements()

static ilPageObject::_lookupContainsDeactivatedElements ( int  $a_id,
string  $a_parent_type,
string  $a_lang = "-" 
)
static

lookup whether page contains deactivated elements

Definition at line 2035 of file class.ilPageObject.php.

References $DIC, ilDBConstants\FETCHMODE_ASSOC, ilDBInterface\query(), and ilDBInterface\quote().

Referenced by ilLMPagesTableGUI\fillRow(), ilChapterHierarchyFormGUI\getChildIcon(), ilChapterHierarchyFormGUI\getChildIconAlt(), ilLMEditorExplorerGUI\getNodeIcon(), ilPublicSectionExplorerGUI\getNodeIcon(), and ilLMEditorExplorerGUI\getNodeIconAlt().

2039  : bool {
2040  global $DIC;
2041 
2042  $db = $DIC->database();
2043 
2044  if ($a_lang == "") {
2045  $a_lang = "-";
2046  }
2047 
2048  $query = "SELECT * FROM page_object WHERE page_id = " .
2049  $db->quote($a_id, "integer") . " AND " .
2050  " parent_type = " . $db->quote($a_parent_type, "text") . " AND " .
2051  " lang = " . $db->quote($a_lang, "text") . " AND " .
2052  " inactive_elements = " . $db->quote(1, "integer");
2053  $obj_set = $db->query($query);
2054 
2055  if ($obj_rec = $obj_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
2056  return true;
2057  }
2058 
2059  return false;
2060  }
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _writeActive()

static ilPageObject::_writeActive ( int  $a_id,
string  $a_parent_type,
bool  $a_active 
)
static

write activation status

Definition at line 586 of file class.ilPageObject.php.

References $DIC, and ilDBInterface\manipulateF().

Referenced by ilStructureObjectGUI\activatePages(), and ilObjContentObjectGUI\activatePages().

590  : void {
591  global $DIC;
592 
593  $db = $DIC->database();
594 
595  // language must be set at least to "-"
596  $a_lang = "-";
597 
598  $db->manipulateF(
599  "UPDATE page_object SET active = %s, activation_start = %s, " .
600  " activation_end = %s WHERE page_id = %s" .
601  " AND parent_type = %s AND lang = %s",
602  array("int", "timestamp", "timestamp", "integer", "text", "text"),
603  array((int) $a_active, null, null, $a_id, $a_parent_type, $a_lang)
604  );
605  }
manipulateF(string $query, array $types, array $values)
global $DIC
Definition: feed.php:28
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _writeParentId()

static ilPageObject::_writeParentId ( string  $a_parent_type,
int  $a_pg_id,
int  $a_par_id 
)
static

Definition at line 659 of file class.ilPageObject.php.

References $DIC, and ilDBInterface\manipulateF().

Referenced by ilWikiImporter\finalProcessing(), ilPortfolioImporter\finalProcessing(), ilContentPageImporter\finalProcessing(), ilForumImporter\finalProcessing(), ilContainerImporter\finalProcessing(), ilBlogImporter\finalProcessing(), ilLearningSequenceImporter\finalProcessing(), ilMediaPoolImporter\finalProcessing(), and ilLearningModuleImporter\finalProcessing().

659  : void
660  {
661  global $DIC;
662 
663  $db = $DIC->database();
664  $db->manipulateF(
665  "UPDATE page_object SET parent_id = %s WHERE page_id = %s" .
666  " AND parent_type = %s",
667  array("integer", "integer", "text"),
668  array($a_par_id, $a_pg_id, $a_parent_type)
669  );
670  }
manipulateF(string $query, array $types, array $values)
global $DIC
Definition: feed.php:28
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addFileSizes()

ilPageObject::addFileSizes ( )

add file sizes

Definition at line 1166 of file class.ilPageObject.php.

References getDomDoc().

1166  : void
1167  {
1168  $this->pc_service->fileList()->addFileSizes($this->getDomDoc());
1169  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ addHierIDs()

ilPageObject::addHierIDs ( )

Add hierarchical ID (e.g.

for editing) attributes "HierId" to current dom tree.

Definition at line 1117 of file class.ilPageObject.php.

Referenced by ilContainerPage\addRepositoryBlockToPage(), PCInteractiveImageTest\getInteractiveImageInPage(), ilPCParagraph\getLastSavedPCId(), PCMediaObjectTest\getMediaObjectInPage(), ILIAS\COPage\Compare\PageCompare\getPageContentsHashes(), PCTabsTest\getTabsWithTabs(), COPageTestBase\insertParagraphAt(), and moveIntLinks().

1117  : void
1118  {
1119  $this->content_id_manager->addHierIDsToDom();
1120  }
+ Here is the caller graph for this function:

◆ addUpdateListener()

ilPageObject::addUpdateListener ( object  $a_object,
string  $a_method,
  $a_parameters = "" 
)
Parameters
mixed$a_parameters

Definition at line 443 of file class.ilPageObject.php.

References $update_listener_cnt.

Referenced by ilBlogPosting\read().

447  : void {
449  $this->update_listeners[$cnt]["object"] = $a_object;
450  $this->update_listeners[$cnt]["method"] = $a_method;
451  $this->update_listeners[$cnt]["parameters"] = $a_parameters;
452  $this->update_listener_cnt++;
453  }
+ Here is the caller graph for this function:

◆ afterConstructor()

ilPageObject::afterConstructor ( )

Definition at line 173 of file class.ilPageObject.php.

References getParentType().

Referenced by __construct().

173  : void
174  {
175  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterDelete()

ilPageObject::afterDelete ( )
protected

Definition at line 1683 of file class.ilPageObject.php.

Referenced by __afterDelete().

1683  : void
1684  {
1685  }
+ Here is the caller graph for this function:

◆ afterUpdate()

ilPageObject::afterUpdate ( DOMDocument  $domdoc,
string  $xml 
)

After update.

Definition at line 1404 of file class.ilPageObject.php.

Referenced by __afterUpdate().

1404  : void
1405  {
1406  }
+ Here is the caller graph for this function:

◆ appendXMLContent()

ilPageObject::appendXMLContent ( string  $a_xml)

   append xml content to page
   setXMLContent must be called before and the same encoding must be used

s

Definition at line 780 of file class.ilPageObject.php.

780  : void
781  {
782  $this->xml .= $a_xml;
783  }

◆ assignCharacteristic()

ilPageObject::assignCharacteristic ( array  $targets,
string  $char_par,
string  $char_sec,
string  $char_med 
)

Assign characteristic.

Returns
array|bool
Exceptions
ilCOPagePCEditException
ilCOPageUnknownPCTypeException
ilDateTimeException

Definition at line 3037 of file class.ilPageObject.php.

References getContentObject(), and update().

3042  {
3043  if (is_array($targets)) {
3044  foreach ($targets as $t) {
3045  $tarr = explode(":", $t);
3046  $cont_obj = $this->getContentObject($tarr[0], $tarr[1]);
3047  if (is_object($cont_obj) && $cont_obj->getType() == "par") {
3048  $cont_obj->setCharacteristic($char_par);
3049  }
3050  if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
3051  $cont_obj->setCharacteristic($char_sec);
3052  }
3053  if (is_object($cont_obj) && $cont_obj->getType() == "media") {
3054  $cont_obj->setClass($char_med);
3055  }
3056  }
3057  return $this->update();
3058  }
3059  return true;
3060  }
update(bool $a_validate=true, bool $a_no_history=false)
update complete page content in db (dom xml content is used)
getContentObject(string $a_hier_id, string $a_pc_id="")
Get a content object of the page.
+ Here is the call graph for this function:

◆ beforePageContentUpdate()

ilPageObject::beforePageContentUpdate ( ilPageContent  $a_page_content)

Before page content update Note: This one is "work in progress", currently only text paragraphs call this hook It is called before the page content object invokes the update procedure of ilPageObject.

Definition at line 2589 of file class.ilPageObject.php.

Referenced by ilPCParagraph\updatePage().

2589  : void
2590  {
2591  }
+ Here is the caller graph for this function:

◆ buildDom()

ilPageObject::buildDom ( bool  $a_force = false)
Returns
bool|array

Definition at line 376 of file class.ilPageObject.php.

References $path, getId(), getLanguage(), getXMLContent(), and setXMLContent().

Referenced by ILIAS\COPage\ResourcesCollector\__construct(), ilContainerPage\addMissingContainerBlocks(), ilCOPageImporter\afterContainerImportProcessing(), ilPCParagraph\autoLinkGlossariesPage(), ILIAS\COPage\ID\ContentIdManager\checkPCIds(), createFromXML(), delete(), ILIAS\COPage\Page\PageContentManager\downloadFile(), ILIAS\COPage\ID\ContentIdManager\getAllPCIds(), getContentManager(), ilGlossaryTermGUI\getInternalLinks(), ILIAS\COPage\Compare\PageCompare\getPageContentsHashes(), ilPortfolioTemplatePage\getPageDiskSize(), ilPCAMDFormGUI\getPortfolioForm(), ilCOPageExporter\getValidSchemaVersions(), handleRepositoryLinksOnCopy(), ilPCVerification\isInPortfolioPage(), moveIntLinks(), ilQuestionPageParser\processPagesToParse(), ilContainerPage\removeUnsupportedBlockIds(), ilPortfolioPage\renameLinksOnTitleChange(), ILIAS\COPage\ReadingTime\ReadingTimeManager\saveTime(), and updateFromXML().

377  {
378  if ($this->dom_builded && !$a_force) {
379  return true;
380  }
381  $error = null;
382  if ($this->getXMLContent() === "") {
383  $this->setXMLContent("<PageObject></PageObject>");
384  }
385  $this->dom = $this->dom_util->docFromString($this->getXMLContent(true), $error);
386  $path = "//PageObject";
387  if (is_null($this->dom)) {
388  throw new ilCOPageException("Invalid page xml (" .
389  $this->getId() . "," . $this->getLanguage() . "): " . $this->getXMLContent(true));
390  }
391  $nodes = $this->dom_util->path($this->dom, $path);
392  if (count($nodes) == 1) {
393  $this->node = $nodes->item(0);
394  } else {
395  throw new ilCOPageException("Invalid page xml (" .
396  $this->getId() . "," . $this->getLanguage() . "): " . $this->getXMLContent(true));
397  }
398 
399  if (empty($error)) {
400  $this->dom_builded = true;
401  return true;
402  } else {
403  return $error;
404  }
405  }
$path
Definition: ltiservices.php:32
setXMLContent(string $a_xml, string $a_encoding="UTF-8")
set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD...
getXMLContent(bool $a_incl_head=false)
get xml content of page
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ callUpdateListeners()

ilPageObject::callUpdateListeners ( )

Definition at line 455 of file class.ilPageObject.php.

References $update_listener_cnt.

Referenced by __afterUpdate().

455  : void
456  {
457  for ($i = 0; $i < $this->update_listener_cnt; $i++) {
458  $object = $this->update_listeners[$i]["object"];
459  $method = $this->update_listeners[$i]["method"];
460  $parameters = $this->update_listeners[$i]["parameters"];
461  $object->$method($parameters);
462  }
463  }
+ Here is the caller graph for this function:

◆ checkPCIds()

ilPageObject::checkPCIds ( )

Check, whether (all) page content hashes are set.

Definition at line 1971 of file class.ilPageObject.php.

Referenced by update().

1971  : bool
1972  {
1973  return $this->content_id_manager->checkPCIds();
1974  }
+ Here is the caller graph for this function:

◆ collectMediaObjects()

ilPageObject::collectMediaObjects ( bool  $a_inline_only = true)

get all media objects, that are referenced and used within the page

Definition at line 1062 of file class.ilPageObject.php.

References getDomDoc().

Referenced by delete().

1062  : array
1063  {
1064  $mob_manager = $this->pc_service->mediaObject();
1065  return $mob_manager->collectMediaObjects($this->getDomDoc(), $a_inline_only);
1066  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ containsDeactivatedElements()

ilPageObject::containsDeactivatedElements ( string  $a_content)

Check whether content contains deactivated elements.

Definition at line 2065 of file class.ilPageObject.php.

Referenced by createFromXML(), update(), and updateFromXML().

2065  : bool
2066  {
2067  if (strpos($a_content, " Enabled=\"False\"")) {
2068  return true;
2069  }
2070  return false;
2071  }
+ Here is the caller graph for this function:

◆ containsIntLink()

ilPageObject::containsIntLink ( )

returns true, if page was marked as containing an intern link (via setContainsIntLink) (this method should only be called by the import parser)

Definition at line 1020 of file class.ilPageObject.php.

References $contains_int_link.

1020  : bool
1021  {
1022  return $this->contains_int_link;
1023  }

◆ containsIntLinks()

ilPageObject::containsIntLinks ( string  $a_content)

Check whether content contains internal links.

Definition at line 2540 of file class.ilPageObject.php.

Referenced by createFromXML(), update(), and updateFromXML().

2540  : bool
2541  {
2542  if (strpos($a_content, "IntLink")) {
2543  return true;
2544  }
2545  return false;
2546  }
+ Here is the caller graph for this function:

◆ copy()

ilPageObject::copy ( int  $a_id,
string  $a_parent_type = "",
int  $a_new_parent_id = 0,
bool  $a_clone_mobs = false,
int  $obj_copy_id = 0,
bool  $overwrite_existing = true 
)

Copy page.

Parameters
int$a_idtarget page id (new page)
string$a_parent_type
int$a_new_parent_id
false$a_clone_mobs
int$obj_copy_idcopy wizard id

Definition at line 2601 of file class.ilPageObject.php.

References _exists(), getId(), ilPageObjectFactory\getInstance(), getParentId(), getParentType(), and setCopyProperties().

Referenced by ilDclTableView\cloneStructure(), and ilObjectCopyGUI\copyParentPage().

2608  : void {
2609  if ($a_parent_type == "") {
2610  $a_parent_type = $this->getParentType();
2611  if ($a_new_parent_id == 0) {
2612  $a_new_parent_id = $this->getParentId();
2613  }
2614  }
2615 
2616  foreach (self::lookupTranslations($this->getParentType(), $this->getId()) as $l) {
2617  $existed = false;
2618  $orig_page = ilPageObjectFactory::getInstance($this->getParentType(), $this->getId(), 0, $l);
2619  if (ilPageObject::_exists($a_parent_type, $a_id, $l)) {
2620  if (!$overwrite_existing) {
2621  continue;
2622  }
2623  $new_page_object = ilPageObjectFactory::getInstance($a_parent_type, $a_id, 0, $l);
2624  $existed = true;
2625  } else {
2626  $new_page_object = ilPageObjectFactory::getInstance($a_parent_type, 0, 0, $l);
2627  $new_page_object->setParentId($a_new_parent_id);
2628  $new_page_object->setId($a_id);
2629  }
2630  $new_page_object->setXMLContent($orig_page->copyXMLContent($a_clone_mobs, $a_new_parent_id, $obj_copy_id));
2631  $new_page_object->setActive($orig_page->getActive());
2632  $new_page_object->setActivationStart($orig_page->getActivationStart());
2633  $new_page_object->setActivationEnd($orig_page->getActivationEnd());
2634  $this->setCopyProperties($new_page_object);
2635  if ($existed) {
2636  $new_page_object->buildDom();
2637  $new_page_object->update();
2638  } else {
2639  $new_page_object->create(false);
2640  }
2641  }
2642  }
setCopyProperties(ilPageObject $new_page)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyContents()

ilPageObject::copyContents ( array  $a_hids)

Copy contents to clipboard.

Definition at line 1839 of file class.ilPageObject.php.

References getDomDoc(), and ILIAS\Repository\user().

Referenced by cutContents().

1839  : void
1840  {
1841  $cm = $this->page_manager->content($this->getDomDoc());
1842  $cm->copyContents($a_hids, $this->user);
1843  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyPageToTranslation()

ilPageObject::copyPageToTranslation ( string  $a_target_lang)

Copy page to translation.

Definition at line 2675 of file class.ilPageObject.php.

References ilPageObjectFactory\getInstance(), getParentType(), and setTranslationProperties().

2677  : void {
2678  $transl_page = ilPageObjectFactory::getInstance(
2679  $this->getParentType(),
2680  0,
2681  0,
2682  $a_target_lang
2683  );
2684  $this->setTranslationProperties($transl_page);
2685  $transl_page->create(false);
2686  }
setTranslationProperties(self $transl_page)
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
+ Here is the call graph for this function:

◆ copyXmlContent()

ilPageObject::copyXmlContent ( bool  $a_clone_mobs = false,
int  $a_new_parent_id = 0,
int  $obj_copy_id = 0,
bool  $self_ass = true 
)

Copy content of page; replace page components with copies where necessary (e.g.

questions)

Returns
string|string[]|null

Definition at line 815 of file class.ilPageObject.php.

References getXMLContent().

Referenced by setTranslationProperties().

820  : string {
821  $cm = $this->page_manager->contentFromXml($this->getXMLContent());
822  return $cm->copyXmlContent(
823  $this,
824  $a_clone_mobs,
825  $a_new_parent_id,
826  $obj_copy_id,
827  $self_ass
828  );
829  }
getXMLContent(bool $a_incl_head=false)
get xml content of page
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilPageObject::create ( bool  $a_import = false)

create new page (with current xml data)

Definition at line 1774 of file class.ilPageObject.php.

References createFromXML().

1774  : void
1775  {
1776  $this->createFromXML();
1777  }
createFromXML()
Create new page object with current xml content.
+ Here is the call graph for this function:

◆ createFromXML()

ilPageObject::createFromXML ( )

Create new page object with current xml content.

Definition at line 1278 of file class.ilPageObject.php.

References __afterUpdate(), buildDom(), containsDeactivatedElements(), containsIntLinks(), getActivationEnd(), getActivationStart(), getActive(), getDomDoc(), getId(), getLanguage(), getParentId(), getParentType(), getShowActivationInfo(), getXMLContent(), ilUtil\now(), setEmptyPageXml(), ILIAS\Repository\user(), and validateDom().

Referenced by create(), and ilTestPage\createPageWithNextId().

1278  : void
1279  {
1280  $empty = false;
1281  if ($this->getXMLContent() === "") {
1282  $this->setEmptyPageXml();
1283  $empty = true;
1284  }
1285  $content = $this->getXMLContent();
1286  $this->buildDom(true);
1287  $dom_doc = $this->getDomDoc();
1288 
1289  $errors = $this->validateDom(true);
1290 
1291  $iel = $this->containsDeactivatedElements($content);
1292  $inl = $this->containsIntLinks($content);
1293  // create object
1294  $this->db->insert("page_object", array(
1295  "page_id" => array("integer", $this->getId()),
1296  "parent_id" => array("integer", $this->getParentId()),
1297  "lang" => array("text", $this->getLanguage()),
1298  "content" => array("clob", $content),
1299  "parent_type" => array("text", $this->getParentType()),
1300  "create_user" => array("integer", $this->user->getId()),
1301  "last_change_user" => array("integer", $this->user->getId()),
1302  "active" => array("integer", (int) $this->getActive()),
1303  "activation_start" => array("timestamp", $this->getActivationStart()),
1304  "activation_end" => array("timestamp", $this->getActivationEnd()),
1305  "show_activation_info" => array("integer", (int) $this->getShowActivationInfo()),
1306  "inactive_elements" => array("integer", $iel),
1307  "int_links" => array("integer", $inl),
1308  "created" => array("timestamp", ilUtil::now()),
1309  "last_change" => array("timestamp", ilUtil::now()),
1310  "is_empty" => array("integer", $empty)
1311  ));
1312  // after update event
1313  $this->__afterUpdate($dom_doc, $content, true, $empty);
1314  }
getActive(bool $a_check_scheduled_activation=false)
validateDom(bool $throw=false)
Validate the page content agains page DTD.
buildDom(bool $a_force=false)
getDomDoc()
Get dom doc (DOMDocument)
static now()
Return current timestamp in Y-m-d H:i:s format.
containsIntLinks(string $a_content)
Check whether content contains internal links.
__afterUpdate(DOMDocument $a_domdoc, string $a_xml, bool $a_creation=false, bool $a_empty=false)
After update event handler (internal).
containsDeactivatedElements(string $a_content)
Check whether content contains deactivated elements.
getXMLContent(bool $a_incl_head=false)
get xml content of page
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cutContents()

ilPageObject::cutContents ( array  $a_hids)

Copy contents to clipboard and cut them from the page.

Returns
array|bool
Exceptions
ilDateTimeException

Definition at line 1825 of file class.ilPageObject.php.

References copyContents(), deleteContents(), and getPageConfig().

1826  {
1827  $this->copyContents($a_hids);
1828  return $this->deleteContents(
1829  $a_hids,
1830  true,
1831  $this->getPageConfig()->getEnableSelfAssessment(),
1832  true
1833  );
1834  }
deleteContents(array $a_hids, bool $a_update=true, bool $a_self_ass=false, bool $move_operation=false)
Delete multiple content objects.
copyContents(array $a_hids)
Copy contents to clipboard.
+ Here is the call graph for this function:

◆ delete()

ilPageObject::delete ( )

Definition at line 1576 of file class.ilPageObject.php.

References __afterDelete(), __beforeDelete(), ilObjMediaObject\_deleteAllUsages(), ilObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilObject\_lookupType(), buildDom(), collectMediaObjects(), deleteInternalLinks(), ilNewsItem\deleteNewsOfContext(), deleteStyleUsages(), getId(), getLanguage(), ilLoggerFactory\getLogger(), getParentId(), getParentType(), handleDeleteContent(), and isTranslationPage().

1576  : void
1577  {
1578  $copg_logger = ilLoggerFactory::getLogger('copg');
1579  $copg_logger->debug(
1580  "ilPageObject: Delete called for ID '" . $this->getId() . "'," .
1581  " parent type: '" . $this->getParentType() . "', " .
1582  " hist nr: '" . $this->old_nr . "', " .
1583  " lang: '" . $this->getLanguage() . "', "
1584  );
1585 
1586  $mobs = array();
1587  if (!$this->page_not_found) {
1588  $this->buildDom();
1589  $mobs = $this->collectMediaObjects(false);
1590  }
1592  $this->getParentType() . ":pg",
1593  $this->getId(),
1594  false,
1595  $this->getLanguage()
1596  );
1597 
1598  foreach ($mobs2 as $m) {
1599  if (!in_array($m, $mobs)) {
1600  $mobs[] = $m;
1601  }
1602  }
1603 
1604  $copg_logger->debug("ilPageObject: ... found " . count($mobs) . " media objects.");
1605 
1606  $this->__beforeDelete();
1607 
1608  // treat plugged content
1609  $this->handleDeleteContent();
1610 
1611  // delete style usages
1612  $this->deleteStyleUsages(false);
1613 
1614  // delete internal links
1615  $this->deleteInternalLinks();
1616 
1617  // delete all mob usages
1618  ilObjMediaObject::_deleteAllUsages($this->getParentType() . ":pg", $this->getId());
1619 
1620  // delete news
1621  if (!$this->isTranslationPage()) {
1623  $this->getParentId(),
1624  $this->getParentType(),
1625  $this->getId(),
1626  "pg"
1627  );
1628  }
1629 
1630  // delete page_object entry
1631  $and = $this->isTranslationPage()
1632  ? " AND lang = " . $this->db->quote($this->getLanguage(), "text")
1633  : "";
1634  $this->db->manipulate("DELETE FROM page_object " .
1635  "WHERE page_id = " . $this->db->quote($this->getId(), "integer") .
1636  " AND parent_type= " . $this->db->quote($this->getParentType(), "text") . $and);
1637 
1638  // delete media objects
1639  foreach ($mobs as $mob_id) {
1640  $copg_logger->debug("ilPageObject: ... processing mob " . $mob_id . ".");
1641 
1642  if (ilObject::_lookupType($mob_id) != 'mob') {
1643  $copg_logger->debug("ilPageObject: ... type mismatch. Ignoring mob " . $mob_id . ".");
1644  continue;
1645  }
1646 
1647  if (ilObject::_exists($mob_id)) {
1648  $copg_logger->debug("ilPageObject: ... delete mob " . $mob_id . ".");
1649 
1650  $mob_obj = new ilObjMediaObject($mob_id);
1651  $mob_obj->delete();
1652  } else {
1653  $copg_logger->debug("ilPageObject: ... missing mob " . $mob_id . ".");
1654  }
1655  }
1656 
1657  $this->__afterDelete();
1658  }
__beforeDelete()
Before deletion handler (internal).
buildDom(bool $a_force=false)
static deleteNewsOfContext(int $a_context_obj_id, string $a_context_obj_type, int $a_context_sub_obj_id=0, string $a_context_sub_obj_type="")
Delete all news of a context.
static getLogger(string $a_component_id)
Get component logger.
deleteStyleUsages(int $a_old_nr=0)
Delete style usages.
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
deleteInternalLinks()
Delete internal links.
static _getMobsOfObject(string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
static _deleteAllUsages(string $a_type, int $a_id, ?int $a_usage_hist_nr=0, string $a_lang="-")
collectMediaObjects(bool $a_inline_only=true)
get all media objects, that are referenced and used within the page
static _lookupType(int $id, bool $reference=false)
handleDeleteContent(?DOMNode $a_node=null, $move_operation=false)
Handle content before deletion This currently treats only plugged content If no node is given...
+ Here is the call graph for this function:

◆ deleteContent()

ilPageObject::deleteContent ( string  $a_hid,
bool  $a_update = true,
string  $a_pcid = "",
bool  $move_operation = false 
)

delete content object with hierarchical id $a_hid

Returns
array|bool
Exceptions
ilDateTimeException
ilWACException

Definition at line 1785 of file class.ilPageObject.php.

References getDomDoc(), and update().

1790  {
1791  $pm = $this->page_manager->content($this->getDomDoc());
1792  $pm->deleteContent($this, $a_hid, $a_pcid, $move_operation);
1793  if ($a_update) {
1794  return $this->update();
1795  }
1796  return true;
1797  }
update(bool $a_validate=true, bool $a_no_history=false)
update complete page content in db (dom xml content is used)
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ deleteContents()

ilPageObject::deleteContents ( array  $a_hids,
bool  $a_update = true,
bool  $a_self_ass = false,
bool  $move_operation = false 
)

Delete multiple content objects.

Parameters
bool$a_updateupdate page in db (note: update deletes all hierarchical ids in DOM!)
Returns
array|bool
Exceptions
ilDateTimeException

Definition at line 1806 of file class.ilPageObject.php.

References getDomDoc(), and update().

Referenced by cutContents().

1811  {
1812  $pm = $this->page_manager->content($this->getDomDoc());
1813  $pm->deleteContents($this, $a_hids, $a_self_ass, $move_operation);
1814  if ($a_update) {
1815  return $this->update();
1816  }
1817  return true;
1818  }
update(bool $a_validate=true, bool $a_no_history=false)
update complete page content in db (dom xml content is used)
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteInternalLinks()

ilPageObject::deleteInternalLinks ( )

Delete internal links.

Definition at line 1753 of file class.ilPageObject.php.

References ILIAS\Repository\link().

Referenced by delete().

1753  : void
1754  {
1755  $this->link->deleteInternalLinks($this);
1756  }
link(string $caption, string $href, bool $new_viewport=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteStyleUsages()

ilPageObject::deleteStyleUsages ( int  $a_old_nr = 0)

Delete style usages.

Definition at line 1726 of file class.ilPageObject.php.

Referenced by delete().

1726  : void
1727  {
1728  $this->style_manager->deleteStyleUsages($this, $a_old_nr);
1729  }
+ Here is the caller graph for this function:

◆ freeDom()

ilPageObject::freeDom ( )

Definition at line 407 of file class.ilPageObject.php.

407  : void
408  {
409  unset($this->dom);
410  }

◆ generatePCId()

ilPageObject::generatePCId ( )

Definition at line 1998 of file class.ilPageObject.php.

1998  : string
1999  {
2000  return $this->content_id_manager->generatePCId();
2001  }

◆ getActivationEnd()

ilPageObject::getActivationEnd ( )

Definition at line 700 of file class.ilPageObject.php.

References $activationend.

Referenced by createFromXML(), getActive(), setTranslationProperties(), update(), and updateFromXML().

700  : ?string
701  {
702  return $this->activationend;
703  }
+ Here is the caller graph for this function:

◆ getActivationStart()

ilPageObject::getActivationStart ( )

Definition at line 683 of file class.ilPageObject.php.

References $activationstart.

Referenced by createFromXML(), getActive(), setTranslationProperties(), update(), and updateFromXML().

683  : ?string
684  {
685  return $this->activationstart;
686  }
+ Here is the caller graph for this function:

◆ getActive()

ilPageObject::getActive ( bool  $a_check_scheduled_activation = false)

Definition at line 470 of file class.ilPageObject.php.

References $active, ilDateTime\_after(), ilDateTime\_before(), getActivationEnd(), getActivationStart(), IL_CAL_DATETIME, and IL_CAL_UNIX.

Referenced by ilBlogPosting\checkApproval(), createFromXML(), ilBlogPosting\handleNews(), setTranslationProperties(), ilBlogPosting\update(), update(), and updateFromXML().

472  : bool {
473  if ($a_check_scheduled_activation && !$this->active) {
474  $start = new ilDateTime($this->getActivationStart(), IL_CAL_DATETIME);
475  $end = new ilDateTime($this->getActivationEnd(), IL_CAL_DATETIME);
476  $now = new ilDateTime(time(), IL_CAL_UNIX);
477  if (!ilDateTime::_before($now, $start) && !ilDateTime::_after($now, $end)) {
478  return true;
479  }
480  }
481  return $this->active;
482  }
const IL_CAL_DATETIME
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
const IL_CAL_UNIX
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllPages()

static ilPageObject::getAllPages ( string  $a_parent_type,
int  $a_parent_id,
string  $a_lang = "-" 
)
static

Get all pages for parent object.

Definition at line 2273 of file class.ilPageObject.php.

References $DIC, $q, ilDBInterface\fetchAssoc(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by ilObjContentObject\autoLinkGlossaryTerms(), ilContentPagePageCollector\getAllPageIds(), ilForumPageCollector\getAllPageIds(), ilLearningModulePageCollector\getAllPageIds(), and ilCourseExporter\getXmlExportTailDependencies().

2277  : array {
2278  global $DIC;
2279 
2280  $db = $DIC->database();
2281 
2282  $and_lang = "";
2283  if ($a_lang != "") {
2284  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2285  }
2286 
2287  $q = "SELECT * FROM page_object " .
2288  " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2289  " AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang;
2290  $set = $db->query($q);
2291  $pages = array();
2292  while ($page = $db->fetchAssoc($set)) {
2293  $key_add = ($a_lang == "")
2294  ? ":" . $page["lang"]
2295  : "";
2296  $pages[$page["page_id"] . $key_add] = array(
2297  "date" => $page["last_change"],
2298  "id" => $page["page_id"],
2299  "lang" => $page["lang"],
2300  "user" => $page["last_change_user"]
2301  );
2302  }
2303 
2304  return $pages;
2305  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
$q
Definition: shib_logout.php:21
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllPCIds()

ilPageObject::getAllPCIds ( )

Get all pc ids.

Definition at line 1979 of file class.ilPageObject.php.

1979  : array
1980  {
1981  return $this->content_id_manager->getAllPCIds();
1982  }

◆ getConcreteLang()

ilPageObject::getConcreteLang ( )

Definition at line 209 of file class.ilPageObject.php.

References $concrete_lang.

209  : string
210  {
211  return $this->concrete_lang;
212  }

◆ getContainsQuestion()

ilPageObject::getContainsQuestion ( )

Definition at line 1052 of file class.ilPageObject.php.

References $contains_question.

1052  : bool
1053  {
1054  return $this->contains_question;
1055  }

◆ getContentDomNode()

ilPageObject::getContentDomNode ( string  $a_hier_id,
string  $a_pc_id = "" 
)

Definition at line 753 of file class.ilPageObject.php.

References getDomDoc().

Referenced by PCGridTest\getCellForHierId(), getDomNodeForPCId(), PCFileListTest\getItemForHierId(), PCListTest\getItemForHierId(), PCTabsTest\getTabForHierId(), PCTableDataTest\getTDForHierId(), and ILIAS\COPage\Compare\PageCompare\setParagraphContent().

753  : ?DOMNode
754  {
755  $cm = $this->page_manager->content($this->getDomDoc());
756  return $cm->getContentDomNode($a_hier_id, $a_pc_id);
757  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContentManager()

ilPageObject::getContentManager ( )
protected

Definition at line 2555 of file class.ilPageObject.php.

References buildDom(), and getDomDoc().

Referenced by getInitialOpenedContent(), and saveInitialOpenedContent().

2556  {
2557  $this->buildDom();
2558  return $this->page_manager->content($this->getDomDoc());
2559  }
buildDom(bool $a_force=false)
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContentObject()

ilPageObject::getContentObject ( string  $a_hier_id,
string  $a_pc_id = "" 
)

Get a content object of the page.

Definition at line 708 of file class.ilPageObject.php.

References getDomDoc().

Referenced by assignCharacteristic(), getContentObjectForPcId(), ilPCParagraph\insert(), ILIAS\COPage\Page\PageContentManager\moveContentAfter(), and ilPCParagraph\saveJS().

711  : ?ilPageContent {
712  $node = $this->page_manager->content($this->getDomDoc())->getContentDomNode(
713  $a_hier_id,
714  $a_pc_id
715  );
716  if ($node) {
717  $this->log->debug("getContentObject: " . " $a_hier_id, $a_pc_id, " . $node->nodeName);
718  } else {
719  $this->log->debug("no node found: " . " $a_hier_id, $a_pc_id ");
720  }
721  return $this->pc_service->getByNode($node, $this);
722  }
getDomDoc()
Get dom doc (DOMDocument)
Content object of ilPageObject (see ILIAS DTD).
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContentObjectForPcId()

ilPageObject::getContentObjectForPcId ( string  $pcid)

Get content object for pc id.

Definition at line 727 of file class.ilPageObject.php.

References getContentObject(), and getHierIdsForPCIds().

Referenced by ilPCTableModelProvider\getModels(), and getParentContentObjectForPcId().

727  : ?ilPageContent
728  {
729  $hier_ids = $this->getHierIdsForPCIds([$pcid]);
730  return $this->getContentObject($hier_ids[$pcid], $pcid);
731  }
Content object of ilPageObject (see ILIAS DTD).
getHierIdsForPCIds(array $a_pc_ids)
Get hier ids for a set of pc ids.
getContentObject(string $a_hier_id, string $a_pc_id="")
Get a content object of the page.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContentTemplates()

ilPageObject::getContentTemplates ( )

Get content templates.

Returns
array array of arrays with "id" => page id (int), "parent_type" => parent type (string), "title" => title (string)

Definition at line 2928 of file class.ilPageObject.php.

2928  : array
2929  {
2930  return array();
2931  }

◆ getCreationUserId()

ilPageObject::getCreationUserId ( )

Definition at line 279 of file class.ilPageObject.php.

References $create_user.

279  : int
280  {
281  return $this->create_user;
282  }

◆ getDomDoc()

ilPageObject::getDomDoc ( )

Get dom doc (DOMDocument)

Definition at line 415 of file class.ilPageObject.php.

References $dom.

Referenced by ilPageContent\__construct(), ilPageContentGUI\__construct(), ILIAS\COPage\Compare\PageCompare\addChangeDivClasses(), addFileSizes(), ilContainerPage\addRepositoryBlockToPage(), ilCOPageImporter\afterContainerImportProcessing(), ilPCParagraph\autoLinkGlossariesPage(), ilPCFileList\beforePageDelete(), collectMediaObjects(), copyContents(), ilWikiPage\create(), createFromXML(), deleteContent(), deleteContents(), ILIAS\COPage\Page\PageContentManager\downloadFile(), getContentDomNode(), getContentManager(), getContentObject(), ILIAS\COPage\PC\Paragraph\ParagraphManager\getFirstParagraphText(), getInternalLinks(), getMediaAliasElement(), ilPCParagraphModelProvider\getModels(), ilPCPlaceHolderModelProvider\getModels(), ilPCSectionModelProvider\getModels(), ilPCTableModelProvider\getModels(), getMultimediaXML(), ILIAS\COPage\Compare\PageCompare\getPageContentsHashes(), ilPortfolioTemplatePage\getPageDiskSize(), ILIAS\COPage\PC\Paragraph\ParagraphManager\getParagraphForPCID(), ILIAS\COPage\ID\ContentIdManager\getPCIdsForHierIds(), ilPCPlugged\getPluginName(), ilObjPortfolioGUI\getSkillsToPortfolioAssignment(), ilCOPageExporter\getValidSchemaVersions(), handleDeleteContent(), handleRepositoryLinksOnCopy(), insertContent(), insertContentNode(), insertInstIntoIDs(), ilPCVerification\isInPortfolioPage(), ilPCResources\modifyItemGroupRefIdsByMapping(), moveContentAfter(), moveIntLinks(), pasteContents(), ilContainerPage\removeUnsupportedBlockIds(), ilPortfolioPage\renameLinksOnTitleChange(), resolveFileItems(), resolveIIMMediaAliases(), resolveIntLinks(), ILIAS\COPage\PC\MediaObject\MediaObjectManager\resolveMediaAliases(), resolveQuestionReferences(), ilPCSection\saveTimings(), sendParagraph(), switchEnableMultiple(), update(), and updateFromXML().

415  : DOMDocument
416  {
417  return $this->dom;
418  }
DOMDocument $dom
+ Here is the caller graph for this function:

◆ getDomNodeForPCId()

ilPageObject::getDomNodeForPCId ( string  $pc_id)

Definition at line 759 of file class.ilPageObject.php.

References getContentDomNode().

759  : ?DOMNode
760  {
761  return $this->getContentDomNode("", $pc_id);
762  }
getContentDomNode(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:

◆ getDuplicatePCIds()

ilPageObject::getDuplicatePCIds ( )

Get all duplicate PC Ids.

Returns
int[]

Definition at line 1993 of file class.ilPageObject.php.

Referenced by update().

1993  : array
1994  {
1995  return $this->content_id_manager->getDuplicatePCIds();
1996  }
+ Here is the caller graph for this function:

◆ getEditLock()

ilPageObject::getEditLock ( )

Get page lock.

Definition at line 2706 of file class.ilPageObject.php.

References $db, $user, ilDBInterface\fetchAssoc(), getEffectiveEditLockTime(), ilObject\getId(), getId(), getParentType(), ilDBInterface\manipulate(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by update().

2706  : bool
2707  {
2708  $db = $this->db;
2709  $user = $this->user;
2710 
2711  $min = $this->getEffectiveEditLockTime();
2712  if ($min > 0) {
2713  // try to set the lock for the user
2714  $ts = time();
2715  $db->manipulate(
2716  "UPDATE page_object SET " .
2717  " edit_lock_user = " . $db->quote($user->getId(), "integer") . "," .
2718  " edit_lock_ts = " . $db->quote($ts, "integer") .
2719  " WHERE (edit_lock_user = " . $db->quote($user->getId(), "integer") . " OR " .
2720  " edit_lock_ts < " . $db->quote(time() - ($min * 60), "integer") . ") " .
2721  " AND page_id = " . $db->quote($this->getId(), "integer") .
2722  " AND parent_type = " . $db->quote($this->getParentType(), "text")
2723  );
2724 
2725  $set = $db->query(
2726  "SELECT edit_lock_user FROM page_object " .
2727  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2728  " AND parent_type = " . $db->quote($this->getParentType(), "text")
2729  );
2730  $rec = $db->fetchAssoc($set);
2731  if ($rec["edit_lock_user"] != $user->getId()) {
2732  return false;
2733  }
2734  }
2735 
2736  return true;
2737  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEditLockInfo()

ilPageObject::getEditLockInfo ( )

Get edit lock info.

Definition at line 2778 of file class.ilPageObject.php.

References $db, ilDBInterface\fetchAssoc(), ILIAS\Repository\int(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by update().

2778  : array
2779  {
2780  $db = $this->db;
2781 
2782  $aset = new ilSetting("adve");
2783  $min = (int) $aset->get("block_mode_minutes");
2784 
2785  $set = $db->query(
2786  "SELECT edit_lock_user, edit_lock_ts FROM page_object " .
2787  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2788  " AND parent_type = " . $db->quote($this->getParentType(), "text")
2789  );
2790  $rec = $db->fetchAssoc($set);
2791  $rec["edit_lock_until"] = $rec["edit_lock_ts"] + $min * 60;
2792 
2793  return $rec;
2794  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEffectiveEditLockTime()

ilPageObject::getEffectiveEditLockTime ( )

Definition at line 2962 of file class.ilPageObject.php.

References getPageConfig(), and ILIAS\Repository\int().

Referenced by getEditLock().

2962  : int
2963  {
2964  if ($this->getPageConfig()->getEditLockSupport() == false) {
2965  return 0;
2966  }
2967 
2968  $aset = new ilSetting("adve");
2969  $min = (int) $aset->get("block_mode_minutes");
2970 
2971  return $min;
2972  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFirstParagraphText()

ilPageObject::getFirstParagraphText ( )

Definition at line 992 of file class.ilPageObject.php.

992  : string
993  {
994  return $this->pc_service->paragraph()->getFirstParagraphText($this);
995  }

◆ getHierIdForPcId()

ilPageObject::getHierIdForPcId ( string  $pcid)

Definition at line 1145 of file class.ilPageObject.php.

1145  : string
1146  {
1147  return $this->content_id_manager->getHierIdForPcId($pcid);
1148  }

◆ getHierIds()

ilPageObject::getHierIds ( )

Definition at line 1122 of file class.ilPageObject.php.

1122  : array
1123  {
1124  return $this->content_id_manager->getHierIds();
1125  }

◆ getHierIdsForPCIds()

ilPageObject::getHierIdsForPCIds ( array  $a_pc_ids)

Get hier ids for a set of pc ids.

Definition at line 1140 of file class.ilPageObject.php.

Referenced by ilPCMediaObjectGUI\__construct(), getContentObjectForPcId(), ILIAS\COPage\PC\Paragraph\ParagraphCommandActionHandler\getFullIdForPCId(), and ilPCParagraph\getLastSavedPCId().

1140  : array
1141  {
1142  return $this->content_id_manager->getHierIdsForPCIds($a_pc_ids);
1143  }
+ Here is the caller graph for this function:

◆ getHistoryEntries()

ilPageObject::getHistoryEntries ( )

Get History Entries.

Definition at line 2076 of file class.ilPageObject.php.

References $db, ilDBInterface\fetchAssoc(), getId(), getLanguage(), getParentType(), ILIAS\Repository\int(), ilDBInterface\query(), and ilDBInterface\quote().

2076  : array
2077  {
2078  $db = $this->db;
2079 
2080  $h_query = "SELECT * FROM page_history " .
2081  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2082  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2083  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2084  " ORDER BY hdate DESC";
2085 
2086  $hset = $db->query($h_query);
2087  $hentries = array();
2088 
2089  while ($hrec = $db->fetchAssoc($hset)) {
2090  $hrec["sortkey"] = (int) $hrec["nr"];
2091  $hrec["user"] = (int) $hrec["user_id"];
2092  $hentries[] = $hrec;
2093  }
2094  //var_dump($hentries);
2095  return $hentries;
2096  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
+ Here is the call graph for this function:

◆ getHistoryEntry()

ilPageObject::getHistoryEntry ( int  $a_old_nr)

Get History Entry.

Definition at line 2101 of file class.ilPageObject.php.

References $db, $res, ilDBInterface\fetchAssoc(), getId(), getLanguage(), getParentType(), and ilDBInterface\queryF().

2101  : ?array
2102  {
2103  $db = $this->db;
2104 
2105  $res = $db->queryF(
2106  "SELECT * FROM page_history " .
2107  " WHERE page_id = %s " .
2108  " AND parent_type = %s " .
2109  " AND nr = %s" .
2110  " AND lang = %s",
2111  array("integer", "text", "integer", "text"),
2112  array($this->getId(), $this->getParentType(), $a_old_nr, $this->getLanguage())
2113  );
2114  if ($hrec = $db->fetchAssoc($res)) {
2115  return $hrec;
2116  }
2117 
2118  return null;
2119  }
$res
Definition: ltiservices.php:69
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
ilDBInterface $db
+ Here is the call graph for this function:

◆ getHistoryInfo()

ilPageObject::getHistoryInfo ( int  $a_nr)

Get information about a history entry, its predecessor and its successor.

Parameters
int$a_nrNr of history entry

Definition at line 2126 of file class.ilPageObject.php.

References $db, $res, ilDBInterface\fetchAssoc(), ilDBInterface\query(), and ilDBInterface\quote().

2126  : array
2127  {
2128  $db = $this->db;
2129 
2130  // determine previous entry
2131  $and_nr = ($a_nr > 0)
2132  ? " AND nr < " . $db->quote($a_nr, "integer")
2133  : "";
2134  $res = $db->query("SELECT MAX(nr) mnr FROM page_history " .
2135  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2136  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2137  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2138  $and_nr);
2139  $row = $db->fetchAssoc($res);
2140  if ($row["mnr"] > 0) {
2141  $res = $db->query("SELECT * FROM page_history " .
2142  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2143  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2144  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2145  " AND nr = " . $db->quote((int) $row["mnr"], "integer"));
2146  $row = $db->fetchAssoc($res);
2147  $ret["previous"] = $row;
2148  }
2149 
2150  // determine next entry
2151  $res = $db->query("SELECT MIN(nr) mnr FROM page_history " .
2152  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2153  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2154  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2155  " AND nr > " . $db->quote($a_nr, "integer"));
2156  $row = $db->fetchAssoc($res);
2157  if ($row["mnr"] > 0) {
2158  $res = $db->query("SELECT * FROM page_history " .
2159  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2160  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2161  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2162  " AND nr = " . $db->quote((int) $row["mnr"], "integer"));
2163  $row = $db->fetchAssoc($res);
2164  $ret["next"] = $row;
2165  }
2166 
2167  // current
2168  if ($a_nr > 0) {
2169  $res = $db->query("SELECT * FROM page_history " .
2170  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2171  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2172  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2173  " AND nr = " . $db->quote($a_nr, "integer"));
2174  } else {
2175  $res = $db->query("SELECT page_id, last_change hdate, parent_type, parent_id, last_change_user user_id, content, lang FROM page_object " .
2176  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2177  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2178  " AND lang = " . $db->quote($this->getLanguage(), "text"));
2179  }
2180  $row = $db->fetchAssoc($res);
2181  $ret["current"] = $row;
2182 
2183  return $ret;
2184  }
$res
Definition: ltiservices.php:69
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
+ Here is the call graph for this function:

◆ getId()

ilPageObject::getId ( )

Definition at line 425 of file class.ilPageObject.php.

References $id.

Referenced by ilTestExpressPageObjectGUI\addPageOfQuestions(), ilCOPageImporter\afterContainerImportProcessing(), ilPCQuestion\afterPageUpdate(), ilPCFileList\afterPageUpdate(), ilPCMediaObject\afterPageUpdate(), ilLMPage\afterUpdate(), ilPCSkills\beforePageDelete(), ilPCQuestion\beforePageDelete(), ilPCContentInclude\beforePageDelete(), ilPCFileList\beforePageDelete(), ilPCMediaObject\beforePageDelete(), ilPCParagraph\beforePageDelete(), buildDom(), copy(), ilBlogPosting\create(), ilWikiPage\create(), createFromXML(), ilMediaPoolPage\createMetaData(), ilTestPage\createPageWithNextId(), ilPortfolioPage\delete(), ilBlogPosting\delete(), ilWikiPage\delete(), delete(), ILIAS\COPage\Link\LinkManager\deleteInternalLinks(), ilMediaPoolPage\deleteMetaData(), ILIAS\COPage\Style\StyleManager\deleteStyleUsages(), ILIAS\COPage\Page\PageContentManager\downloadFile(), ilTestExpressPageObjectGUI\executeCommand(), ilDclDetailedViewDefinition\getAvailablePlaceholders(), ilPCSection\getCacheTriggerString(), getEditLock(), getHistoryEntries(), getHistoryEntry(), getLastUpdateOfIncludedElements(), ilBlogPosting\getMDSection(), ilBlogPosting\getNotificationAbstract(), ilObjPortfolioTemplateGUI\getPageInstance(), ilObjPortfolioGUI\getPageInstance(), ILIAS\COPage\ReadingTime\ReadingTimeManager\getTime(), ilMediaPoolPage\getUsages(), ilCOPageExporter\getValidSchemaVersions(), ilBlogPosting\handleNews(), ilWikiStat\handlePageDeletion(), ilWikiStat\handlePageRating(), ilWikiStat\handlePageRead(), ilWikiStat\handlePageUpdated(), ilMediaPoolPage\MDUpdateListener(), ilPortfolioPage\read(), ilBlogPosting\read(), ilWikiPage\read(), ilWikiPage\rename(), ILIAS\COPage\PC\MediaObject\MediaObjectManager\resolveMediaAliases(), ilPCParagraph\saveAnchors(), ilPCContentInclude\saveContentIncludeUsage(), ilPCFileList\saveFileUsage(), ILIAS\COPage\Link\LinkManager\saveInternalLinks(), ilWikiPage\saveInternalLinks(), ilPCParagraph\saveMetaKeywords(), ilPCMediaObject\saveMobUsage(), ilPCSkills\saveSkillUsage(), ILIAS\COPage\Style\StyleManager\saveStyleUsage(), ILIAS\COPage\ReadingTime\ReadingTimeManager\saveTime(), ilPCSection\saveTimings(), setTranslationProperties(), ilBlogPosting\unpublish(), ilPortfolioPage\update(), ilBlogPosting\update(), ilWikiPage\update(), update(), updateFromXML(), ilMediaPoolPage\updateMetaData(), ilWikiPage\updateNews(), and writeRenderedContent().

425  : int
426  {
427  return $this->id;
428  }
+ Here is the caller graph for this function:

◆ getIliasAbsolutePath()

ilPageObject::getIliasAbsolutePath ( )
protected

Definition at line 805 of file class.ilPageObject.php.

Referenced by getXMLContent().

805  : string
806  {
807  return ILIAS_ABSOLUTE_PATH;
808  }
+ Here is the caller graph for this function:

◆ getImportMode()

ilPageObject::getImportMode ( )

Definition at line 1030 of file class.ilPageObject.php.

References $import_mode.

Referenced by ilPCFileList\afterPageUpdate(), and ilPCMediaObject\afterPageUpdate().

1030  : bool
1031  {
1032  return $this->import_mode;
1033  }
+ Here is the caller graph for this function:

◆ getInitialOpenedContent()

ilPageObject::getInitialOpenedContent ( )

Get initial opened content.

Definition at line 2577 of file class.ilPageObject.php.

References getContentManager().

2577  : array
2578  {
2579  $cm = $this->getContentManager();
2580  return $cm->getInitialOpenedContent();
2581  }
+ Here is the call graph for this function:

◆ getInternalLinks()

ilPageObject::getInternalLinks ( )

get all internal links that are used within the page

Definition at line 1071 of file class.ilPageObject.php.

References getDomDoc(), and ILIAS\Repository\link().

1071  : array
1072  {
1073  return $this->link->getInternalLinks($this->getDomDoc());
1074  }
getDomDoc()
Get dom doc (DOMDocument)
link(string $caption, string $href, bool $new_viewport=false)
+ Here is the call graph for this function:

◆ getLanguage()

◆ getLanguageVariablesXML()

ilPageObject::getLanguageVariablesXML ( int  $style_id = 0)

Get language variables as XML.

Definition at line 902 of file class.ilPageObject.php.

References $txt, $xml, and getLangVarXML().

Referenced by getXMLFromDom().

902  : string
903  {
904  $xml = "<LVs>";
905  $lang_vars = array(
906  "ed_paste_clip",
907  "ed_edit",
908  "ed_edit_prop",
909  "ed_delete",
910  "ed_moveafter",
911  "ed_movebefore",
912  "ed_go",
913  "ed_class",
914  "ed_width",
915  "ed_align_left",
916  "ed_align_right",
917  "ed_align_center",
918  "ed_align_left_float",
919  "ed_align_right_float",
920  "ed_delete_item",
921  "ed_new_item_before",
922  "ed_new_item_after",
923  "ed_copy_clip",
924  "please_select",
925  "ed_split_page",
926  "ed_item_up",
927  "ed_item_down",
928  "ed_split_page_next",
929  "ed_enable",
930  "de_activate",
931  "ed_paste",
932  "ed_edit_multiple",
933  "ed_cut",
934  "ed_copy",
935  "ed_insert_templ",
936  "ed_click_to_add_pg",
937  "download"
938  );
939 
940  // collect lang vars from pc elements
941  $defs = $this->pc_definition->getPCDefinitions();
942  foreach ($defs as $def) {
943  $lang_vars[] = "pc_" . $def["pc_type"];
944  $lang_vars[] = "ed_insert_" . $def["pc_type"];
945 
946  $cl = $def["pc_class"];
947  $lvs = call_user_func($def["pc_class"] . '::getLangVars');
948  foreach ($lvs as $lv) {
949  $lang_vars[] = $lv;
950  }
951  }
952 
953  // workaround for #30561, should go to characteristic manager
954  $dummy_pc = new ilPCSectionGUI($this, null, "");
955  $dummy_pc->setStyleId($style_id);
956  foreach (["section", "table", "flist_li", "list_u", "list_o",
957  "table", "table_cell"] as $type) {
958  $dummy_pc->getCharacteristicsOfCurrentStyle([$type]);
959  foreach ($dummy_pc->getCharacteristics() as $char => $txt) {
960  $xml .= "<LV name=\"char_" . $type . "_" . $char . "\" value=\"" . $txt . "\"/>";
961  }
962  }
963  $type = "media_cont";
964  $dummy_pc = new ilPCMediaObjectGUI($this, null, "");
965  $dummy_pc->setStyleId($style_id);
966  $dummy_pc->getCharacteristicsOfCurrentStyle([$type]);
967  foreach ($dummy_pc->getCharacteristics() as $char => $txt) {
968  $xml .= "<LV name=\"char_" . $type . "_" . $char . "\" value=\"" . $txt . "\"/>";
969  }
970  foreach (["text_block", "heading1", "heading2", "heading3"] as $type) {
971  $dummy_pc = new ilPCParagraphGUI($this, null, "");
972  $dummy_pc->setStyleId($style_id);
973  $dummy_pc->getCharacteristicsOfCurrentStyle([$type]);
974  foreach ($dummy_pc->getCharacteristics() as $char => $txt) {
975  $xml .= "<LV name=\"char_" . $type . "_" . $char . "\" value=\"" . $txt . "\"/>";
976  }
977  }
978  foreach ($lang_vars as $lang_var) {
979  $xml .= $this->getLangVarXML($lang_var);
980  }
981  $xml .= "</LVs>";
982  return $xml;
983  }
getLangVarXML(string $var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$txt
Definition: error.php:14
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilPCParagraphGUI User Interface for Paragraph Editing.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLangVarXML()

ilPageObject::getLangVarXML ( string  $var)
protected

Definition at line 985 of file class.ilPageObject.php.

References ILIAS\Repository\lng().

Referenced by getLanguageVariablesXML().

985  : string
986  {
987  $val = $this->lng->txt("cont_" . $var);
988  $val = str_replace('"', "&quot;", $val);
989  return "<LV name=\"$var\" value=\"" . $val . "\"/>";
990  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLastChange()

ilPageObject::getLastChange ( )

Definition at line 254 of file class.ilPageObject.php.

References $lastchange.

254  : string
255  {
256  return $this->lastchange;
257  }

◆ getLastChangeByParent()

static ilPageObject::getLastChangeByParent ( string  $a_parent_type,
int  $a_parent_id,
string  $a_lang = "" 
)
static

Get all pages for parent object.

Definition at line 2936 of file class.ilPageObject.php.

References $DIC, $q, ilDBInterface\fetchAssoc(), ilDBInterface\query(), ilDBInterface\quote(), and ilDBInterface\setLimit().

Referenced by ilWikiUserHTMLExport\getProcess().

2940  : string {
2941  global $DIC;
2942 
2943  $db = $DIC->database();
2944 
2945  $and_lang = "";
2946  if ($a_lang != "") {
2947  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2948  }
2949 
2950  $db->setLimit(1, 0);
2951  $q = "SELECT last_change FROM page_object " .
2952  " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2953  " AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang .
2954  " ORDER BY last_change DESC";
2955 
2956  $set = $db->query($q);
2957  $rec = $db->fetchAssoc($set);
2958 
2959  return $rec["last_change"];
2960  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
setLimit(int $limit, int $offset=0)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
$q
Definition: shib_logout.php:21
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLastChangeUser()

ilPageObject::getLastChangeUser ( )

Definition at line 264 of file class.ilPageObject.php.

References $last_change_user.

264  : int
265  {
267  }

◆ getLastUpdateOfIncludedElements()

ilPageObject::getLastUpdateOfIncludedElements ( )

Get last update of included elements (media objects and files).

This is needed for cache logic, cache must be reloaded if anything has changed.

Todo:
: move to content include class

Definition at line 1736 of file class.ilPageObject.php.

References ilObject\_getLastUpdateOfObjects(), ilObjMediaObject\_getMobsOfObject(), getId(), and getParentType().

1736  : string
1737  {
1739  $this->getParentType() . ":pg",
1740  $this->getId()
1741  );
1742  $files = ilObjFile::_getFilesOfObject(
1743  $this->getParentType() . ":pg",
1744  $this->getId()
1745  );
1746  $objs = array_merge($mobs, $files);
1747  return ilObject::_getLastUpdateOfObjects($objs);
1748  }
static _getMobsOfObject(string $a_type, int $a_id, int $a_usage_hist_nr=0, string $a_lang="-")
static _getLastUpdateOfObjects(array $obj_ids)
+ Here is the call graph for this function:

◆ getMediaAliasElement()

ilPageObject::getMediaAliasElement ( int  $a_mob_id,
int  $a_nr = 1 
)

get complete media object (alias) element

Definition at line 1089 of file class.ilPageObject.php.

References getDomDoc().

1089  : string
1090  {
1091  $mob_manager = $this->pc_service->mediaObject();
1092  return $mob_manager->getMediaAliasElement(
1093  $this->getDomDoc(),
1094  $a_mob_id,
1095  $a_nr
1096  );
1097  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ getMultimediaXML()

ilPageObject::getMultimediaXML ( )

get a xml string that contains all media object elements, that are referenced by any media alias in the page

Definition at line 1080 of file class.ilPageObject.php.

References getDomDoc().

Referenced by getXMLFromDom().

1080  : string
1081  {
1082  $mob_manager = $this->pc_service->mediaObject();
1083  return $mob_manager->getMultimediaXML($this->getDomDoc());
1084  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewPages()

static ilPageObject::getNewPages ( string  $a_parent_type,
int  $a_parent_id,
string  $a_lang = "-" 
)
static

Get new pages.

Definition at line 2310 of file class.ilPageObject.php.

References $DIC, $q, ilDBInterface\fetchAssoc(), ilDBInterface\query(), and ilDBInterface\quote().

2314  : array {
2315  global $DIC;
2316 
2317  $db = $DIC->database();
2318 
2319  $and_lang = "";
2320  if ($a_lang != "") {
2321  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2322  }
2323 
2324  $pages = array();
2325 
2326  $q = "SELECT * FROM page_object " .
2327  " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2328  " AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang .
2329  " ORDER BY created DESC";
2330  $set = $db->query($q);
2331  while ($page = $db->fetchAssoc($set)) {
2332  if ($page["created"] != "") {
2333  $pages[] = array(
2334  "created" => $page["created"],
2335  "id" => $page["page_id"],
2336  "lang" => $page["lang"],
2337  "user" => $page["create_user"],
2338  );
2339  }
2340  }
2341 
2342  return $pages;
2343  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
$q
Definition: shib_logout.php:21
+ Here is the call graph for this function:

◆ getOfflineHandler()

ilPageObject::getOfflineHandler ( )

Definition at line 2027 of file class.ilPageObject.php.

References $offline_handler.

2027  : ?object
2028  {
2029  return $this->offline_handler;
2030  }

◆ getPageConfig()

ilPageObject::getPageConfig ( )

Definition at line 214 of file class.ilPageObject.php.

References $page_config.

Referenced by ilLMPage\afterConstructor(), ilWikiPage\afterConstructor(), cutContents(), getEffectiveEditLockTime(), getPCModel(), and insertContent().

214  : ilPageConfig
215  {
216  return $this->page_config;
217  }
ilPageConfig $page_config
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getPageContributors()

static ilPageObject::getPageContributors ( string  $a_parent_type,
int  $a_page_id,
string  $a_lang = "-" 
)
static

Get all contributors for parent object.

Definition at line 2416 of file class.ilPageObject.php.

References Vendor\Package\$c, $DIC, ilObjUser\_lookupName(), ilDBInterface\fetchAssoc(), ilDBInterface\queryF(), and ilDBInterface\quote().

Referenced by ilBlogPostingGUI\getPageHeading().

2420  : array {
2421  global $DIC;
2422 
2423  $db = $DIC->database();
2424 
2425  $and_lang = "";
2426  if ($a_lang != "") {
2427  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2428  }
2429 
2430  $contributors = array();
2431  $set = $db->queryF(
2432  "SELECT last_change_user, lang FROM page_object " .
2433  " WHERE page_id = %s AND parent_type = %s " .
2434  " AND last_change_user != %s" . $and_lang,
2435  array("integer", "text", "integer"),
2436  array($a_page_id, $a_parent_type, 0)
2437  );
2438 
2439  while ($page = $db->fetchAssoc($set)) {
2440  if ($a_lang == "") {
2441  $contributors[$page["last_change_user"]][$page["lang"]] = 1;
2442  } else {
2443  $contributors[$page["last_change_user"]] = 1;
2444  }
2445  }
2446 
2447  $set = $db->queryF(
2448  "SELECT count(*) as cnt, lang, page_id, user_id FROM page_history " .
2449  " WHERE page_id = %s AND parent_type = %s AND user_id != %s " . $and_lang .
2450  " GROUP BY user_id, page_id, lang ",
2451  array("integer", "text", "integer"),
2452  array($a_page_id, $a_parent_type, 0)
2453  );
2454  while ($hpage = $db->fetchAssoc($set)) {
2455  if ($a_lang === "") {
2456  $contributors[$hpage["user_id"]][$page["lang"]] =
2457  ($contributors[$hpage["user_id"]][$page["lang"]] ?? 0) + $hpage["cnt"];
2458  } else {
2459  $contributors[$hpage["user_id"]] =
2460  ($contributors[$hpage["user_id"]] ?? 0) + $hpage["cnt"];
2461  }
2462  }
2463 
2464  $c = array();
2465  foreach ($contributors as $k => $co) {
2466  $name = ilObjUser::_lookupName($k);
2467  $c[] = array("user_id" => $k,
2468  "pages" => $co,
2469  "lastname" => $name["lastname"],
2470  "firstname" => $name["firstname"]
2471  );
2472  }
2473 
2474  return $c;
2475  }
fetchAssoc(ilDBStatement $statement)
static _lookupName(int $a_user_id)
lookup user name
quote($value, string $type)
global $DIC
Definition: feed.php:28
queryF(string $query, array $types, array $values)
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPagesWithLinks()

static ilPageObject::getPagesWithLinks ( string  $a_parent_type,
int  $a_parent_id,
string  $a_lang = "-" 
)
static

Get all pages for parent object that contain internal links.

Definition at line 2502 of file class.ilPageObject.php.

References $DIC, $q, ilDBInterface\fetchAssoc(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by ilLMPageObject\getPagesWithLinksList().

2506  : array {
2507  global $DIC;
2508 
2509  $db = $DIC->database();
2510 
2511  $and_lang = "";
2512  if ($a_lang != "") {
2513  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2514  }
2515 
2516  $q = "SELECT * FROM page_object " .
2517  " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2518  " AND parent_type = " . $db->quote($a_parent_type, "text") .
2519  " AND int_links = " . $db->quote(1, "integer") . $and_lang;
2520  $set = $db->query($q);
2521  $pages = array();
2522  while ($page = $db->fetchAssoc($set)) {
2523  $key_add = ($a_lang == "")
2524  ? ":" . $page["lang"]
2525  : "";
2526  $pages[$page["page_id"] . $key_add] = array(
2527  "date" => $page["last_change"],
2528  "id" => $page["page_id"],
2529  "lang" => $page["lang"],
2530  "user" => $page["last_change_user"]
2531  );
2532  }
2533 
2534  return $pages;
2535  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
$q
Definition: shib_logout.php:21
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParagraphForPCID()

ilPageObject::getParagraphForPCID ( string  $pcid)

Definition at line 997 of file class.ilPageObject.php.

997  : ?ilPCParagraph
998  {
999  return $this->pc_service->paragraph()->getParagraphForPCID($this, $pcid);
1000  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getParentContentObjectForPcId()

ilPageObject::getParentContentObjectForPcId ( string  $pcid)

Get parent content object for pc id.

Definition at line 736 of file class.ilPageObject.php.

References getContentObjectForPcId().

736  : ?ilPageContent
737  {
738  $content_object = $this->getContentObjectForPcId($pcid);
739  $node = $content_object->getDomNode();
740  $node = $node->parentNode;
741  while ($node) {
742  if ($node->nodeName == "PageContent") {
743  $pcid = $node->getAttribute("PCID");
744  if ($pcid != "") {
745  return $this->getContentObjectForPcId($pcid);
746  }
747  }
748  $node = $node->parentNode;
749  }
750  return null;
751  }
getContentObjectForPcId(string $pcid)
Get content object for pc id.
Content object of ilPageObject (see ILIAS DTD).
+ Here is the call graph for this function:

◆ getParentId()

◆ getParentObjectContributors()

static ilPageObject::getParentObjectContributors ( string  $a_parent_type,
int  $a_parent_id,
string  $a_lang = "-" 
)
static

Get all contributors for parent object.

Parameters
string$a_parent_typeParent Type
int$a_parent_idParent ID

Definition at line 2350 of file class.ilPageObject.php.

References Vendor\Package\$c, $DIC, ilObjUser\_lookupName(), ilObject\_lookupType(), ilDBInterface\fetchAssoc(), ilDBInterface\queryF(), and ilDBInterface\quote().

2354  : array {
2355  global $DIC;
2356 
2357  $db = $DIC->database();
2358 
2359  $and_lang = "";
2360  if ($a_lang != "") {
2361  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2362  }
2363 
2364  $contributors = array();
2365  $set = $db->queryF(
2366  "SELECT last_change_user, lang, page_id FROM page_object " .
2367  " WHERE parent_id = %s AND parent_type = %s " .
2368  " AND last_change_user != %s" . $and_lang,
2369  array("integer", "text", "integer"),
2370  array($a_parent_id, $a_parent_type, 0)
2371  );
2372 
2373  while ($page = $db->fetchAssoc($set)) {
2374  if ($a_lang == "") {
2375  $contributors[$page["last_change_user"]][$page["page_id"]][$page["lang"]] = 1;
2376  } else {
2377  $contributors[$page["last_change_user"]][$page["page_id"]] = 1;
2378  }
2379  }
2380 
2381  $set = $db->queryF(
2382  "SELECT count(*) as cnt, lang, page_id, user_id FROM page_history " .
2383  " WHERE parent_id = %s AND parent_type = %s AND user_id != %s " . $and_lang .
2384  " GROUP BY page_id, user_id, lang ",
2385  array("integer", "text", "integer"),
2386  array($a_parent_id, $a_parent_type, 0)
2387  );
2388  while ($hpage = $db->fetchAssoc($set)) {
2389  if ($a_lang == "") {
2390  $contributors[$hpage["user_id"]][$hpage["page_id"]][$hpage["lang"]] =
2391  ($contributors[$hpage["user_id"]][$hpage["page_id"]][$hpage["lang"]] ?? 0) + $hpage["cnt"];
2392  } else {
2393  $contributors[$hpage["user_id"]][$hpage["page_id"]] =
2394  ($contributors[$hpage["user_id"]][$hpage["page_id"]] ?? 0) + $hpage["cnt"];
2395  }
2396  }
2397 
2398  $c = array();
2399  foreach ($contributors as $k => $co) {
2400  if (ilObject::_lookupType($k) == "usr") {
2401  $name = ilObjUser::_lookupName($k);
2402  $c[] = array("user_id" => $k,
2403  "pages" => $co,
2404  "lastname" => $name["lastname"],
2405  "firstname" => $name["firstname"]
2406  );
2407  }
2408  }
2409 
2410  return $c;
2411  }
fetchAssoc(ilDBStatement $statement)
static _lookupName(int $a_user_id)
lookup user name
quote($value, string $type)
global $DIC
Definition: feed.php:28
queryF(string $query, array $types, array $values)
ilDBInterface $db
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ getParentType()

◆ getPCIdForHierId()

ilPageObject::getPCIdForHierId ( string  $hier_id)

Definition at line 1158 of file class.ilPageObject.php.

Referenced by PCGridTest\getCellForHierId(), PCInteractiveImageTest\getInteractiveImageInPage(), PCFileListTest\getItemForHierId(), PCListTest\getItemForHierId(), PCMediaObjectTest\getMediaObjectInPage(), PCTabsTest\getTabForHierId(), and PCTableDataTest\getTDForHierId().

1158  : string
1159  {
1160  return $this->content_id_manager->getPCIdForHierId($hier_id);
1161  }
+ Here is the caller graph for this function:

◆ getPCIdsForHierIds()

ilPageObject::getPCIdsForHierIds ( array  $hier_ids)

Get hier ids for a set of pc ids.

Definition at line 1153 of file class.ilPageObject.php.

1153  : array
1154  {
1155  return $this->content_id_manager->getPCIdsForHierIds($hier_ids);
1156  }

◆ getPCModel()

ilPageObject::getPCModel ( )

Get page component model.

Returns
array

Definition at line 2995 of file class.ilPageObject.php.

References getPageConfig().

2995  : array
2996  {
2997  $model = [];
2998  /*
2999  $this->log->debug("--- Get page model start");
3000  $model = [];
3001  foreach ($this->getAllPCIds() as $pc_id) {
3002  $co = $this->getContentObjectForPcId($pc_id);
3003  if ($co !== null) {
3004  $co_model = $co->getModel();
3005  if ($co_model !== null) {
3006  $model[$pc_id] = $co_model;
3007  }
3008  }
3009  }
3010  $this->log->debug("--- Get page model end");
3011  */
3012 
3013  $config = $this->getPageConfig();
3014  foreach ($this->pc_definition->getPCDefinitions() as $def) {
3015  $model_provider = $this->pc_definition->getPCModelProviderByName($def["name"]);
3016  if ($config->getEnablePCType($def["name"]) || $def["name"] === "PlaceHolder") {
3017  if (!is_null($model_provider)) {
3018  foreach ($model_provider->getModels(
3019  $this->dom_util,
3020  $this
3021  ) as $pc_id => $co_model) {
3022  $model[$pc_id] = $co_model;
3023  }
3024  }
3025  }
3026  }
3027  return $model;
3028  }
+ Here is the call graph for this function:

◆ getRecentChanges()

static ilPageObject::getRecentChanges ( string  $a_parent_type,
int  $a_parent_id,
int  $a_period = 30,
string  $a_lang = "" 
)
static

Get recent pages changes for parent object.

Parameters
string$a_parent_typeParent Type
int$a_parent_idParent ID
int$a_periodTime Period

Definition at line 2210 of file class.ilPageObject.php.

References $DIC, $q, ilDBInterface\fetchAssoc(), ilDBInterface\query(), ilDBInterface\quote(), and ilArrayUtil\sortArray().

2215  : array {
2216  global $DIC;
2217 
2218  $db = $DIC->database();
2219 
2220  $and_lang = "";
2221  if ($a_lang != "") {
2222  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2223  }
2224 
2225  $page_changes = array();
2226  $limit_ts = date('Y-m-d H:i:s', time() - ($a_period * 24 * 60 * 60));
2227  $q = "SELECT * FROM page_object " .
2228  " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2229  " AND parent_type = " . $db->quote($a_parent_type, "text") .
2230  " AND last_change >= " . $db->quote($limit_ts, "timestamp") . $and_lang;
2231  // " AND (TO_DAYS(now()) - TO_DAYS(last_change)) <= ".((int)$a_period);
2232  $set = $db->query($q);
2233  while ($page = $db->fetchAssoc($set)) {
2234  $page_changes[] = array(
2235  "date" => $page["last_change"],
2236  "id" => $page["page_id"],
2237  "lang" => $page["lang"],
2238  "type" => "page",
2239  "user" => $page["last_change_user"]
2240  );
2241  }
2242 
2243  $and_str = "";
2244  if ($a_period > 0) {
2245  $limit_ts = date('Y-m-d H:i:s', time() - ($a_period * 24 * 60 * 60));
2246  $and_str = " AND hdate >= " . $db->quote($limit_ts, "timestamp") . " ";
2247  }
2248 
2249  $q = "SELECT * FROM page_history " .
2250  " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2251  " AND parent_type = " . $db->quote($a_parent_type, "text") .
2252  $and_str . $and_lang;
2253  $set = $db->query($q);
2254  while ($page = $db->fetchAssoc($set)) {
2255  $page_changes[] = array(
2256  "date" => $page["hdate"],
2257  "id" => $page["page_id"],
2258  "lang" => $page["lang"],
2259  "type" => "hist",
2260  "nr" => $page["nr"],
2261  "user" => $page["user_id"]
2262  );
2263  }
2264 
2265  $page_changes = ilArrayUtil::sortArray($page_changes, "date", "desc");
2266 
2267  return $page_changes;
2268  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
$q
Definition: shib_logout.php:21
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:

◆ getRenderedContent()

ilPageObject::getRenderedContent ( )

Definition at line 234 of file class.ilPageObject.php.

References $renderedcontent.

234  : string
235  {
236  return $this->renderedcontent;
237  }

◆ getRenderedTime()

ilPageObject::getRenderedTime ( )

Definition at line 244 of file class.ilPageObject.php.

References $renderedtime.

244  : string
245  {
246  return $this->renderedtime;
247  }

◆ getRenderMd5()

ilPageObject::getRenderMd5 ( )

Definition at line 224 of file class.ilPageObject.php.

References $rendermd5.

224  : string
225  {
226  return $this->rendermd5;
227  }

◆ getRepoObjId()

ilPageObject::getRepoObjId ( )

Get object id of repository object that contains this page, return 0 if page does not belong to a repo object.

Definition at line 2986 of file class.ilPageObject.php.

References getParentId().

2986  : ?int
2987  {
2988  return $this->getParentId();
2989  }
+ Here is the call graph for this function:

◆ getShowActivationInfo()

ilPageObject::getShowActivationInfo ( )

Definition at line 274 of file class.ilPageObject.php.

References $show_page_act_info.

Referenced by createFromXML(), and update().

274  : bool
275  {
277  }
+ Here is the caller graph for this function:

◆ getXMLContent()

ilPageObject::getXMLContent ( bool  $a_incl_head = false)

get xml content of page

Definition at line 788 of file class.ilPageObject.php.

References $xml, and getIliasAbsolutePath().

Referenced by buildDom(), copyXmlContent(), createFromXML(), update(), and updateFromXML().

788  : string
789  {
790  // build full http path for XML DOCTYPE header.
791  // Under windows a relative path doesn't work :-(
792  if ($a_incl_head) {
793  //echo "+".$this->encoding."+";
794  $enc_str = (!empty($this->encoding))
795  ? "encoding=\"" . $this->encoding . "\""
796  : "";
797  return "<?xml version=\"1.0\" $enc_str ?>" .
798  "<!DOCTYPE PageObject SYSTEM \"" . $this->getIliasAbsolutePath() . "/xml/" . $this->cur_dtd . "\">" .
799  $this->xml;
800  } else {
801  return $this->xml;
802  }
803  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getXMLFromDom()

ilPageObject::getXMLFromDom ( bool  $a_incl_head = false,
bool  $a_append_mobs = false,
bool  $a_append_bib = false,
string  $a_append_str = "",
bool  $a_omit_pageobject_tag = false,
int  $style_id = 0 
)

get xml content of page from dom (use this, if any changes are made to the document)

Definition at line 850 of file class.ilPageObject.php.

References $xml, getLanguageVariablesXML(), and getMultimediaXML().

Referenced by ILIAS\COPage\ReadingTime\ReadingTimeManager\saveTime(), and update().

857  : string {
858  if ($a_incl_head) {
859  //echo "\n<br>#".$this->encoding."#";
860  return $this->dom_util->dump($this->node);
861  } else {
862  // append multimedia object elements
863  if ($a_append_mobs || $a_append_bib) {
864  $mobs = "";
865  $bibs = "";
866  if ($a_append_mobs) {
867  $mobs = $this->getMultimediaXML();
868  }
869  if ($a_append_bib) {
870  // deprecated
871  // $bibs = $this->getBibliographyXML();
872  }
873  $trans = $this->getLanguageVariablesXML($style_id);
874  //echo htmlentities($this->dom->dump_node($this->node)); exit;
875  return "<dummy>" . $this->dom_util->dump($this->node) . $mobs . $bibs . $trans . $a_append_str . "</dummy>";
876  } else {
877  if (is_object($this->dom)) {
878  if ($a_omit_pageobject_tag) {
879  $xml = "";
880  foreach ($this->node->childNodes as $child) {
881  $xml .= $this->dom_util->dump($child);
882  }
883  } else {
884  $xml = $this->dom_util->dump($this->node);
885  $xml = preg_replace('/<\?xml[^>]*>/i', "", $xml);
886  $xml = preg_replace('/<!DOCTYPE[^>]*>/i', "", $xml);
887 
888  // don't use dump_node. This gives always entities.
889  //return $this->dom->dump_node($this->node);
890  }
891  return $xml;
892  } else {
893  return "";
894  }
895  }
896  }
897  }
getLanguageVariablesXML(int $style_id=0)
Get language variables as XML.
getMultimediaXML()
get a xml string that contains all media object elements, that are referenced by any media alias in t...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleDeleteContent()

ilPageObject::handleDeleteContent ( ?DOMNode  $a_node = null,
  $move_operation = false 
)

Handle content before deletion This currently treats only plugged content If no node is given, then the whole dom will be scanned.

Parameters
DOMNode | null$a_node

Definition at line 840 of file class.ilPageObject.php.

References getDomDoc().

Referenced by delete().

840  : void
841  {
842  $pm = $this->page_manager->content($this->getDomDoc());
843  $pm->handleDeleteContent($this, $a_node, $move_operation);
844  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleRepositoryLinksOnCopy()

ilPageObject::handleRepositoryLinksOnCopy ( array  $a_mapping,
int  $a_source_ref_id 
)

Handle repository links on copy process.

Definition at line 1251 of file class.ilPageObject.php.

References $tree, buildDom(), getDomDoc(), and ILIAS\Repository\link().

1254  : void {
1255  $this->buildDom();
1256 
1257  $tree = $this->tree;
1258  $this->log->debug("Handle repository links...");
1259 
1260  $defs = $this->pc_definition->getPCDefinitions();
1261  foreach ($defs as $def) {
1262  if (method_exists($def["pc_class"], 'afterRepositoryCopy')) {
1263  call_user_func($def["pc_class"] . '::afterRepositoryCopy', $this, $a_mapping, $a_source_ref_id);
1264  }
1265  }
1266 
1267  $this->link->handleRepositoryLinksOnCopy($this->getDomDoc(), $a_mapping, $a_source_ref_id, $tree);
1268  }
buildDom(bool $a_force=false)
getDomDoc()
Get dom doc (DOMDocument)
link(string $caption, string $href, bool $new_viewport=false)
+ Here is the call graph for this function:

◆ hasDuplicatePCIds()

ilPageObject::hasDuplicatePCIds ( )

Definition at line 1984 of file class.ilPageObject.php.

Referenced by update().

1984  : bool
1985  {
1986  return $this->content_id_manager->hasDuplicatePCIds();
1987  }
+ Here is the caller graph for this function:

◆ increaseViewCnt()

ilPageObject::increaseViewCnt ( )

Increase view cnt.

Definition at line 2193 of file class.ilPageObject.php.

References $db, ilDBInterface\manipulate(), and ilDBInterface\quote().

2193  : void
2194  {
2195  $db = $this->db;
2196 
2197  $db->manipulate("UPDATE page_object " .
2198  " SET view_cnt = view_cnt + 1 " .
2199  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2200  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2201  " AND lang = " . $db->quote($this->getLanguage(), "text"));
2202  }
quote($value, string $type)
ilDBInterface $db
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:

◆ initPageConfig()

ilPageObject::initPageConfig ( )

Definition at line 179 of file class.ilPageObject.php.

References ilPageObjectFactory\getConfigInstance(), getParentType(), and setPageConfig().

Referenced by __construct().

179  : void
180  {
182  $this->setPageConfig($cfg);
183  }
setPageConfig(ilPageConfig $a_val)
static getConfigInstance(string $a_parent_type)
Get page config instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertContent()

ilPageObject::insertContent ( ilPageContent  $a_cont_obj,
string  $a_pos,
int  $a_mode = IL_INSERT_AFTER,
string  $a_pcid = "",
bool  $remove_placeholder = true 
)

insert a content node before/after a sibling or as first child of a parent

Definition at line 1888 of file class.ilPageObject.php.

References getDomDoc(), and getPageConfig().

Referenced by ilPCLauncher\create(), ilPCCurriculum\create(), ilPCLearningHistory\create(), ilPCConsultationHours\create(), ilPCMyCourses\create(), ilPCPRGActionNote\create(), ilPCPRGStatusInfo\create(), ilPCAMDPageList\create(), ilPCAMDForm\create(), ilPCParagraph\create(), ilPCMediaObject\createAlias(), and ilPCInteractiveImage\createAlias().

1894  : void {
1895  $cm = $this->page_manager->content($this->getDomDoc());
1896  $cm->insertContent(
1897  $a_cont_obj,
1898  $a_pos,
1899  $a_mode,
1900  $a_pcid,
1901  $remove_placeholder,
1902  $this->getPageConfig()->getEnablePCType("PlaceHolder")
1903  );
1904  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertContentNode()

ilPageObject::insertContentNode ( DOMNode  $a_cont_node,
string  $a_pos,
int  $a_mode = IL_INSERT_AFTER,
string  $a_pcid = "" 
)

insert a content node before/after a sibling or as first child of a parent

Definition at line 1909 of file class.ilPageObject.php.

References getDomDoc().

1914  : void {
1915  $cm = $this->page_manager->content($this->getDomDoc());
1916  $cm->insertContentNode(
1917  $a_cont_node,
1918  $a_pos,
1919  $a_mode,
1920  $a_pcid
1921  );
1922  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ insertInstIntoIDs()

ilPageObject::insertInstIntoIDs ( string  $a_inst,
bool  $a_res_ref_to_obj_id = true 
)

inserts installation id into ids (e.g.

il__pg_4 -> il_23_pg_4) this is needed for xml export of page

Parameters
string$a_instinstallation id
bool$a_res_ref_to_obj_idconvert repository links obj_<ref_id> to <type>_<obj_id>

Definition at line 1960 of file class.ilPageObject.php.

References getDomDoc().

1963  : void {
1964  $cm = $this->page_manager->content($this->getDomDoc());
1965  $cm->insertInstIntoIDs($a_inst, $a_res_ref_to_obj_id);
1966  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ insertPCIds()

ilPageObject::insertPCIds ( )

Insert Page Content IDs.

Definition at line 2006 of file class.ilPageObject.php.

Referenced by PCInteractiveImageTest\getInteractiveImageInPage(), PCMediaObjectTest\getMediaObjectInPage(), PCTabsTest\getTabForHierId(), and update().

2006  : void
2007  {
2008  $this->content_id_manager->insertPCIds();
2009  }
+ Here is the caller graph for this function:

◆ isTranslationPage()

ilPageObject::isTranslationPage ( )
protected

Definition at line 1660 of file class.ilPageObject.php.

References getLanguage().

Referenced by ilWikiPage\delete(), and delete().

1660  : bool
1661  {
1662  return !in_array($this->getLanguage(), ["", "-"]);
1663  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupParentId()

static ilPageObject::lookupParentId ( int  $a_id,
string  $a_type 
)
static

Definition at line 647 of file class.ilPageObject.php.

References $DIC, $res, ilDBInterface\fetchAssoc(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by ilLMContentRendererGUI\determineStatus(), ilObjMediaObject\getParentObjectIdForUsage(), and ilLMPageGUI\processAnswer().

647  : int
648  {
649  global $DIC;
650 
651  $db = $DIC->database();
652 
653  $res = $db->query("SELECT parent_id FROM page_object WHERE page_id = " . $db->quote($a_id, "integer") . " " .
654  "AND parent_type=" . $db->quote($a_type, "text"));
655  $rec = $db->fetchAssoc($res);
656  return (int) ($rec["parent_id"] ?? 0);
657  }
$res
Definition: ltiservices.php:69
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupTranslations()

static ilPageObject::lookupTranslations ( string  $a_parent_type,
int  $a_id 
)
static

Lookup translations.

Definition at line 2652 of file class.ilPageObject.php.

References $DIC, ilDBInterface\fetchAssoc(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by ilObjContentPage\doCloneObject(), ilContentPageImporter\finalProcessing(), ilLearningModuleExporter\getXmlRepresentation(), ilCOPageExporter\getXmlRepresentation(), ilObjForum\update(), and ilLMObject\updateInternalLinks().

2655  : array {
2656  global $DIC;
2657 
2658  $db = $DIC->database();
2659 
2660  $set = $db->query(
2661  "SELECT lang FROM page_object " .
2662  " WHERE page_id = " . $db->quote($a_id, "integer") .
2663  " AND parent_type = " . $db->quote($a_parent_type, "text")
2664  );
2665  $langs = array();
2666  while ($rec = $db->fetchAssoc($set)) {
2667  $langs[] = $rec["lang"];
2668  }
2669  return $langs;
2670  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveContentAfter()

ilPageObject::moveContentAfter ( string  $a_source,
string  $a_target,
string  $a_spcid = "",
string  $a_tpcid = "" 
)

move content object from position $a_source before position $a_target (both hierarchical content ids)

Parameters
string$a_source
string$a_target
string$a_spcid
string$a_tpcid
Returns
array|bool
Exceptions
ilCOPagePCEditException
ilCOPageUnknownPCTypeException
ilDateTimeException

Definition at line 1937 of file class.ilPageObject.php.

References getDomDoc(), and update().

1942  {
1943  $cm = $this->page_manager->content($this->getDomDoc());
1944  $cm->moveContentAfter(
1945  $this,
1946  $a_source,
1947  $a_target,
1948  $a_spcid,
1949  $a_tpcid
1950  );
1951  return $this->update();
1952  }
update(bool $a_validate=true, bool $a_no_history=false)
update complete page content in db (dom xml content is used)
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ moveIntLinks()

ilPageObject::moveIntLinks ( array  $a_from_to)

Move internal links from one destination to another.

This is used for pages and structure links. Just use IDs in "from" and "to".

Definition at line 1237 of file class.ilPageObject.php.

References addHierIDs(), buildDom(), getDomDoc(), and ILIAS\Repository\link().

1237  : bool
1238  {
1239  $this->buildDom();
1240  $this->addHierIDs();
1241  return $this->link->moveIntLinks(
1242  $this->getDomDoc(),
1243  $a_from_to
1244  );
1245  }
buildDom(bool $a_force=false)
getDomDoc()
Get dom doc (DOMDocument)
addHierIDs()
Add hierarchical ID (e.g.
link(string $caption, string $href, bool $new_viewport=false)
+ Here is the call graph for this function:

◆ needsImportParsing()

ilPageObject::needsImportParsing ( ?bool  $a_parse = null)

Definition at line 1035 of file class.ilPageObject.php.

References $needs_parsing.

1035  : bool
1036  {
1037  if ($a_parse === true) {
1038  $this->needs_parsing = true;
1039  }
1040  if ($a_parse === false) {
1041  $this->needs_parsing = false;
1042  }
1043  return $this->needs_parsing;
1044  }

◆ pasteContents()

ilPageObject::pasteContents ( string  $a_hier_id,
bool  $a_self_ass = false 
)

Paste contents from pc clipboard.

Returns
array|bool
Exceptions
ilDateTimeException

Definition at line 1850 of file class.ilPageObject.php.

References $user, getDomDoc(), and update().

1853  {
1854  $user = $this->user;
1855  $cm = $this->page_manager->content($this->getDomDoc());
1856  $cm->pasteContents(
1857  $user,
1858  $a_hier_id,
1859  $this,
1860  $a_self_ass
1861  );
1862  return $this->update();
1863  }
update(bool $a_validate=true, bool $a_no_history=false)
update complete page content in db (dom xml content is used)
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ performAutomaticModifications()

ilPageObject::performAutomaticModifications ( )

Perform automatic modifications (may be overwritten by sub classes)

Definition at line 2551 of file class.ilPageObject.php.

Referenced by update().

2551  : void
2552  {
2553  }
+ Here is the caller graph for this function:

◆ preloadActivationDataByParentId()

static ilPageObject::preloadActivationDataByParentId ( int  $a_parent_id)
static

Preload activation data by Parent Id.

Definition at line 487 of file class.ilPageObject.php.

References $DIC, ilDBInterface\fetchAssoc(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by ilLMExplorerGUI\__construct().

487  : void
488  {
489  global $DIC;
490 
491  $db = $DIC->database();
492  $set = $db->query(
493  "SELECT page_id, parent_type, lang, active, activation_start, activation_end, show_activation_info FROM page_object " .
494  " WHERE parent_id = " . $db->quote($a_parent_id, "integer")
495  );
496  while ($rec = $db->fetchAssoc($set)) {
497  self::$activation_data[$rec["page_id"] . ":" . $rec["parent_type"] . ":" . $rec["lang"]] = $rec;
498  }
499  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: feed.php:28
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preparePageForCompare()

ilPageObject::preparePageForCompare ( ilPageObject  $page)

Definition at line 2186 of file class.ilPageObject.php.

Referenced by ILIAS\COPage\Compare\PageCompare\compare().

2186  : void
2187  {
2188  }
+ Here is the caller graph for this function:

◆ read()

ilPageObject::read ( )

Read page data.

Definition at line 287 of file class.ilPageObject.php.

References getLanguage(), getParentType(), ILIAS\Repository\int(), setActivationEnd(), setActivationStart(), setActive(), setLastChange(), setParentId(), setRenderedContent(), setRenderedTime(), setRenderMd5(), and setShowActivationInfo().

Referenced by __construct(), and ilWikiPage\createFromXML().

287  : void
288  {
289  $this->setActive(true);
290  if ($this->old_nr == 0) {
291  $query = "SELECT * FROM page_object" .
292  " WHERE page_id = " . $this->db->quote($this->id, "integer") .
293  " AND parent_type=" . $this->db->quote($this->getParentType(), "text") .
294  " AND lang = " . $this->db->quote($this->getLanguage(), "text");
295  $pg_set = $this->db->query($query);
296  if (!$this->page_record = $this->db->fetchAssoc($pg_set)) {
297  throw new ilCOPageNotFoundException("Error: Page " . $this->id . " is not in database" .
298  " (parent type " . $this->getParentType() . ", lang: " . $this->getLanguage() . ").");
299  }
300  $this->setActive($this->page_record["active"]);
301  $this->setActivationStart($this->page_record["activation_start"]);
302  $this->setActivationEnd($this->page_record["activation_end"]);
303  $this->setShowActivationInfo($this->page_record["show_activation_info"]);
304  } else {
305  $query = "SELECT * FROM page_history" .
306  " WHERE page_id = " . $this->db->quote($this->id, "integer") .
307  " AND parent_type=" . $this->db->quote($this->getParentType(), "text") .
308  " AND nr = " . $this->db->quote($this->old_nr, "integer") .
309  " AND lang = " . $this->db->quote($this->getLanguage(), "text");
310  $pg_set = $this->db->query($query);
311  $this->page_record = $this->db->fetchAssoc($pg_set);
312  }
313  if (!$this->page_record) {
314  throw new ilCOPageNotFoundException("Error: Page " . $this->id . " is not in database" .
315  " (parent type " . $this->getParentType() . ", lang: " . $this->getLanguage() . ").");
316  }
317  $this->xml = $this->page_record["content"];
318  $this->setParentId((int) $this->page_record["parent_id"]);
319  $this->last_change_user = (int) ($this->page_record["last_change_user"] ?? 0);
320  $this->create_user = (int) ($this->page_record["create_user"] ?? 0);
321  $this->setRenderedContent((string) ($this->page_record["rendered_content"] ?? ""));
322  $this->setRenderMd5((string) ($this->page_record["render_md5"] ?? ""));
323  $this->setRenderedTime((string) ($this->page_record["rendered_time"] ?? ""));
324  $this->setLastChange((string) ($this->page_record["last_change"] ?? ""));
325  }
setRenderedContent(string $a_renderedcontent)
setParentId(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setActivationStart(?string $a_activationstart)
setActivationEnd(?string $a_activationend)
Set Activation End.
setLastChange(string $a_lastchange)
setActive(bool $a_active)
setRenderMd5(string $a_rendermd5)
setShowActivationInfo(bool $a_val)
setRenderedTime(string $a_renderedtime)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerOfflineHandler()

ilPageObject::registerOfflineHandler ( object  $handler)

Definition at line 2022 of file class.ilPageObject.php.

References $handler.

2022  : void
2023  {
2024  $this->offline_handler = $handler;
2025  }
$handler
Definition: index.php:18

◆ releasePageLock()

ilPageObject::releasePageLock ( )

Release page lock.

Definition at line 2742 of file class.ilPageObject.php.

References $db, $user, ilDBInterface\fetchAssoc(), ilObject\getId(), ILIAS\Repository\int(), ilDBInterface\manipulate(), ilDBInterface\query(), and ilDBInterface\quote().

2742  : bool
2743  {
2744  $db = $this->db;
2745  $user = $this->user;
2746  $aset = new ilSetting("adve");
2747 
2748  $min = (int) $aset->get("block_mode_minutes");
2749  if ($min > 0) {
2750  // try to set the lock for the user
2751  $ts = time();
2752  $db->manipulate(
2753  "UPDATE page_object SET " .
2754  " edit_lock_user = " . $db->quote($user->getId(), "integer") . "," .
2755  " edit_lock_ts = 0" .
2756  " WHERE edit_lock_user = " . $db->quote($user->getId(), "integer") .
2757  " AND page_id = " . $db->quote($this->getId(), "integer") .
2758  " AND parent_type = " . $db->quote($this->getParentType(), "text")
2759  );
2760 
2761  $set = $db->query(
2762  "SELECT edit_lock_user FROM page_object " .
2763  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2764  " AND parent_type = " . $db->quote($this->getParentType(), "text")
2765  );
2766  $rec = $db->fetchAssoc($set);
2767  if ($rec["edit_lock_user"] != $user->getId()) {
2768  return false;
2769  }
2770  }
2771 
2772  return true;
2773  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:

◆ resolveFileItems()

ilPageObject::resolveFileItems ( array  $a_mapping)

Resolve file items (after import)

Definition at line 1211 of file class.ilPageObject.php.

References getDomDoc().

1211  : bool
1212  {
1213  return $this->pc_service->fileList()->resolveFileItems(
1214  $this->getDomDoc(),
1215  $a_mapping
1216  );
1217  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ resolveIIMMediaAliases()

ilPageObject::resolveIIMMediaAliases ( array  $a_mapping)

Resolve iim media aliases (in ilContObjParse)

Definition at line 1199 of file class.ilPageObject.php.

References getDomDoc().

1199  : bool
1200  {
1201  return $this->pc_service->interactiveImage()->resolveIIMMediaAliases(
1202  $this->getDomDoc(),
1203  $a_mapping
1204  );
1205  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ resolveIntLinks()

ilPageObject::resolveIntLinks ( array  $a_link_map = null)

Resolves all internal link targets of the page, if targets are available (after import)

Definition at line 1175 of file class.ilPageObject.php.

References getDomDoc(), and ILIAS\Repository\link().

Referenced by ilQuestionPageParser\processPagesToParse().

1175  : bool
1176  {
1177  return $this->link->resolveIntLinks($this->getDomDoc(), $a_link_map);
1178  }
getDomDoc()
Get dom doc (DOMDocument)
link(string $caption, string $href, bool $new_viewport=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveMediaAliases()

ilPageObject::resolveMediaAliases ( array  $a_mapping,
bool  $a_reuse_existing_by_import = false 
)

Resolve media aliases (after import)

Definition at line 1184 of file class.ilPageObject.php.

1187  : bool {
1188  return $this->pc_service->mediaObject()->resolveMediaAliases(
1189  $this,
1190  $a_mapping,
1191  $a_reuse_existing_by_import
1192  );
1193  }

◆ resolveQuestionReferences()

ilPageObject::resolveQuestionReferences ( array  $a_mapping)

Resolve all quesiont references (after import)

Definition at line 1223 of file class.ilPageObject.php.

References getDomDoc().

1223  : bool
1224  {
1225  $qm = $this->pc_service->question();
1226  return $qm->resolveQuestionReferences(
1227  $this->getDomDoc(),
1228  $a_mapping
1229  );
1230  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ resolveResources()

ilPageObject::resolveResources ( array  $ref_mapping)

Resolve resources.

Todo:
: move this into proper "afterImport" routine that calls all PC components

Definition at line 2978 of file class.ilPageObject.php.

References ilPCResources\resolveResources().

2978  : bool
2979  {
2980  return ilPCResources::resolveResources($this, $ref_mapping);
2981  }
static resolveResources(ilPageObject $page, array $ref_mappings)
+ Here is the call graph for this function:

◆ saveInitialOpenedContent()

ilPageObject::saveInitialOpenedContent ( string  $a_type,
int  $a_id,
string  $a_target 
)

Save initial opened content.

Definition at line 2564 of file class.ilPageObject.php.

References getContentManager(), and update().

2568  : void {
2569  $cm = $this->getContentManager();
2570  $cm->setInitialOpenedContent($a_type, $a_id, $a_target);
2571  $this->update();
2572  }
update(bool $a_validate=true, bool $a_no_history=false)
update complete page content in db (dom xml content is used)
+ Here is the call graph for this function:

◆ saveInternalLinks()

ilPageObject::saveInternalLinks ( DOMDocument  $a_domdoc)

save internal links of page

Todo:
: move to specific classes, internal link use info

Definition at line 1763 of file class.ilPageObject.php.

References ILIAS\Repository\link().

Referenced by __afterUpdate().

1763  : void
1764  {
1765  $this->link->saveInternalLinks(
1766  $this,
1767  $a_domdoc
1768  );
1769  }
link(string $caption, string $href, bool $new_viewport=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStyleUsage()

ilPageObject::saveStyleUsage ( DOMDocument  $a_domdoc,
int  $a_old_nr = 0 
)

Save all style class/template usages.

Definition at line 1712 of file class.ilPageObject.php.

Referenced by __afterHistoryEntry(), and __afterUpdate().

1715  : void {
1716  $this->style_manager->saveStyleUsage(
1717  $this,
1718  $a_domdoc,
1719  $a_old_nr
1720  );
1721  }
+ Here is the caller graph for this function:

◆ sendParagraph()

ilPageObject::sendParagraph ( string  $par_id,
string  $filename 
)

Definition at line 2011 of file class.ilPageObject.php.

References getDomDoc().

Referenced by ilObjQuestionPoolGUI\download_paragraphObject(), and ilObjTestGUI\download_paragraphObject().

2014  : void {
2015  $this->pc_service->paragraph()->send(
2016  $this->getDomDoc(),
2017  $par_id,
2018  $filename
2019  );
2020  }
getDomDoc()
Get dom doc (DOMDocument)
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActivationEnd()

ilPageObject::setActivationEnd ( ?string  $a_activationend)

Set Activation End.

Parameters
string$a_activationendIL_CAL_DATETIME format

Definition at line 692 of file class.ilPageObject.php.

Referenced by read().

692  : void
693  {
694  if ($a_activationend == "") {
695  $a_activationend = null;
696  }
697  $this->activationend = $a_activationend;
698  }
+ Here is the caller graph for this function:

◆ setActivationStart()

ilPageObject::setActivationStart ( ?string  $a_activationstart)
Parameters
string$a_activationstartIL_CAL_DATETIME format

Definition at line 675 of file class.ilPageObject.php.

Referenced by read().

675  : void
676  {
677  if ($a_activationstart == "") {
678  $a_activationstart = null;
679  }
680  $this->activationstart = $a_activationstart;
681  }
+ Here is the caller graph for this function:

◆ setActive()

ilPageObject::setActive ( bool  $a_active)

Definition at line 465 of file class.ilPageObject.php.

Referenced by __construct(), read(), and ilBlogPosting\unpublish().

465  : void
466  {
467  $this->active = $a_active;
468  }
+ Here is the caller graph for this function:

◆ setConcreteLang()

ilPageObject::setConcreteLang ( string  $a_val)

Definition at line 204 of file class.ilPageObject.php.

205  {
206  $this->concrete_lang = $a_val;
207  }

◆ setContainsIntLink()

ilPageObject::setContainsIntLink ( bool  $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) todo: move to ilLMPageObject !?

Parameters
bool$a_contains_linktrue, if page contains intern link tag(s)

Definition at line 1010 of file class.ilPageObject.php.

1010  : void
1011  {
1012  $this->contains_int_link = $a_contains_link;
1013  }

◆ setContainsQuestion()

ilPageObject::setContainsQuestion ( bool  $a_val)

Definition at line 1047 of file class.ilPageObject.php.

1047  : void
1048  {
1049  $this->contains_question = $a_val;
1050  }

◆ setContentIdManager()

ilPageObject::setContentIdManager ( \ILIAS\COPage\ID\ContentIdManager  $content_id_manager)

Definition at line 167 of file class.ilPageObject.php.

References $content_id_manager.

169  : void {
170  $this->content_id_manager = $content_id_manager;
171  }
ILIAS COPage ID ContentIdManager $content_id_manager

◆ setCopyProperties()

ilPageObject::setCopyProperties ( ilPageObject  $new_page)
protected

Definition at line 2644 of file class.ilPageObject.php.

Referenced by copy().

2644  : void
2645  {
2646  }
+ Here is the caller graph for this function:

◆ setEmptyPageXml()

ilPageObject::setEmptyPageXml ( )

Definition at line 1270 of file class.ilPageObject.php.

References setXMLContent().

Referenced by createFromXML().

1270  : void
1271  {
1272  $this->setXMLContent("<PageObject></PageObject>");
1273  }
setXMLContent(string $a_xml, string $a_encoding="UTF-8")
set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setId()

ilPageObject::setId ( int  $a_id)

Definition at line 420 of file class.ilPageObject.php.

Referenced by ilBlogPosting\create(), ilPortfolioPage\create(), ilWikiPage\create(), and ilTestPage\createPageWithNextId().

420  : void
421  {
422  $this->id = $a_id;
423  }
+ Here is the caller graph for this function:

◆ setImportMode()

ilPageObject::setImportMode ( bool  $a_val)

Definition at line 1025 of file class.ilPageObject.php.

1025  : void
1026  {
1027  $this->import_mode = $a_val;
1028  }

◆ setLanguage()

ilPageObject::setLanguage ( string  $a_val)

Set language.

Parameters
string$a_vallanguage code or "-" for unknown / not set

Definition at line 189 of file class.ilPageObject.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by __construct(), and ilPCParagraph\insert().

189  : void
190  {
191  $this->language = $a_val;
192  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLastChange()

ilPageObject::setLastChange ( string  $a_lastchange)

Definition at line 249 of file class.ilPageObject.php.

Referenced by read().

249  : void
250  {
251  $this->lastchange = $a_lastchange;
252  }
+ Here is the caller graph for this function:

◆ setLastChangeUser()

ilPageObject::setLastChangeUser ( int  $a_val)

Definition at line 259 of file class.ilPageObject.php.

259  : void
260  {
261  $this->last_change_user = $a_val;
262  }

◆ setPageConfig()

ilPageObject::setPageConfig ( ilPageConfig  $a_val)

Definition at line 199 of file class.ilPageObject.php.

Referenced by ilUnitTestPageObject\initPageConfig(), and initPageConfig().

199  : void
200  {
201  $this->page_config = $a_val;
202  }
+ Here is the caller graph for this function:

◆ setParentId()

ilPageObject::setParentId ( int  $a_id)

Definition at line 430 of file class.ilPageObject.php.

Referenced by read(), ilBlogPosting\setBlogId(), and ilWikiPage\setWikiId().

430  : void
431  {
432  $this->parent_id = $a_id;
433  }
+ Here is the caller graph for this function:

◆ setRenderedContent()

ilPageObject::setRenderedContent ( string  $a_renderedcontent)

Definition at line 229 of file class.ilPageObject.php.

Referenced by read().

229  : void
230  {
231  $this->renderedcontent = $a_renderedcontent;
232  }
+ Here is the caller graph for this function:

◆ setRenderedTime()

ilPageObject::setRenderedTime ( string  $a_renderedtime)

Definition at line 239 of file class.ilPageObject.php.

Referenced by read().

239  : void
240  {
241  $this->renderedtime = $a_renderedtime;
242  }
+ Here is the caller graph for this function:

◆ setRenderMd5()

ilPageObject::setRenderMd5 ( string  $a_rendermd5)

Definition at line 219 of file class.ilPageObject.php.

Referenced by read().

219  : void
220  {
221  $this->rendermd5 = $a_rendermd5;
222  }
+ Here is the caller graph for this function:

◆ setShowActivationInfo()

ilPageObject::setShowActivationInfo ( bool  $a_val)

Definition at line 269 of file class.ilPageObject.php.

Referenced by read().

269  : void
270  {
271  $this->show_page_act_info = $a_val;
272  }
+ Here is the caller graph for this function:

◆ setTranslationProperties()

ilPageObject::setTranslationProperties ( self  $transl_page)
protected

Definition at line 2688 of file class.ilPageObject.php.

References copyXmlContent(), getActivationEnd(), getActivationStart(), getActive(), getId(), and getParentId().

Referenced by copyPageToTranslation().

2688  : void
2689  {
2690  $transl_page->setId($this->getId());
2691  $transl_page->setParentId($this->getParentId());
2692  $transl_page->setXMLContent($this->copyXmlContent());
2693  $transl_page->setActive($this->getActive());
2694  $transl_page->setActivationStart($this->getActivationStart());
2695  $transl_page->setActivationEnd($this->getActivationEnd());
2696  }
getActive(bool $a_check_scheduled_activation=false)
copyXmlContent(bool $a_clone_mobs=false, int $a_new_parent_id=0, int $obj_copy_id=0, bool $self_ass=true)
Copy content of page; replace page components with copies where necessary (e.g.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setXMLContent()

ilPageObject::setXMLContent ( string  $a_xml,
string  $a_encoding = "UTF-8" 
)

set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD, omit MetaData, use utf-8!

Parameters
string$a_encodingencoding of the content (here is no conversion done! it must be already utf-8 encoded at the time)

Definition at line 770 of file class.ilPageObject.php.

Referenced by buildDom(), and setEmptyPageXml().

770  : void
771  {
772  $this->encoding = $a_encoding;
773  $this->xml = $a_xml;
774  }
+ Here is the caller graph for this function:

◆ stripHierIDs()

ilPageObject::stripHierIDs ( )

Definition at line 1127 of file class.ilPageObject.php.

Referenced by ilPCParagraph\getLastSavedPCId(), and validateDom().

1127  : void
1128  {
1129  $this->content_id_manager->stripHierIDsFromDom();
1130  }
+ Here is the caller graph for this function:

◆ stripPCIDs()

ilPageObject::stripPCIDs ( )

Definition at line 1132 of file class.ilPageObject.php.

1132  : void
1133  {
1134  $this->content_id_manager->stripPCIDs();
1135  }

◆ switchEnableMultiple()

ilPageObject::switchEnableMultiple ( array  $a_hids,
bool  $a_update = true,
bool  $a_self_ass = false 
)

(De-)activate elements

Returns
array|bool
Exceptions
ilCOPageUnknownPCTypeException
ilDateTimeException
ilWACException

Definition at line 1872 of file class.ilPageObject.php.

References getDomDoc(), and update().

1876  {
1877  $cm = $this->page_manager->content($this->getDomDoc());
1878  $cm->switchEnableMultiple($this, $a_hids, $a_self_ass);
1879  if ($a_update) {
1880  return $this->update();
1881  }
1882  return true;
1883  }
update(bool $a_validate=true, bool $a_no_history=false)
update complete page content in db (dom xml content is used)
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:

◆ truncateHTML()

static ilPageObject::truncateHTML ( string  $a_text,
int  $a_length = 100,
string  $a_ending = '...',
bool  $a_exact = false,
bool  $a_consider_html = true 
)
static

Truncate (html) string.

See also
http://dodona.wordpress.com/2009/04/05/how-do-i-truncate-an-html-string-without-breaking-the-html-code/

Definition at line 2800 of file class.ilPageObject.php.

References ilStr\shortenText().

Referenced by ilLearningModuleNotification\getPreviewText(), ilBlogPostingGUI\getSnippet(), ILIAS\Wiki\Notification\NotificationGUI\send(), and ilWikiUtil\sendNotification().

2806  : string {
2807  $open_tags = [];
2808  if ($a_consider_html) {
2809  // if the plain text is shorter than the maximum length, return the whole text
2810  if (strlen(preg_replace('/<.*?>/', '', $a_text)) <= $a_length) {
2811  return $a_text;
2812  }
2813 
2814  // splits all html-tags to scanable lines
2815  $total_length = strlen($a_ending);
2816  $open_tags = array();
2817  $truncate = '';
2818  preg_match_all('/(<.+?>)?([^<>]*)/s', $a_text, $lines, PREG_SET_ORDER);
2819  foreach ($lines as $line_matchings) {
2820  // if there is any html-tag in this line, handle it and add it (uncounted) to the output
2821  if (!empty($line_matchings[1])) {
2822  // if it's an "empty element" with or without xhtml-conform closing slash
2823  if (preg_match(
2824  '/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is',
2825  $line_matchings[1]
2826  )) {
2827  // do nothing
2828  } // if tag is a closing tag
2829  elseif (preg_match('/^<\s*\/([^\s]+?)\s*>$/s', $line_matchings[1], $tag_matchings)) {
2830  // delete tag from $open_tags list
2831  $pos = array_search($tag_matchings[1], $open_tags);
2832  if ($pos !== false) {
2833  unset($open_tags[$pos]);
2834  }
2835  } // if tag is an opening tag
2836  elseif (preg_match('/^<\s*([^\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {
2837  // add tag to the beginning of $open_tags list
2838  array_unshift($open_tags, strtolower($tag_matchings[1]));
2839  }
2840  // add html-tag to $truncate'd text
2841  $truncate .= $line_matchings[1];
2842  }
2843 
2844  // calculate the length of the plain text part of the line; handle entities as one character
2845  $content_length = strlen(preg_replace(
2846  '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i',
2847  ' ',
2848  $line_matchings[2]
2849  ));
2850  if ($total_length + $content_length > $a_length) {
2851  // the number of characters which are left
2852  $left = $a_length - $total_length;
2853  $entities_length = 0;
2854  // search for html entities
2855  if (preg_match_all(
2856  '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i',
2857  $line_matchings[2],
2858  $entities,
2859  PREG_OFFSET_CAPTURE
2860  )) {
2861  // calculate the real length of all entities in the legal range
2862  foreach ($entities[0] as $entity) {
2863  if ($entity[1] + 1 - $entities_length <= $left) {
2864  $left--;
2865  $entities_length += strlen($entity[0]);
2866  } else {
2867  // no more characters left
2868  break;
2869  }
2870  }
2871  }
2872 
2873  // $truncate .= substr($line_matchings[2], 0, $left+$entities_length);
2874  $truncate .= ilStr::shortenText($line_matchings[2], 0, $left + $entities_length);
2875 
2876  // maximum lenght is reached, so get off the loop
2877  break;
2878  } else {
2879  $truncate .= $line_matchings[2];
2880  $total_length += $content_length;
2881  }
2882 
2883  // if the maximum length is reached, get off the loop
2884  if ($total_length >= $a_length) {
2885  break;
2886  }
2887  }
2888  } else {
2889  if (strlen($a_text) <= $a_length) {
2890  return $a_text;
2891  } else {
2892  // $truncate = substr($a_text, 0, $a_length - strlen($a_ending));
2893  $truncate = ilStr::shortenText($a_text, 0, $a_length - strlen($a_ending));
2894  }
2895  }
2896 
2897  // THIS IS BUGGY AS IT MIGHT BREAK AN OPEN TAG AT THE END
2898  if (!count($open_tags)) {
2899  // if the words shouldn't be cut in the middle...
2900  if (!$a_exact) {
2901  // ...search the last occurance of a space...
2902  $spacepos = strrpos($truncate, ' ');
2903  if ($spacepos !== false) {
2904  // ...and cut the text in this position
2905  // $truncate = substr($truncate, 0, $spacepos);
2906  $truncate = ilStr::shortenText($truncate, 0, $spacepos);
2907  }
2908  }
2909  }
2910 
2911  // add the defined ending to the text
2912  $truncate .= $a_ending;
2913 
2914  if ($a_consider_html) {
2915  // close all unclosed html-tags
2916  foreach ($open_tags as $tag) {
2917  $truncate .= '</' . $tag . '>';
2918  }
2919  }
2920 
2921  return $truncate;
2922  }
static shortenText(string $a_string, int $a_start_pos, int $a_num_bytes, string $a_encoding='UTF-8')
Shorten text to the given number of bytes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilPageObject::update ( bool  $a_validate = true,
bool  $a_no_history = false 
)

update complete page content in db (dom xml content is used)

Returns
array|bool
Exceptions
ilDateTimeException
ilWACException

Definition at line 1414 of file class.ilPageObject.php.

References $lm_set, __afterHistoryEntry(), __afterUpdate(), checkPCIds(), containsDeactivatedElements(), containsIntLinks(), ilDatePresentation\formatDate(), getActivationEnd(), getActivationStart(), getActive(), getDomDoc(), getDuplicatePCIds(), getEditLock(), getEditLockInfo(), getId(), getLanguage(), ilUserUtil\getNamePresentation(), getParentId(), getParentType(), getShowActivationInfo(), getXMLContent(), getXMLFromDom(), hasDuplicatePCIds(), IL_CAL_UNIX, ILIAS_VERSION_NUMERIC, insertPCIds(), ILIAS\Repository\lng(), ilUtil\now(), performAutomaticModifications(), ILIAS\Repository\user(), and validateDom().

Referenced by ilContainerPage\addRepositoryBlockToPage(), assignCharacteristic(), ilPCParagraph\autoLinkGlossariesPage(), deleteContent(), deleteContents(), moveContentAfter(), pasteContents(), ilQuestionPageParser\processPagesToParse(), ilContainerPage\removeUnsupportedBlockIds(), saveInitialOpenedContent(), switchEnableMultiple(), and ilPCParagraph\updatePage().

1415  {
1416  $this->log->debug("start..., id: " . $this->getId());
1417  $lm_set = new ilSetting("lm");
1418 
1419  // add missing pc ids
1420  if (!$this->checkPCIds()) {
1421  $this->insertPCIds();
1422  }
1423 
1424  // test validating
1425  if ($a_validate) {
1426  $this->log->debug($this->dom_util->dump($this->getDomDoc()->documentElement));
1427  $errors = $this->validateDom();
1428  }
1429  //var_dump($errors); exit;
1430  if (empty($errors) && !$this->getEditLock()) {
1431  $lock = $this->getEditLockInfo();
1432  $errors[0] = array(0 => 0,
1433  1 => $this->lng->txt("cont_not_saved_edit_lock_expired") . "<br />" .
1434  $this->lng->txt("obj_usr") . ": " .
1435  ilUserUtil::getNamePresentation($lock["edit_lock_user"]) . "<br />" .
1436  $this->lng->txt("content_until") . ": " .
1437  ilDatePresentation::formatDate(new ilDateTime($lock["edit_lock_until"], IL_CAL_UNIX))
1438  );
1439  }
1440 
1441  // check for duplicate pc ids
1442  $this->log->debug("checking duplicate ids");
1443  if ($this->hasDuplicatePCIds()) {
1444  $errors[0] = $this->lng->txt("cont_could_not_save_duplicate_pc_ids") .
1445  " (" . implode(", ", $this->getDuplicatePCIds()) . ")";
1446  }
1447 
1448  if (!empty($errors)) {
1449  $this->log->debug("ilPageObject, update(): errors: " . print_r($errors, true));
1450  }
1451 
1452  //echo "-".htmlentities($this->getXMLFromDom())."-"; exit;
1453  if (empty($errors)) {
1454  // @todo 1: is this page type or pc content type
1455  // related -> plugins should be able to hook in!?
1456 
1457  $this->log->debug("perform automatic modifications");
1459 
1460  // get xml content
1461  $content = $this->getXMLFromDom();
1462  $dom_doc = $this->getDomDoc();
1463 
1464  // this needs to be locked
1465 
1466  // write history entry
1467  $old_set = $this->db->query("SELECT * FROM page_object WHERE " .
1468  "page_id = " . $this->db->quote($this->getId(), "integer") . " AND " .
1469  "parent_type = " . $this->db->quote($this->getParentType(), "text") . " AND " .
1470  "lang = " . $this->db->quote($this->getLanguage(), "text"));
1471  $last_nr_set = $this->db->query("SELECT max(nr) as mnr FROM page_history WHERE " .
1472  "page_id = " . $this->db->quote($this->getId(), "integer") . " AND " .
1473  "parent_type = " . $this->db->quote($this->getParentType(), "text") . " AND " .
1474  "lang = " . $this->db->quote($this->getLanguage(), "text"));
1475  $last_nr = $this->db->fetchAssoc($last_nr_set);
1476  if ($old_rec = $this->db->fetchAssoc($old_set)) {
1477  // only save, if something has changed
1478  // added user id to the check for ilias 5.0, 7.10.2014
1479  if (($content != $old_rec["content"] || $this->user->getId() != $old_rec["last_change_user"]) &&
1480  !$a_no_history && !$this->history_saved && $lm_set->get("page_history", 1)) {
1481  if ($old_rec["content"] != "<PageObject></PageObject>") {
1482  $this->db->manipulateF(
1483  "DELETE FROM page_history WHERE " .
1484  "page_id = %s AND parent_type = %s AND hdate = %s AND lang = %s",
1485  array("integer", "text", "timestamp", "text"),
1486  array($old_rec["page_id"],
1487  $old_rec["parent_type"],
1488  $old_rec["last_change"],
1489  $old_rec["lang"]
1490  )
1491  );
1492 
1493  // the following lines are a workaround for
1494  // bug 6741
1495  $last_c = $old_rec["last_change"];
1496  if ($last_c == "") {
1497  $last_c = ilUtil::now();
1498  }
1499 
1500  $this->db->insert("page_history", array(
1501  "page_id" => array("integer", $old_rec["page_id"]),
1502  "parent_type" => array("text", $old_rec["parent_type"]),
1503  "lang" => array("text", $old_rec["lang"]),
1504  "hdate" => array("timestamp", $last_c),
1505  "parent_id" => array("integer", $old_rec["parent_id"]),
1506  "content" => array("clob", $old_rec["content"]),
1507  "user_id" => array("integer", $old_rec["last_change_user"]),
1508  "ilias_version" => array("text", ILIAS_VERSION_NUMERIC),
1509  "nr" => array("integer", (int) $last_nr["mnr"] + 1)
1510  ));
1511 
1512  $old_content = $old_rec["content"];
1513  $old_domdoc = new DOMDocument();
1514  $old_nr = $last_nr["mnr"] + 1;
1515  $old_domdoc->loadXML('<?xml version="1.0" encoding="UTF-8"?>' . $old_content);
1516 
1517  // after history entry creation event
1518  $this->log->debug("calling __afterHistoryEntry");
1519  $this->__afterHistoryEntry($old_domdoc, $old_content, $old_nr);
1520 
1521  // only save one time
1522  }
1523  $this->history_saved = true;
1524  }
1525  }
1526  //echo htmlentities($content);
1527  $em = (trim($content) == "<PageObject/>")
1528  ? 1
1529  : 0;
1530 
1531  // @todo: pass dom instead?
1532  $this->log->debug("checking deactivated elements");
1533  $iel = $this->containsDeactivatedElements($content);
1534  $this->log->debug("checking internal links");
1535  $inl = $this->containsIntLinks($content);
1536 
1537  $now = ilUtil::now();
1538  $this->lastchange = $now;
1539  $this->db->update("page_object", array(
1540  "content" => array("clob", $content),
1541  "parent_id" => array("integer", $this->getParentId()),
1542  "last_change_user" => array("integer", $this->user->getId()),
1543  "last_change" => array("timestamp", $now),
1544  "is_empty" => array("integer", $em),
1545  "active" => array("integer", $this->getActive()),
1546  "activation_start" => array("timestamp", $this->getActivationStart()),
1547  "activation_end" => array("timestamp", $this->getActivationEnd()),
1548  "show_activation_info" => array("integer", $this->getShowActivationInfo()),
1549  "inactive_elements" => array("integer", $iel),
1550  "int_links" => array("integer", $inl),
1551  ), array(
1552  "page_id" => array("integer", $this->getId()),
1553  "parent_type" => array("text", $this->getParentType()),
1554  "lang" => array("text", $this->getLanguage())
1555  ));
1556 
1557  // after update event
1558  $this->log->debug("calling __afterUpdate()");
1559  $this->__afterUpdate($dom_doc, $content);
1560 
1561  $this->log->debug(
1562  "...ending, updated and returning true, content: " . substr(
1563  $this->getXMLContent(),
1564  0,
1565  1000
1566  )
1567  );
1568 
1569  //echo "<br>PageObject::update:".htmlentities($this->getXMLContent()).":";
1570  return true;
1571  } else {
1572  return $errors;
1573  }
1574  }
performAutomaticModifications()
Perform automatic modifications (may be overwritten by sub classes)
getActive(bool $a_check_scheduled_activation=false)
checkPCIds()
Check, whether (all) page content hashes are set.
validateDom(bool $throw=false)
Validate the page content agains page DTD.
getDuplicatePCIds()
Get all duplicate PC Ids.
const ILIAS_VERSION_NUMERIC
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
getDomDoc()
Get dom doc (DOMDocument)
const IL_CAL_UNIX
static now()
Return current timestamp in Y-m-d H:i:s format.
containsIntLinks(string $a_content)
Check whether content contains internal links.
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
getXMLFromDom(bool $a_incl_head=false, bool $a_append_mobs=false, bool $a_append_bib=false, string $a_append_str="", bool $a_omit_pageobject_tag=false, int $style_id=0)
get xml content of page from dom (use this, if any changes are made to the document) ...
insertPCIds()
Insert Page Content IDs.
getEditLockInfo()
Get edit lock info.
$lm_set
__afterUpdate(DOMDocument $a_domdoc, string $a_xml, bool $a_creation=false, bool $a_empty=false)
After update event handler (internal).
__afterHistoryEntry(DOMDocument $a_old_domdoc, string $a_old_content, int $a_old_nr)
getEditLock()
Get page lock.
containsDeactivatedElements(string $a_content)
Check whether content contains deactivated elements.
getXMLContent(bool $a_incl_head=false)
get xml content of page
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateFromXML()

ilPageObject::updateFromXML ( )

Updates page object with current xml content This function is currently (8 beta) called by:

  • ilQuestionPageParser (Test and TestQuestionPool)
  • ilSCORM13Package->dbImportSco (SCORM importer)
  • assQuestion->copyPageOfQuestion

Definition at line 1323 of file class.ilPageObject.php.

References __afterUpdate(), buildDom(), containsDeactivatedElements(), containsIntLinks(), getActivationEnd(), getActivationStart(), getActive(), getDomDoc(), getId(), getLanguage(), getParentId(), getParentType(), getXMLContent(), ilUtil\now(), ILIAS\Repository\user(), and validateDom().

1323  : bool
1324  {
1325  $this->log->debug("ilPageObject, updateFromXML(): start, id: " . $this->getId());
1326 
1327  $content = $this->getXMLContent();
1328 
1329  $this->log->debug("ilPageObject, updateFromXML(): content: " . substr($content, 0, 100));
1330 
1331  $this->buildDom(true);
1332  $dom_doc = $this->getDomDoc();
1333 
1334  $errors = $this->validateDom(true);
1335 
1336  $iel = $this->containsDeactivatedElements($content);
1337  $inl = $this->containsIntLinks($content);
1338 
1339  $this->db->update("page_object", array(
1340  "content" => array("clob", $content),
1341  "parent_id" => array("integer", $this->getParentId()),
1342  "last_change_user" => array("integer", $this->user->getId()),
1343  "last_change" => array("timestamp", ilUtil::now()),
1344  "active" => array("integer", $this->getActive()),
1345  "activation_start" => array("timestamp", $this->getActivationStart()),
1346  "activation_end" => array("timestamp", $this->getActivationEnd()),
1347  "inactive_elements" => array("integer", $iel),
1348  "int_links" => array("integer", $inl),
1349  ), array(
1350  "page_id" => array("integer", $this->getId()),
1351  "parent_type" => array("text", $this->getParentType()),
1352  "lang" => array("text", $this->getLanguage())
1353  ));
1354 
1355  // after update event
1356  $this->__afterUpdate($dom_doc, $content);
1357 
1358  $this->log->debug("ilPageObject, updateFromXML(): end");
1359 
1360  return true;
1361  }
getActive(bool $a_check_scheduled_activation=false)
validateDom(bool $throw=false)
Validate the page content agains page DTD.
buildDom(bool $a_force=false)
getDomDoc()
Get dom doc (DOMDocument)
static now()
Return current timestamp in Y-m-d H:i:s format.
containsIntLinks(string $a_content)
Check whether content contains internal links.
__afterUpdate(DOMDocument $a_domdoc, string $a_xml, bool $a_creation=false, bool $a_empty=false)
After update event handler (internal).
containsDeactivatedElements(string $a_content)
Check whether content contains deactivated elements.
getXMLContent(bool $a_incl_head=false)
get xml content of page
+ Here is the call graph for this function:

◆ validateDom()

ilPageObject::validateDom ( bool  $throw = false)

Validate the page content agains page DTD.

Definition at line 1102 of file class.ilPageObject.php.

References stripHierIDs().

Referenced by createFromXML(), update(), and updateFromXML().

1102  : ?array
1103  {
1104  $this->stripHierIDs();
1105 
1106  // possible fix for #14820
1107  //libxml_disable_entity_loader(false);
1108 
1109  $error = null;
1110  $this->dom_util->validate($this->dom, $error, $throw);
1111  return $error;
1112  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeRenderedContent()

ilPageObject::writeRenderedContent ( string  $a_content,
string  $a_md5 
)

Write rendered content.

Definition at line 2480 of file class.ilPageObject.php.

References $DIC, getId(), getLanguage(), getParentType(), ilUtil\now(), and ilDBInterface\update().

2483  : void {
2484  global $DIC;
2485 
2486  $db = $DIC->database();
2487 
2488  $db->update("page_object", array(
2489  "rendered_content" => array("clob", $a_content),
2490  "render_md5" => array("text", $a_md5),
2491  "rendered_time" => array("timestamp", ilUtil::now())
2492  ), array(
2493  "page_id" => array("integer", $this->getId()),
2494  "lang" => array("text", $this->getLanguage()),
2495  "parent_type" => array("text", $this->getParentType())
2496  ));
2497  }
update(string $table_name, array $values, array $where)
$where MUST contain existing columns only.
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: feed.php:28
ilDBInterface $db
+ Here is the call graph for this function:

Field Documentation

◆ $activation_data

array ilPageObject::$activation_data = array()
staticprotected

Definition at line 85 of file class.ilPageObject.php.

◆ $activationend

string ilPageObject::$activationend = null
protected

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

Referenced by getActivationEnd().

◆ $activationstart

string ilPageObject::$activationstart = null
protected

Definition at line 98 of file class.ilPageObject.php.

Referenced by getActivationStart().

◆ $active

bool ilPageObject::$active = false
protected

Definition at line 89 of file class.ilPageObject.php.

Referenced by getActive().

◆ $concrete_lang

ilPageObject::$concrete_lang = ""
protected

Definition at line 101 of file class.ilPageObject.php.

Referenced by getConcreteLang().

◆ $contains_int_link

bool ilPageObject::$contains_int_link = false

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

Referenced by containsIntLink().

◆ $contains_question

bool ilPageObject::$contains_question = false
protected

Definition at line 96 of file class.ilPageObject.php.

Referenced by getContainsQuestion().

◆ $content_id_manager

ILIAS COPage ID ContentIdManager ilPageObject::$content_id_manager
protected

Definition at line 102 of file class.ilPageObject.php.

Referenced by setContentIdManager().

◆ $create_user

int ilPageObject::$create_user = 0
protected

Definition at line 55 of file class.ilPageObject.php.

Referenced by getCreationUserId().

◆ $cur_dtd

string ilPageObject::$cur_dtd = "ilias_pg_9.dtd"

Definition at line 74 of file class.ilPageObject.php.

◆ $db

◆ $dom

DOMDocument ilPageObject::$dom = null

Definition at line 70 of file class.ilPageObject.php.

Referenced by getDomDoc(), and ilPortfolioTemplatePage\getPageDiskSize().

◆ $dom_builded

bool ilPageObject::$dom_builded = false

Definition at line 82 of file class.ilPageObject.php.

◆ $dom_util

ILIAS COPage Dom DomUtil ilPageObject::$dom_util
protected

Definition at line 52 of file class.ilPageObject.php.

◆ $encoding

string ilPageObject::$encoding = ""

Definition at line 72 of file class.ilPageObject.php.

◆ $exists

array ilPageObject::$exists = array()
static

Definition at line 64 of file class.ilPageObject.php.

◆ $hier_ids

array ilPageObject::$hier_ids = []
protected

Definition at line 97 of file class.ilPageObject.php.

◆ $history_saved

bool ilPageObject::$history_saved = false

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

◆ $id

◆ $id_elements

array ilPageObject::$id_elements
protected

Definition at line 59 of file class.ilPageObject.php.

◆ $import_mode

bool ilPageObject::$import_mode = false
protected

Definition at line 86 of file class.ilPageObject.php.

Referenced by getImportMode().

◆ $language

string ilPageObject::$language = "-"
protected

Definition at line 84 of file class.ilPageObject.php.

Referenced by getLanguage().

◆ $last_change_user

int ilPageObject::$last_change_user = 0

Definition at line 95 of file class.ilPageObject.php.

Referenced by getLastChangeUser().

◆ $lastchange

string ilPageObject::$lastchange = ""
protected

Definition at line 94 of file class.ilPageObject.php.

Referenced by getLastChange().

◆ $link

ILIAS COPage Link LinkManager ilPageObject::$link
protected

Definition at line 53 of file class.ilPageObject.php.

◆ $lng

ilLanguage ilPageObject::$lng
protected

◆ $log

ilLogger ilPageObject::$log
protected

Definition at line 87 of file class.ilPageObject.php.

◆ $needs_parsing

bool ilPageObject::$needs_parsing = false

Definition at line 76 of file class.ilPageObject.php.

Referenced by needsImportParsing().

◆ $node

◆ $obj_definition

ilObjectDefinition ilPageObject::$obj_definition
protected

Definition at line 63 of file class.ilPageObject.php.

◆ $offline_handler

object ilPageObject::$offline_handler = null

Definition at line 81 of file class.ilPageObject.php.

Referenced by getOfflineHandler().

◆ $old_nr

int ilPageObject::$old_nr

Definition at line 60 of file class.ilPageObject.php.

◆ $page_config

ilPageConfig ilPageObject::$page_config
protected

Definition at line 90 of file class.ilPageObject.php.

Referenced by getPageConfig().

◆ $page_manager

ILIAS COPage Page PageManager ilPageObject::$page_manager
protected

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

◆ $page_not_found

bool ilPageObject::$page_not_found = false
protected

Definition at line 61 of file class.ilPageObject.php.

◆ $page_record

array ilPageObject::$page_record = array()
protected

Definition at line 88 of file class.ilPageObject.php.

◆ $parent_id

int ilPageObject::$parent_id = 0

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

Referenced by getParentId().

◆ $parent_type

string ilPageObject::$parent_type = ""

Definition at line 77 of file class.ilPageObject.php.

◆ $pc_definition

ILIAS COPage PC PCDefinition ilPageObject::$pc_definition
protected

Definition at line 54 of file class.ilPageObject.php.

◆ $pc_service

ILIAS COPage PC DomainService ilPageObject::$pc_service
protected

Definition at line 105 of file class.ilPageObject.php.

◆ $reading_time_manager

ILIAS COPage ReadingTime ReadingTimeManager ilPageObject::$reading_time_manager
protected

Definition at line 100 of file class.ilPageObject.php.

◆ $renderedcontent

string ilPageObject::$renderedcontent = ""
protected

Definition at line 92 of file class.ilPageObject.php.

Referenced by getRenderedContent().

◆ $renderedtime

string ilPageObject::$renderedtime = ""
protected

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

Referenced by getRenderedTime().

◆ $rendermd5

string ilPageObject::$rendermd5 = ""
protected

Definition at line 91 of file class.ilPageObject.php.

Referenced by getRenderMd5().

◆ $show_page_act_info

bool ilPageObject::$show_page_act_info = false
protected

Definition at line 62 of file class.ilPageObject.php.

Referenced by getShowActivationInfo().

◆ $style_manager

ILIAS COPage Style StyleManager ilPageObject::$style_manager
protected

Definition at line 104 of file class.ilPageObject.php.

◆ $tree

ilTree ilPageObject::$tree
protected

Definition at line 68 of file class.ilPageObject.php.

Referenced by handleRepositoryLinksOnCopy().

◆ $update_listener_cnt

int ilPageObject::$update_listener_cnt = 0

Definition at line 80 of file class.ilPageObject.php.

Referenced by addUpdateListener(), and callUpdateListeners().

◆ $update_listeners

array ilPageObject::$update_listeners = []

Definition at line 79 of file class.ilPageObject.php.

◆ $user

◆ $xml

string ilPageObject::$xml = ""

Definition at line 71 of file class.ilPageObject.php.

Referenced by getLanguageVariablesXML(), getXMLContent(), and getXMLFromDom().


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