ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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, bool $offline=false)
 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 (bool $offline=false)
 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
 
LOMServices $lom_services
 
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 52 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 110 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().

114  {
115  global $DIC;
116  $this->obj_definition = $DIC["objDefinition"];
117  $this->db = $DIC->database();
118  $this->user = $DIC->user();
119  $this->lng = $DIC->language();
120  $this->tree = $DIC->repositoryTree();
121  $this->log = ilLoggerFactory::getLogger('copg');
122  $this->lom_services = $DIC->learningObjectMetadata();
123 
124  $this->reading_time_manager = new ILIAS\COPage\ReadingTime\ReadingTimeManager();
125 
126  $this->parent_type = $this->getParentType();
127  $this->id = $a_id;
128  $this->setLanguage($a_lang);
129 
130  $this->contains_int_link = false;
131  $this->needs_parsing = false;
132  $this->update_listeners = array();
133  $this->update_listener_cnt = 0;
134  $this->dom_builded = false;
135  $this->page_not_found = false;
136  $this->old_nr = $a_old_nr;
137  $this->encoding = "UTF-8";
138  $this->id_elements =
139  array("PageContent",
140  "TableRow",
141  "TableData",
142  "ListItem",
143  "FileItem",
144  "Section",
145  "Tab",
146  "ContentPopup",
147  "GridCell"
148  );
149  $this->setActive(true);
150  $this->show_page_act_info = false;
151 
152  if ($a_id != 0) {
153  $this->read();
154  }
155 
156  $this->initPageConfig();
157  $this->afterConstructor();
158  $domain = $DIC->copage()
159  ->internal()
160  ->domain();
161  $this->content_id_manager = $domain
162  ->contentIds($this);
163  $this->page_manager = $domain->page();
164  $this->pc_service = $domain->pc();
165  $this->pc_definition = $domain->pc()->definition();
166  $this->link = $domain->link();
167  $this->style_manager = $domain->style();
168  $this->dom_util = $domain->domUtil();
169  }
static getLogger(string $a_component_id)
Get component logger.
read()
Read page data.
global $DIC
Definition: shib_login.php:25
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 1681 of file class.ilPageObject.php.

References afterDelete().

Referenced by delete().

1681  : void
1682  {
1683  $this->afterDelete();
1684  }
+ 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 1690 of file class.ilPageObject.php.

References saveStyleUsage().

Referenced by update().

1694  : void {
1695  // save style usage
1696  $this->saveStyleUsage($a_old_domdoc, $a_old_nr);
1697 
1698  // pc classes hook
1699  $defs = $this->pc_definition->getPCDefinitions();
1700  foreach ($defs as $def) {
1701  $cl = $def["pc_class"];
1702  call_user_func(
1703  $def["pc_class"] . '::afterPageHistoryEntry',
1704  $this,
1705  $a_old_domdoc,
1706  $a_old_content,
1707  $a_old_nr
1708  );
1709  }
1710  }
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 1370 of file class.ilPageObject.php.

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

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

1375  : void {
1376  // we do not need this if we are creating an empty page
1377  if (!$a_creation || !$a_empty) {
1378  // save internal link information
1379  // the page object is responsible to do this, since it "offers" the
1380  // internal link feature pc and page classes
1381  $this->saveInternalLinks($a_domdoc);
1382 
1383  // save style usage
1384  $this->saveStyleUsage($a_domdoc);
1385 
1386  // save estimated reading time
1387  $this->reading_time_manager->saveTime($this);
1388 
1389  // pc classes hook
1390  $defs = $this->pc_definition->getPCDefinitions();
1391  foreach ($defs as $def) {
1392  $cl = $def["pc_class"];
1393  call_user_func($def["pc_class"] . '::afterPageUpdate', $this, $a_domdoc, $a_xml, $a_creation);
1394  }
1395  }
1396 
1397  // call page hook
1398  $this->afterUpdate($a_domdoc, $a_xml);
1399 
1400  // call update listeners
1401  $this->callUpdateListeners();
1402  }
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 1671 of file class.ilPageObject.php.

Referenced by delete().

1671  : void
1672  {
1673  // pc classes hook
1674  $defs = $this->pc_definition->getPCDefinitions();
1675  foreach ($defs as $def) {
1676  $cl = $def["pc_class"];
1677  call_user_func($def["pc_class"] . '::beforePageDelete', $this);
1678  }
1679  }
+ 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 335 of file class.ilPageObject.php.

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

Referenced by ilDashboardPageGUI\__construct(), ilDclDetailedViewDefinitionGUI\__construct(), ilImprintGUI\__construct(), ilInternalLink\_exists(), ilContainer\_exportContainerSettings(), ilPageObjectGUI\checkLangPageAvailable(), ilObjContentObject\checkStructure(), ILIAS\Wiki\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\Portfolio\Export\PortfolioHtmlExport\exportHTMLPages(), ILIAS\Wiki\Export\BlogHtmlExport\exportHTMLPages(), ILIAS\Wiki\Export\WikiHtmlExport\exportHTMLPages(), ILIAS\LearningModule\Export\LMHtmlExport\exportHTMLPages(), ILIAS\Portfolio\Export\PortfolioHtmlExport\exportHTMLPagesPrint(), ILIAS\Wiki\Export\WikiHtmlExport\exportHTMLPagesPrint(), ilObjContentObject\exportXMLPageObjects(), ilLearningModuleImporter\finalProcessing(), ilObjItemGroup\fixContainerItemGroupRefsAfterCloning(), ilObjContentObject\fixTree(), 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().

340  : bool {
341  global $DIC;
342 
343  $db = $DIC->database();
344 
345  if (!$a_no_cache && isset(self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang])) {
346  return self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang];
347  }
348 
349  $and_lang = "";
350  if ($a_lang != "") {
351  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
352  }
353 
354  $query = "SELECT page_id FROM page_object WHERE page_id = " . $db->quote($a_id, "integer") . " " .
355  "AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang;
356  $set = $db->query($query);
357  if ($row = $db->fetchAssoc($set)) {
358  self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang] = true;
359  return true;
360  } else {
361  self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang] = false;
362  return false;
363  }
364  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: shib_login.php:25
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 369 of file class.ilPageObject.php.

References ilPageUtil\_existsAndNotEmpty().

Referenced by ilDashboardPageGUI\isLanguageAvailable().

373  : bool {
374  return ilPageUtil::_existsAndNotEmpty($a_parent_type, $a_id, $a_lang);
375  }
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:
+ Here is the caller 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 552 of file class.ilPageObject.php.

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

Referenced by ilLMPagesTableGUI\fillRow(), ILIAS\LearningModule\Table\SubObjectRetrieval\getData(), ilLMEditorExplorerGUI\getNodeIcon(), and ilLMTOCExplorerGUI\getNodeIcon().

556  : bool {
557  global $DIC;
558 
559  $db = $DIC->database();
560 
561  // language must be set at least to "-"
562  if ($a_lang == "") {
563  $a_lang = "-";
564  }
565 
566  //echo "<br>";
567  //var_dump(self::$activation_data); exit;
568  if (isset(self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang])) {
569  $rec = self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang];
570  } else {
571  $set = $db->queryF(
572  "SELECT active, activation_start, activation_end FROM page_object WHERE page_id = %s" .
573  " AND parent_type = %s AND lang = %s",
574  array("integer", "text", "text"),
575  array($a_id, $a_parent_type, $a_lang)
576  );
577  $rec = $db->fetchAssoc($set);
578  }
579 
580  if (!$rec["active"] && $rec["activation_start"] != "") {
581  return true;
582  }
583 
584  return false;
585  }
fetchAssoc(ilDBStatement $statement)
global $DIC
Definition: shib_login.php:25
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 614 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().

618  : array {
619  global $DIC;
620 
621  $db = $DIC->database();
622 
623  // language must be set at least to "-"
624  if ($a_lang == "") {
625  $a_lang = "-";
626  }
627 
628  if (isset(self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang])) {
629  $rec = self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang];
630  } else {
631  $set = $db->queryF(
632  "SELECT active, activation_start, activation_end, show_activation_info FROM page_object WHERE page_id = %s" .
633  " AND parent_type = %s AND lang = %s",
634  array("integer", "text", "text"),
635  array($a_id, $a_parent_type, $a_lang)
636  );
637  $rec = $db->fetchAssoc($set);
638  if (!$rec) {
639  return [
640  "active" => 1,
641  "activation_start" => null,
642  "activation_end" => null,
643  "show_activation_info" => 0
644  ];
645  }
646  }
647 
648  return $rec;
649  }
fetchAssoc(ilDBStatement $statement)
global $DIC
Definition: shib_login.php:25
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 508 of file class.ilPageObject.php.

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

Referenced by ilLMPageObject\_getPresentationTitle(), ilLMTracker\_isNodeVisible(), ILIAS\LearningModule\Editing\EditSubObjectsGUI\activatePages(), ilObjContentObjectGUI\activatePages(), ilLMNavigationRendererGUI\addDropdown(), ilObjBlog\deliverRSS(), ilLMNavigationStatus\determineStatus(), ilLMPagesTableGUI\fillRow(), ilObjBlogGUI\filterInactivePostings(), ILIAS\LearningModule\Table\SubObjectRetrieval\getData(), ilObjBlogGUI\getKeywords(), ilObjBlogGUI\getListItems(), ilLPStatusVisitedPages\getLMPages(), ilLMTOCExplorerGUI\getNodeHref(), ilLMEditorExplorerGUI\getNodeIcon(), ilLMTOCExplorerGUI\getNodeIcon(), ilLMEditorExplorerGUI\getNodeIconAlt(), ilLMNavigationStatus\getPredecessorPageId(), ilLMNavigationStatus\getSuccessorPageId(), ilBlogDraftsDerivedTaskProvider\getTasks(), ilLMTOCExplorerGUI\isNodeClickable(), ilObjBlogGUI\renderList(), ilObjBlogGUI\renderNavigationByAuthors(), ilObjBlogGUI\renderNavigationByDate(), ilLMPresentationGUI\showPrintView(), and ilLMPresentationGUI\showPrintViewSelection().

513  : bool {
514  global $DIC;
515 
516  $db = $DIC->database();
517 
518  // language must be set at least to "-"
519  if ($a_lang == "") {
520  $a_lang = "-";
521  }
522 
523  if (isset(self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang])) {
524  $rec = self::$activation_data[$a_id . ":" . $a_parent_type . ":" . $a_lang];
525  } else {
526  $set = $db->queryF(
527  "SELECT active, activation_start, activation_end FROM page_object WHERE page_id = %s" .
528  " AND parent_type = %s AND lang = %s",
529  array("integer", "text", "text"),
530  array($a_id, $a_parent_type, $a_lang)
531  );
532  $rec = $db->fetchAssoc($set);
533  if (!$rec) {
534  return true;
535  }
536  }
537 
538  $rec["n"] = ilUtil::now();
539  if (!$rec["active"] && $a_check_scheduled_activation) {
540  if ($rec["n"] >= $rec["activation_start"] &&
541  $rec["n"] <= $rec["activation_end"]) {
542  return true;
543  }
544  }
545 
546  return (bool) $rec["active"];
547  }
fetchAssoc(ilDBStatement $statement)
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: shib_login.php:25
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 2038 of file class.ilPageObject.php.

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

Referenced by ilLMPagesTableGUI\fillRow(), ILIAS\LearningModule\Table\SubObjectRetrieval\getData(), ilLMEditorExplorerGUI\getNodeIcon(), and ilLMEditorExplorerGUI\getNodeIconAlt().

2042  : bool {
2043  global $DIC;
2044 
2045  $db = $DIC->database();
2046 
2047  if ($a_lang == "") {
2048  $a_lang = "-";
2049  }
2050 
2051  $query = "SELECT * FROM page_object WHERE page_id = " .
2052  $db->quote($a_id, "integer") . " AND " .
2053  " parent_type = " . $db->quote($a_parent_type, "text") . " AND " .
2054  " lang = " . $db->quote($a_lang, "text") . " AND " .
2055  " inactive_elements = " . $db->quote(1, "integer");
2056  $obj_set = $db->query($query);
2057 
2058  if ($obj_rec = $obj_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
2059  return true;
2060  }
2061 
2062  return false;
2063  }
quote($value, string $type)
global $DIC
Definition: shib_login.php:25
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 590 of file class.ilPageObject.php.

References $DIC, and ilDBInterface\manipulateF().

Referenced by ILIAS\LearningModule\Editing\EditSubObjectsGUI\activatePages(), and ilObjContentObjectGUI\activatePages().

594  : void {
595  global $DIC;
596 
597  $db = $DIC->database();
598 
599  // language must be set at least to "-"
600  $a_lang = "-";
601 
602  $db->manipulateF(
603  "UPDATE page_object SET active = %s, activation_start = %s, " .
604  " activation_end = %s WHERE page_id = %s" .
605  " AND parent_type = %s AND lang = %s",
606  array("int", "timestamp", "timestamp", "integer", "text", "text"),
607  array((int) $a_active, null, null, $a_id, $a_parent_type, $a_lang)
608  );
609  }
manipulateF(string $query, array $types, array $values)
global $DIC
Definition: shib_login.php:25
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 663 of file class.ilPageObject.php.

References $DIC, and ilDBInterface\manipulateF().

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

663  : void
664  {
665  global $DIC;
666 
667  $db = $DIC->database();
668  $db->manipulateF(
669  "UPDATE page_object SET parent_id = %s WHERE page_id = %s" .
670  " AND parent_type = %s",
671  array("integer", "integer", "text"),
672  array($a_par_id, $a_pg_id, $a_parent_type)
673  );
674  }
manipulateF(string $query, array $types, array $values)
global $DIC
Definition: shib_login.php:25
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 1169 of file class.ilPageObject.php.

References getDomDoc().

1169  : void
1170  {
1171  $this->pc_service->fileList()->addFileSizes($this->getDomDoc());
1172  }
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 1120 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().

1120  : void
1121  {
1122  $this->content_id_manager->addHierIDsToDom();
1123  }
+ 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 447 of file class.ilPageObject.php.

References $update_listener_cnt.

Referenced by ilBlogPosting\read().

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

◆ afterConstructor()

ilPageObject::afterConstructor ( )

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

References getParentType().

Referenced by __construct().

177  : void
178  {
179  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterDelete()

ilPageObject::afterDelete ( )
protected

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

Referenced by __afterDelete().

1686  : void
1687  {
1688  }
+ Here is the caller graph for this function:

◆ afterUpdate()

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

After update.

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

Referenced by __afterUpdate().

1407  : void
1408  {
1409  }
+ 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 3040 of file class.ilPageObject.php.

References getContentObject(), and update().

3045  {
3046  if (is_array($targets)) {
3047  foreach ($targets as $t) {
3048  $tarr = explode(":", $t);
3049  $cont_obj = $this->getContentObject($tarr[0], $tarr[1]);
3050  if (is_object($cont_obj) && $cont_obj->getType() == "par") {
3051  $cont_obj->setCharacteristic($char_par);
3052  }
3053  if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
3054  $cont_obj->setCharacteristic($char_sec);
3055  }
3056  if (is_object($cont_obj) && $cont_obj->getType() == "media") {
3057  $cont_obj->setClass($char_med);
3058  }
3059  }
3060  return $this->update();
3061  }
3062  return true;
3063  }
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 2592 of file class.ilPageObject.php.

Referenced by ilPCParagraph\updatePage().

2592  : void
2593  {
2594  }
+ Here is the caller graph for this function:

◆ buildDom()

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

Definition at line 380 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\UI\Implementation\Component\Layout\Page\PageContentManager\downloadFile(), ILIAS\COPage\ID\ContentIdManager\getAllPCIds(), getContentManager(), ilGlossaryTermGUI\getInternalLinks(), ILIAS\COPage\Compare\PageCompare\getPageContentsHashes(), ilPCAMDFormGUI\getPortfolioForm(), ilCOPageExporter\getValidSchemaVersions(), handleRepositoryLinksOnCopy(), ilPCVerification\isInPortfolioPage(), moveIntLinks(), ilQuestionPageParser\processPagesToParse(), ilContainerPage\removeUnsupportedBlockIds(), ilPortfolioPage\renameLinksOnTitleChange(), ILIAS\COPage\ReadingTime\ReadingTimeManager\saveTime(), and updateFromXML().

381  {
382  if ($this->dom_builded && !$a_force) {
383  return true;
384  }
385  $error = null;
386  if ($this->getXMLContent() === "") {
387  $this->setXMLContent("<PageObject></PageObject>");
388  }
389  $this->dom = $this->dom_util->docFromString($this->getXMLContent(true), $error);
390  $path = "//PageObject";
391  if (is_null($this->dom)) {
392  throw new ilCOPageException("Invalid page xml (" .
393  $this->getId() . "," . $this->getLanguage() . "): " . $this->getXMLContent(true));
394  }
395  $nodes = $this->dom_util->path($this->dom, $path);
396  if (count($nodes) == 1) {
397  $this->node = $nodes->item(0);
398  } else {
399  throw new ilCOPageException("Invalid page xml (" .
400  $this->getId() . "," . $this->getLanguage() . "): " . $this->getXMLContent(true));
401  }
402 
403  if (empty($error)) {
404  $this->dom_builded = true;
405  return true;
406  } else {
407  return $error;
408  }
409  }
$path
Definition: ltiservices.php:30
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 459 of file class.ilPageObject.php.

References $update_listener_cnt.

Referenced by __afterUpdate().

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

◆ checkPCIds()

ilPageObject::checkPCIds ( )

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

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

Referenced by update().

1974  : bool
1975  {
1976  return $this->content_id_manager->checkPCIds();
1977  }
+ 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 1063 of file class.ilPageObject.php.

References getDomDoc().

Referenced by delete().

1063  : array
1064  {
1065  $mob_manager = $this->pc_service->mediaObject();
1066  return $mob_manager->collectMediaObjects($this->getDomDoc(), $a_inline_only);
1067  }
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 2068 of file class.ilPageObject.php.

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

2068  : bool
2069  {
2070  if (strpos($a_content, " Enabled=\"False\"")) {
2071  return true;
2072  }
2073  return false;
2074  }
+ 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 1021 of file class.ilPageObject.php.

References $contains_int_link.

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

◆ containsIntLinks()

ilPageObject::containsIntLinks ( string  $a_content)

Check whether content contains internal links.

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

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

2543  : bool
2544  {
2545  if (strpos($a_content, "IntLink")) {
2546  return true;
2547  }
2548  return false;
2549  }
+ 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 2604 of file class.ilPageObject.php.

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

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

2611  : void {
2612  if ($a_parent_type == "") {
2613  $a_parent_type = $this->getParentType();
2614  if ($a_new_parent_id == 0) {
2615  $a_new_parent_id = $this->getParentId();
2616  }
2617  }
2618 
2619  foreach (self::lookupTranslations($this->getParentType(), $this->getId()) as $l) {
2620  $existed = false;
2621  $orig_page = ilPageObjectFactory::getInstance($this->getParentType(), $this->getId(), 0, $l);
2622  if (ilPageObject::_exists($a_parent_type, $a_id, $l)) {
2623  if (!$overwrite_existing) {
2624  continue;
2625  }
2626  $new_page_object = ilPageObjectFactory::getInstance($a_parent_type, $a_id, 0, $l);
2627  $existed = true;
2628  } else {
2629  $new_page_object = ilPageObjectFactory::getInstance($a_parent_type, 0, 0, $l);
2630  $new_page_object->setParentId($a_new_parent_id);
2631  $new_page_object->setId($a_id);
2632  }
2633  $new_page_object->setXMLContent($orig_page->copyXMLContent($a_clone_mobs, $a_new_parent_id, $obj_copy_id));
2634  $new_page_object->setActive($orig_page->getActive());
2635  $new_page_object->setActivationStart($orig_page->getActivationStart());
2636  $new_page_object->setActivationEnd($orig_page->getActivationEnd());
2637  $this->setCopyProperties($new_page_object);
2638  if ($existed) {
2639  $new_page_object->buildDom();
2640  $new_page_object->update();
2641  } else {
2642  $new_page_object->create(false);
2643  }
2644  }
2645  }
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 1842 of file class.ilPageObject.php.

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

Referenced by cutContents().

1842  : void
1843  {
1844  $cm = $this->page_manager->content($this->getDomDoc());
1845  $cm->copyContents($a_hids, $this->user);
1846  }
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 2678 of file class.ilPageObject.php.

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

2680  : void {
2681  $transl_page = ilPageObjectFactory::getInstance(
2682  $this->getParentType(),
2683  0,
2684  0,
2685  $a_target_lang
2686  );
2687  $this->setTranslationProperties($transl_page);
2688  $transl_page->create(false);
2689  }
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 1777 of file class.ilPageObject.php.

References createFromXML().

1777  : void
1778  {
1779  $this->createFromXML();
1780  }
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 1281 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().

1281  : void
1282  {
1283  $empty = false;
1284  if ($this->getXMLContent() === "") {
1285  $this->setEmptyPageXml();
1286  $empty = true;
1287  }
1288  $content = $this->getXMLContent();
1289  $this->buildDom(true);
1290  $dom_doc = $this->getDomDoc();
1291 
1292  $errors = $this->validateDom(true);
1293 
1294  $iel = $this->containsDeactivatedElements($content);
1295  $inl = $this->containsIntLinks($content);
1296  // create object
1297  $this->db->insert("page_object", array(
1298  "page_id" => array("integer", $this->getId()),
1299  "parent_id" => array("integer", $this->getParentId()),
1300  "lang" => array("text", $this->getLanguage()),
1301  "content" => array("clob", $content),
1302  "parent_type" => array("text", $this->getParentType()),
1303  "create_user" => array("integer", $this->user->getId()),
1304  "last_change_user" => array("integer", $this->user->getId()),
1305  "active" => array("integer", (int) $this->getActive()),
1306  "activation_start" => array("timestamp", $this->getActivationStart()),
1307  "activation_end" => array("timestamp", $this->getActivationEnd()),
1308  "show_activation_info" => array("integer", (int) $this->getShowActivationInfo()),
1309  "inactive_elements" => array("integer", $iel),
1310  "int_links" => array("integer", $inl),
1311  "created" => array("timestamp", ilUtil::now()),
1312  "last_change" => array("timestamp", ilUtil::now()),
1313  "is_empty" => array("integer", $empty)
1314  ));
1315  // after update event
1316  $this->__afterUpdate($dom_doc, $content, true, $empty);
1317  }
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 1828 of file class.ilPageObject.php.

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

1829  {
1830  $this->copyContents($a_hids);
1831  return $this->deleteContents(
1832  $a_hids,
1833  true,
1834  $this->getPageConfig()->getEnableSelfAssessment(),
1835  true
1836  );
1837  }
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 1579 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().

1579  : void
1580  {
1581  $copg_logger = ilLoggerFactory::getLogger('copg');
1582  $copg_logger->debug(
1583  "ilPageObject: Delete called for ID '" . $this->getId() . "'," .
1584  " parent type: '" . $this->getParentType() . "', " .
1585  " hist nr: '" . $this->old_nr . "', " .
1586  " lang: '" . $this->getLanguage() . "', "
1587  );
1588 
1589  $mobs = array();
1590  if (!$this->page_not_found) {
1591  $this->buildDom();
1592  $mobs = $this->collectMediaObjects(false);
1593  }
1595  $this->getParentType() . ":pg",
1596  $this->getId(),
1597  false,
1598  $this->getLanguage()
1599  );
1600 
1601  foreach ($mobs2 as $m) {
1602  if (!in_array($m, $mobs)) {
1603  $mobs[] = $m;
1604  }
1605  }
1606 
1607  $copg_logger->debug("ilPageObject: ... found " . count($mobs) . " media objects.");
1608 
1609  $this->__beforeDelete();
1610 
1611  // treat plugged content
1612  $this->handleDeleteContent();
1613 
1614  // delete style usages
1615  $this->deleteStyleUsages(false);
1616 
1617  // delete internal links
1618  $this->deleteInternalLinks();
1619 
1620  // delete all mob usages
1621  ilObjMediaObject::_deleteAllUsages($this->getParentType() . ":pg", $this->getId());
1622 
1623  // delete news
1624  if (!$this->isTranslationPage()) {
1626  $this->getParentId(),
1627  $this->getParentType(),
1628  $this->getId(),
1629  "pg"
1630  );
1631  }
1632 
1633  // delete page_object entry
1634  $and = $this->isTranslationPage()
1635  ? " AND lang = " . $this->db->quote($this->getLanguage(), "text")
1636  : "";
1637  $this->db->manipulate("DELETE FROM page_object " .
1638  "WHERE page_id = " . $this->db->quote($this->getId(), "integer") .
1639  " AND parent_type= " . $this->db->quote($this->getParentType(), "text") . $and);
1640 
1641  // delete media objects
1642  foreach ($mobs as $mob_id) {
1643  $copg_logger->debug("ilPageObject: ... processing mob " . $mob_id . ".");
1644 
1645  if (ilObject::_lookupType($mob_id) != 'mob') {
1646  $copg_logger->debug("ilPageObject: ... type mismatch. Ignoring mob " . $mob_id . ".");
1647  continue;
1648  }
1649 
1650  if (ilObject::_exists($mob_id)) {
1651  $copg_logger->debug("ilPageObject: ... delete mob " . $mob_id . ".");
1652 
1653  $mob_obj = new ilObjMediaObject($mob_id);
1654  $mob_obj->delete();
1655  } else {
1656  $copg_logger->debug("ilPageObject: ... missing mob " . $mob_id . ".");
1657  }
1658  }
1659 
1660  $this->__afterDelete();
1661  }
__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 1788 of file class.ilPageObject.php.

References getDomDoc(), and update().

1793  {
1794  $pm = $this->page_manager->content($this->getDomDoc());
1795  $pm->deleteContent($this, $a_hid, $a_pcid, $move_operation);
1796  if ($a_update) {
1797  return $this->update();
1798  }
1799  return true;
1800  }
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 1809 of file class.ilPageObject.php.

References getDomDoc(), and update().

Referenced by cutContents().

1814  {
1815  $pm = $this->page_manager->content($this->getDomDoc());
1816  $pm->deleteContents($this, $a_hids, $a_self_ass, $move_operation);
1817  if ($a_update) {
1818  return $this->update();
1819  }
1820  return true;
1821  }
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 1756 of file class.ilPageObject.php.

References ILIAS\Repository\link().

Referenced by delete().

1756  : void
1757  {
1758  $this->link->deleteInternalLinks($this);
1759  }
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 1729 of file class.ilPageObject.php.

Referenced by delete().

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

◆ freeDom()

ilPageObject::freeDom ( )

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

411  : void
412  {
413  unset($this->dom);
414  }

◆ generatePCId()

ilPageObject::generatePCId ( )

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

2001  : string
2002  {
2003  return $this->content_id_manager->generatePCId();
2004  }

◆ getActivationEnd()

ilPageObject::getActivationEnd ( )

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

References $activationend.

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

704  : ?string
705  {
706  return $this->activationend;
707  }
+ Here is the caller graph for this function:

◆ getActivationStart()

ilPageObject::getActivationStart ( )

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

References $activationstart.

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

687  : ?string
688  {
689  return $this->activationstart;
690  }
+ Here is the caller graph for this function:

◆ getActive()

ilPageObject::getActive ( bool  $a_check_scheduled_activation = false)

Definition at line 474 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().

476  : bool {
477  if ($a_check_scheduled_activation && !$this->active) {
478  $start = new ilDateTime($this->getActivationStart(), IL_CAL_DATETIME);
479  $end = new ilDateTime($this->getActivationEnd(), IL_CAL_DATETIME);
480  $now = new ilDateTime(time(), IL_CAL_UNIX);
481  if (!ilDateTime::_before($now, $start) && !ilDateTime::_after($now, $end)) {
482  return true;
483  }
484  }
485  return $this->active;
486  }
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 2276 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().

2280  : array {
2281  global $DIC;
2282 
2283  $db = $DIC->database();
2284 
2285  $and_lang = "";
2286  if ($a_lang != "") {
2287  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2288  }
2289 
2290  $q = "SELECT * FROM page_object " .
2291  " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2292  " AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang;
2293  $set = $db->query($q);
2294  $pages = array();
2295  while ($page = $db->fetchAssoc($set)) {
2296  $key_add = ($a_lang == "")
2297  ? ":" . $page["lang"]
2298  : "";
2299  $pages[$page["page_id"] . $key_add] = array(
2300  "date" => $page["last_change"],
2301  "id" => $page["page_id"],
2302  "lang" => $page["lang"],
2303  "user" => $page["last_change_user"]
2304  );
2305  }
2306 
2307  return $pages;
2308  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: shib_login.php:25
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
$q
Definition: shib_logout.php:18
+ 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 1982 of file class.ilPageObject.php.

1982  : array
1983  {
1984  return $this->content_id_manager->getAllPCIds();
1985  }

◆ getConcreteLang()

ilPageObject::getConcreteLang ( )

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

References $concrete_lang.

213  : string
214  {
215  return $this->concrete_lang;
216  }

◆ getContainsQuestion()

ilPageObject::getContainsQuestion ( )

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

References $contains_question.

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

◆ 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 2558 of file class.ilPageObject.php.

References buildDom(), and getDomDoc().

Referenced by getInitialOpenedContent(), and saveInitialOpenedContent().

2558  : \ILIAS\COPage\Page\PageContentManager
2559  {
2560  $this->buildDom();
2561  return $this->page_manager->content($this->getDomDoc());
2562  }
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 712 of file class.ilPageObject.php.

References getDomDoc().

Referenced by assignCharacteristic(), getContentObjectForPcId(), ilPCParagraph\insert(), ILIAS\UI\Implementation\Component\Layout\Page\PageContentManager\moveContentAfter(), and ilPCParagraph\saveJS().

715  : ?ilPageContent {
716  $node = $this->page_manager->content($this->getDomDoc())->getContentDomNode(
717  $a_hier_id,
718  $a_pc_id
719  );
720  $this->log->debug("getContentObject: " . " $a_hier_id, $a_pc_id, " . $node->nodeName);
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 2931 of file class.ilPageObject.php.

2931  : array
2932  {
2933  return array();
2934  }

◆ getCreationUserId()

ilPageObject::getCreationUserId ( )

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

References $create_user.

283  : int
284  {
285  return $this->create_user;
286  }

◆ getDomDoc()

ilPageObject::getDomDoc ( )

Get dom doc (DOMDocument)

Definition at line 419 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\UI\Implementation\Component\Layout\Page\PageContentManager\downloadFile(), getContentDomNode(), getContentManager(), getContentObject(), ILIAS\COPage\PC\Paragraph\ParagraphManager\getFirstParagraphText(), getInternalLinks(), getMediaAliasElement(), ilPCParagraphModelProvider\getModels(), ilPCTableModelProvider\getModels(), ilPCPlaceHolderModelProvider\getModels(), ilPCSectionModelProvider\getModels(), getMultimediaXML(), ILIAS\COPage\Compare\PageCompare\getPageContentsHashes(), 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().

419  : DOMDocument
420  {
421  return $this->dom;
422  }
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 1996 of file class.ilPageObject.php.

Referenced by update().

1996  : array
1997  {
1998  return $this->content_id_manager->getDuplicatePCIds();
1999  }
+ Here is the caller graph for this function:

◆ getEditLock()

ilPageObject::getEditLock ( )

Get page lock.

Definition at line 2709 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().

2709  : bool
2710  {
2711  $db = $this->db;
2712  $user = $this->user;
2713 
2714  $min = $this->getEffectiveEditLockTime();
2715  if ($min > 0) {
2716  // try to set the lock for the user
2717  $ts = time();
2718  $db->manipulate(
2719  "UPDATE page_object SET " .
2720  " edit_lock_user = " . $db->quote($user->getId(), "integer") . "," .
2721  " edit_lock_ts = " . $db->quote($ts, "integer") .
2722  " WHERE (edit_lock_user = " . $db->quote($user->getId(), "integer") . " OR " .
2723  " edit_lock_ts < " . $db->quote(time() - ($min * 60), "integer") . ") " .
2724  " AND page_id = " . $db->quote($this->getId(), "integer") .
2725  " AND parent_type = " . $db->quote($this->getParentType(), "text")
2726  );
2727 
2728  $set = $db->query(
2729  "SELECT edit_lock_user FROM page_object " .
2730  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2731  " AND parent_type = " . $db->quote($this->getParentType(), "text")
2732  );
2733  $rec = $db->fetchAssoc($set);
2734  if ($rec["edit_lock_user"] != $user->getId()) {
2735  return false;
2736  }
2737  }
2738 
2739  return true;
2740  }
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 2781 of file class.ilPageObject.php.

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

Referenced by update().

2781  : array
2782  {
2783  $db = $this->db;
2784 
2785  $aset = new ilSetting("adve");
2786  $min = (int) $aset->get("block_mode_minutes");
2787 
2788  $set = $db->query(
2789  "SELECT edit_lock_user, edit_lock_ts FROM page_object " .
2790  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2791  " AND parent_type = " . $db->quote($this->getParentType(), "text")
2792  );
2793  $rec = $db->fetchAssoc($set);
2794  $rec["edit_lock_until"] = $rec["edit_lock_ts"] + $min * 60;
2795 
2796  return $rec;
2797  }
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 2965 of file class.ilPageObject.php.

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

Referenced by getEditLock().

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

◆ getFirstParagraphText()

ilPageObject::getFirstParagraphText ( )

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

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

◆ getHierIdForPcId()

ilPageObject::getHierIdForPcId ( string  $pcid)

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

1148  : string
1149  {
1150  return $this->content_id_manager->getHierIdForPcId($pcid);
1151  }

◆ getHierIds()

ilPageObject::getHierIds ( )

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

1125  : array
1126  {
1127  return $this->content_id_manager->getHierIds();
1128  }

◆ getHierIdsForPCIds()

ilPageObject::getHierIdsForPCIds ( array  $a_pc_ids)

Get hier ids for a set of pc ids.

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

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

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

◆ getHistoryEntries()

ilPageObject::getHistoryEntries ( )

Get History Entries.

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

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

2079  : array
2080  {
2081  $db = $this->db;
2082 
2083  $h_query = "SELECT * FROM page_history " .
2084  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2085  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2086  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2087  " ORDER BY hdate DESC";
2088 
2089  $hset = $db->query($h_query);
2090  $hentries = array();
2091 
2092  while ($hrec = $db->fetchAssoc($hset)) {
2093  $hrec["sortkey"] = (int) $hrec["nr"];
2094  $hrec["user"] = (int) $hrec["user_id"];
2095  $hentries[] = $hrec;
2096  }
2097  //var_dump($hentries);
2098  return $hentries;
2099  }
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 2104 of file class.ilPageObject.php.

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

2104  : ?array
2105  {
2106  $db = $this->db;
2107 
2108  $res = $db->queryF(
2109  "SELECT * FROM page_history " .
2110  " WHERE page_id = %s " .
2111  " AND parent_type = %s " .
2112  " AND nr = %s" .
2113  " AND lang = %s",
2114  array("integer", "text", "integer", "text"),
2115  array($this->getId(), $this->getParentType(), $a_old_nr, $this->getLanguage())
2116  );
2117  if ($hrec = $db->fetchAssoc($res)) {
2118  return $hrec;
2119  }
2120 
2121  return null;
2122  }
$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 2129 of file class.ilPageObject.php.

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

2129  : array
2130  {
2131  $db = $this->db;
2132 
2133  // determine previous entry
2134  $and_nr = ($a_nr > 0)
2135  ? " AND nr < " . $db->quote($a_nr, "integer")
2136  : "";
2137  $res = $db->query("SELECT MAX(nr) mnr FROM page_history " .
2138  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2139  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2140  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2141  $and_nr);
2142  $row = $db->fetchAssoc($res);
2143  if ($row["mnr"] > 0) {
2144  $res = $db->query("SELECT * FROM page_history " .
2145  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2146  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2147  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2148  " AND nr = " . $db->quote((int) $row["mnr"], "integer"));
2149  $row = $db->fetchAssoc($res);
2150  $ret["previous"] = $row;
2151  }
2152 
2153  // determine next entry
2154  $res = $db->query("SELECT MIN(nr) mnr FROM page_history " .
2155  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2156  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2157  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2158  " AND nr > " . $db->quote($a_nr, "integer"));
2159  $row = $db->fetchAssoc($res);
2160  if ($row["mnr"] > 0) {
2161  $res = $db->query("SELECT * FROM page_history " .
2162  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2163  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2164  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2165  " AND nr = " . $db->quote((int) $row["mnr"], "integer"));
2166  $row = $db->fetchAssoc($res);
2167  $ret["next"] = $row;
2168  }
2169 
2170  // current
2171  if ($a_nr > 0) {
2172  $res = $db->query("SELECT * FROM page_history " .
2173  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2174  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2175  " AND lang = " . $db->quote($this->getLanguage(), "text") .
2176  " AND nr = " . $db->quote($a_nr, "integer"));
2177  } else {
2178  $res = $db->query("SELECT page_id, last_change hdate, parent_type, parent_id, last_change_user user_id, content, lang FROM page_object " .
2179  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2180  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2181  " AND lang = " . $db->quote($this->getLanguage(), "text"));
2182  }
2183  $row = $db->fetchAssoc($res);
2184  $ret["current"] = $row;
2185 
2186  return $ret;
2187  }
$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 429 of file class.ilPageObject.php.

References $id.

Referenced by 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\Data\Link\LinkManager\deleteInternalLinks(), ilMediaPoolPage\deleteMetaData(), ILIAS\Style\StyleManager\deleteStyleUsages(), ILIAS\UI\Implementation\Component\Layout\Page\PageContentManager\downloadFile(), ilDclDetailedViewDefinition\getAvailablePlaceholders(), ilPCSection\getCacheTriggerString(), getEditLock(), getHistoryEntries(), getHistoryEntry(), getLastUpdateOfIncludedElements(), 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\Data\Link\LinkManager\saveInternalLinks(), ilWikiPage\saveInternalLinks(), ilPCParagraph\saveMetaKeywords(), ilPCMediaObject\saveMobUsage(), ilPCSkills\saveSkillUsage(), ILIAS\Style\StyleManager\saveStyleUsage(), ILIAS\COPage\ReadingTime\ReadingTimeManager\saveTime(), ilPCSection\saveTimings(), setTranslationProperties(), ilBlogPosting\unpublish(), ilPortfolioPage\update(), ilBlogPosting\update(), ilWikiPage\update(), update(), updateFromXML(), ilBlogPosting\updateKeywords(), ilMediaPoolPage\updateMetaData(), ilWikiPage\updateNews(), and writeRenderedContent().

429  : int
430  {
431  return $this->id;
432  }
+ 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 1031 of file class.ilPageObject.php.

References $import_mode.

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

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

◆ getInitialOpenedContent()

ilPageObject::getInitialOpenedContent ( )

Get initial opened content.

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

References getContentManager().

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

◆ getInternalLinks()

ilPageObject::getInternalLinks ( )

get all internal links that are used within the page

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

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

1072  : array
1073  {
1074  return $this->link->getInternalLinks($this->getDomDoc());
1075  }
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 903 of file class.ilPageObject.php.

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

Referenced by getXMLFromDom().

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

References ILIAS\Repository\lng().

Referenced by getLanguageVariablesXML().

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

◆ getLastChange()

ilPageObject::getLastChange ( )

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

References $lastchange.

258  : string
259  {
260  return $this->lastchange;
261  }

◆ 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 2939 of file class.ilPageObject.php.

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

Referenced by ilWikiUserHTMLExport\getProcess().

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

◆ getLastChangeUser()

ilPageObject::getLastChangeUser ( )

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

References $last_change_user.

268  : int
269  {
271  }

◆ 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 1739 of file class.ilPageObject.php.

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

1739  : string
1740  {
1742  $this->getParentType() . ":pg",
1743  $this->getId()
1744  );
1745  $files = ilObjFile::_getFilesOfObject(
1746  $this->getParentType() . ":pg",
1747  $this->getId()
1748  );
1749  $objs = array_merge($mobs, $files);
1750  return ilObject::_getLastUpdateOfObjects($objs);
1751  }
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 1092 of file class.ilPageObject.php.

References getDomDoc().

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

◆ getMultimediaXML()

ilPageObject::getMultimediaXML ( bool  $offline = false)

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

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

References getDomDoc().

Referenced by getXMLFromDom().

1083  : string
1084  {
1085  $mob_manager = $this->pc_service->mediaObject();
1086  return $mob_manager->getMultimediaXML($this->getDomDoc(), $offline);
1087  }
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 2313 of file class.ilPageObject.php.

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

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

◆ getOfflineHandler()

ilPageObject::getOfflineHandler ( )

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

References $offline_handler.

2030  : ?object
2031  {
2032  return $this->offline_handler;
2033  }

◆ getPageConfig()

ilPageObject::getPageConfig ( )

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

References $page_config.

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

218  : ilPageConfig
219  {
220  return $this->page_config;
221  }
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 2419 of file class.ilPageObject.php.

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

Referenced by ilBlogPostingGUI\getPageHeading().

2423  : array {
2424  global $DIC;
2425 
2426  $db = $DIC->database();
2427 
2428  $and_lang = "";
2429  if ($a_lang != "") {
2430  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2431  }
2432 
2433  $contributors = array();
2434  $set = $db->queryF(
2435  "SELECT last_change_user, lang FROM page_object " .
2436  " WHERE page_id = %s AND parent_type = %s " .
2437  " AND last_change_user != %s" . $and_lang,
2438  array("integer", "text", "integer"),
2439  array($a_page_id, $a_parent_type, 0)
2440  );
2441 
2442  while ($page = $db->fetchAssoc($set)) {
2443  if ($a_lang == "") {
2444  $contributors[$page["last_change_user"]][$page["lang"]] = 1;
2445  } else {
2446  $contributors[$page["last_change_user"]] = 1;
2447  }
2448  }
2449 
2450  $set = $db->queryF(
2451  "SELECT count(*) as cnt, lang, page_id, user_id FROM page_history " .
2452  " WHERE page_id = %s AND parent_type = %s AND user_id != %s " . $and_lang .
2453  " GROUP BY user_id, page_id, lang ",
2454  array("integer", "text", "integer"),
2455  array($a_page_id, $a_parent_type, 0)
2456  );
2457  while ($hpage = $db->fetchAssoc($set)) {
2458  if ($a_lang === "") {
2459  $contributors[$hpage["user_id"]][$page["lang"]] =
2460  ($contributors[$hpage["user_id"]][$page["lang"]] ?? 0) + $hpage["cnt"];
2461  } else {
2462  $contributors[$hpage["user_id"]] =
2463  ($contributors[$hpage["user_id"]] ?? 0) + $hpage["cnt"];
2464  }
2465  }
2466 
2467  $c = array();
2468  foreach ($contributors as $k => $co) {
2469  $name = ilObjUser::_lookupName($k);
2470  $c[] = array("user_id" => $k,
2471  "pages" => $co,
2472  "lastname" => $name["lastname"],
2473  "firstname" => $name["firstname"]
2474  );
2475  }
2476 
2477  return $c;
2478  }
fetchAssoc(ilDBStatement $statement)
static _lookupName(int $a_user_id)
lookup user name
quote($value, string $type)
$c
Definition: deliver.php:9
global $DIC
Definition: shib_login.php:25
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 2505 of file class.ilPageObject.php.

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

Referenced by ilLMPageObject\getPagesWithLinksList().

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

◆ getParagraphForPCID()

ilPageObject::getParagraphForPCID ( string  $pcid)

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

998  : ?ilPCParagraph
999  {
1000  return $this->pc_service->paragraph()->getParagraphForPCID($this, $pcid);
1001  }
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 2353 of file class.ilPageObject.php.

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

2357  : array {
2358  global $DIC;
2359 
2360  $db = $DIC->database();
2361 
2362  $and_lang = "";
2363  if ($a_lang != "") {
2364  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2365  }
2366 
2367  $contributors = array();
2368  $set = $db->queryF(
2369  "SELECT last_change_user, lang, page_id FROM page_object " .
2370  " WHERE parent_id = %s AND parent_type = %s " .
2371  " AND last_change_user != %s" . $and_lang,
2372  array("integer", "text", "integer"),
2373  array($a_parent_id, $a_parent_type, 0)
2374  );
2375 
2376  while ($page = $db->fetchAssoc($set)) {
2377  if ($a_lang == "") {
2378  $contributors[$page["last_change_user"]][$page["page_id"]][$page["lang"]] = 1;
2379  } else {
2380  $contributors[$page["last_change_user"]][$page["page_id"]] = 1;
2381  }
2382  }
2383 
2384  $set = $db->queryF(
2385  "SELECT count(*) as cnt, lang, page_id, user_id FROM page_history " .
2386  " WHERE parent_id = %s AND parent_type = %s AND user_id != %s " . $and_lang .
2387  " GROUP BY page_id, user_id, lang ",
2388  array("integer", "text", "integer"),
2389  array($a_parent_id, $a_parent_type, 0)
2390  );
2391  while ($hpage = $db->fetchAssoc($set)) {
2392  if ($a_lang == "") {
2393  $contributors[$hpage["user_id"]][$hpage["page_id"]][$hpage["lang"]] =
2394  ($contributors[$hpage["user_id"]][$hpage["page_id"]][$hpage["lang"]] ?? 0) + $hpage["cnt"];
2395  } else {
2396  $contributors[$hpage["user_id"]][$hpage["page_id"]] =
2397  ($contributors[$hpage["user_id"]][$hpage["page_id"]] ?? 0) + $hpage["cnt"];
2398  }
2399  }
2400 
2401  $c = array();
2402  foreach ($contributors as $k => $co) {
2403  if (ilObject::_lookupType($k) == "usr") {
2404  $name = ilObjUser::_lookupName($k);
2405  $c[] = array("user_id" => $k,
2406  "pages" => $co,
2407  "lastname" => $name["lastname"],
2408  "firstname" => $name["firstname"]
2409  );
2410  }
2411  }
2412 
2413  return $c;
2414  }
fetchAssoc(ilDBStatement $statement)
static _lookupName(int $a_user_id)
lookup user name
quote($value, string $type)
$c
Definition: deliver.php:9
global $DIC
Definition: shib_login.php:25
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 1161 of file class.ilPageObject.php.

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

1161  : string
1162  {
1163  return $this->content_id_manager->getPCIdForHierId($hier_id);
1164  }
+ 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 1156 of file class.ilPageObject.php.

1156  : array
1157  {
1158  return $this->content_id_manager->getPCIdsForHierIds($hier_ids);
1159  }

◆ getPCModel()

ilPageObject::getPCModel ( )

Get page component model.

Returns
array

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

References getPageConfig().

2998  : array
2999  {
3000  $model = [];
3001  /*
3002  $this->log->debug("--- Get page model start");
3003  $model = [];
3004  foreach ($this->getAllPCIds() as $pc_id) {
3005  $co = $this->getContentObjectForPcId($pc_id);
3006  if ($co !== null) {
3007  $co_model = $co->getModel();
3008  if ($co_model !== null) {
3009  $model[$pc_id] = $co_model;
3010  }
3011  }
3012  }
3013  $this->log->debug("--- Get page model end");
3014  */
3015 
3016  $config = $this->getPageConfig();
3017  foreach ($this->pc_definition->getPCDefinitions() as $def) {
3018  $model_provider = $this->pc_definition->getPCModelProviderByName($def["name"]);
3019  if ($config->getEnablePCType($def["name"]) || $def["name"] === "PlaceHolder") {
3020  if (!is_null($model_provider)) {
3021  foreach ($model_provider->getModels(
3022  $this->dom_util,
3023  $this
3024  ) as $pc_id => $co_model) {
3025  $model[$pc_id] = $co_model;
3026  }
3027  }
3028  }
3029  }
3030  return $model;
3031  }
+ 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 2213 of file class.ilPageObject.php.

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

2218  : array {
2219  global $DIC;
2220 
2221  $db = $DIC->database();
2222 
2223  $and_lang = "";
2224  if ($a_lang != "") {
2225  $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2226  }
2227 
2228  $page_changes = array();
2229  $limit_ts = date('Y-m-d H:i:s', time() - ($a_period * 24 * 60 * 60));
2230  $q = "SELECT * FROM page_object " .
2231  " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2232  " AND parent_type = " . $db->quote($a_parent_type, "text") .
2233  " AND last_change >= " . $db->quote($limit_ts, "timestamp") . $and_lang;
2234  // " AND (TO_DAYS(now()) - TO_DAYS(last_change)) <= ".((int)$a_period);
2235  $set = $db->query($q);
2236  while ($page = $db->fetchAssoc($set)) {
2237  $page_changes[] = array(
2238  "date" => $page["last_change"],
2239  "id" => $page["page_id"],
2240  "lang" => $page["lang"],
2241  "type" => "page",
2242  "user" => $page["last_change_user"]
2243  );
2244  }
2245 
2246  $and_str = "";
2247  if ($a_period > 0) {
2248  $limit_ts = date('Y-m-d H:i:s', time() - ($a_period * 24 * 60 * 60));
2249  $and_str = " AND hdate >= " . $db->quote($limit_ts, "timestamp") . " ";
2250  }
2251 
2252  $q = "SELECT * FROM page_history " .
2253  " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2254  " AND parent_type = " . $db->quote($a_parent_type, "text") .
2255  $and_str . $and_lang;
2256  $set = $db->query($q);
2257  while ($page = $db->fetchAssoc($set)) {
2258  $page_changes[] = array(
2259  "date" => $page["hdate"],
2260  "id" => $page["page_id"],
2261  "lang" => $page["lang"],
2262  "type" => "hist",
2263  "nr" => $page["nr"],
2264  "user" => $page["user_id"]
2265  );
2266  }
2267 
2268  $page_changes = ilArrayUtil::sortArray($page_changes, "date", "desc");
2269 
2270  return $page_changes;
2271  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: shib_login.php:25
query(string $query)
Run a (read-only) Query on the database.
ilDBInterface $db
$q
Definition: shib_logout.php:18
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 238 of file class.ilPageObject.php.

References $renderedcontent.

238  : string
239  {
240  return $this->renderedcontent;
241  }

◆ getRenderedTime()

ilPageObject::getRenderedTime ( )

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

References $renderedtime.

248  : string
249  {
250  return $this->renderedtime;
251  }

◆ getRenderMd5()

ilPageObject::getRenderMd5 ( )

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

References $rendermd5.

228  : string
229  {
230  return $this->rendermd5;
231  }

◆ 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 2989 of file class.ilPageObject.php.

References getParentId().

2989  : ?int
2990  {
2991  return $this->getParentId();
2992  }
+ Here is the call graph for this function:

◆ getShowActivationInfo()

ilPageObject::getShowActivationInfo ( )

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

References $show_page_act_info.

Referenced by createFromXML(), and update().

278  : bool
279  {
281  }
+ 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() . "/components/ILIAS/Export/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,
bool  $offline = false 
)

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().

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

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

1257  : void {
1258  $this->buildDom();
1259 
1260  $tree = $this->tree;
1261  $this->log->debug("Handle repository links...");
1262 
1263  $defs = $this->pc_definition->getPCDefinitions();
1264  foreach ($defs as $def) {
1265  if (method_exists($def["pc_class"], 'afterRepositoryCopy')) {
1266  call_user_func($def["pc_class"] . '::afterRepositoryCopy', $this, $a_mapping, $a_source_ref_id);
1267  }
1268  }
1269 
1270  $this->link->handleRepositoryLinksOnCopy($this->getDomDoc(), $a_mapping, $a_source_ref_id, $tree);
1271  }
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 1987 of file class.ilPageObject.php.

Referenced by update().

1987  : bool
1988  {
1989  return $this->content_id_manager->hasDuplicatePCIds();
1990  }
+ Here is the caller graph for this function:

◆ increaseViewCnt()

ilPageObject::increaseViewCnt ( )

Increase view cnt.

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

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

2196  : void
2197  {
2198  $db = $this->db;
2199 
2200  $db->manipulate("UPDATE page_object " .
2201  " SET view_cnt = view_cnt + 1 " .
2202  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2203  " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2204  " AND lang = " . $db->quote($this->getLanguage(), "text"));
2205  }
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 183 of file class.ilPageObject.php.

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

Referenced by __construct().

183  : void
184  {
186  $this->setPageConfig($cfg);
187  }
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 1891 of file class.ilPageObject.php.

References getDomDoc(), and getPageConfig().

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

1897  : void {
1898  $cm = $this->page_manager->content($this->getDomDoc());
1899  $cm->insertContent(
1900  $a_cont_obj,
1901  $a_pos,
1902  $a_mode,
1903  $a_pcid,
1904  $remove_placeholder,
1905  $this->getPageConfig()->getEnablePCType("PlaceHolder")
1906  );
1907  }
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 1912 of file class.ilPageObject.php.

References getDomDoc().

1917  : void {
1918  $cm = $this->page_manager->content($this->getDomDoc());
1919  $cm->insertContentNode(
1920  $a_cont_node,
1921  $a_pos,
1922  $a_mode,
1923  $a_pcid
1924  );
1925  }
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 1963 of file class.ilPageObject.php.

References getDomDoc().

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

◆ insertPCIds()

ilPageObject::insertPCIds ( )

Insert Page Content IDs.

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

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

2009  : void
2010  {
2011  $this->content_id_manager->insertPCIds();
2012  }
+ Here is the caller graph for this function:

◆ isTranslationPage()

ilPageObject::isTranslationPage ( )
protected

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

References getLanguage().

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

1663  : bool
1664  {
1665  return !in_array($this->getLanguage(), ["", "-"]);
1666  }
+ 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 651 of file class.ilPageObject.php.

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

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

651  : int
652  {
653  global $DIC;
654 
655  $db = $DIC->database();
656 
657  $res = $db->query("SELECT parent_id FROM page_object WHERE page_id = " . $db->quote($a_id, "integer") . " " .
658  "AND parent_type=" . $db->quote($a_type, "text"));
659  $rec = $db->fetchAssoc($res);
660  return (int) ($rec["parent_id"] ?? 0);
661  }
$res
Definition: ltiservices.php:69
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: shib_login.php:25
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 2655 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().

2658  : array {
2659  global $DIC;
2660 
2661  $db = $DIC->database();
2662 
2663  $set = $db->query(
2664  "SELECT lang FROM page_object " .
2665  " WHERE page_id = " . $db->quote($a_id, "integer") .
2666  " AND parent_type = " . $db->quote($a_parent_type, "text")
2667  );
2668  $langs = array();
2669  while ($rec = $db->fetchAssoc($set)) {
2670  $langs[] = $rec["lang"];
2671  }
2672  return $langs;
2673  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: shib_login.php:25
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 1940 of file class.ilPageObject.php.

References getDomDoc(), and update().

1945  {
1946  $cm = $this->page_manager->content($this->getDomDoc());
1947  $cm->moveContentAfter(
1948  $this,
1949  $a_source,
1950  $a_target,
1951  $a_spcid,
1952  $a_tpcid
1953  );
1954  return $this->update();
1955  }
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 1240 of file class.ilPageObject.php.

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

1240  : bool
1241  {
1242  $this->buildDom();
1243  $this->addHierIDs();
1244  return $this->link->moveIntLinks(
1245  $this->getDomDoc(),
1246  $a_from_to
1247  );
1248  }
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 1036 of file class.ilPageObject.php.

References $needs_parsing.

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

◆ 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 1853 of file class.ilPageObject.php.

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

1856  {
1857  $user = $this->user;
1858  $cm = $this->page_manager->content($this->getDomDoc());
1859  $cm->pasteContents(
1860  $user,
1861  $a_hier_id,
1862  $this,
1863  $a_self_ass
1864  );
1865  return $this->update();
1866  }
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 2554 of file class.ilPageObject.php.

Referenced by update().

2554  : void
2555  {
2556  }
+ 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 491 of file class.ilPageObject.php.

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

Referenced by ilLMExplorerGUI\__construct().

491  : void
492  {
493  global $DIC;
494 
495  $db = $DIC->database();
496  $set = $db->query(
497  "SELECT page_id, parent_type, lang, active, activation_start, activation_end, show_activation_info FROM page_object " .
498  " WHERE parent_id = " . $db->quote($a_parent_id, "integer")
499  );
500  while ($rec = $db->fetchAssoc($set)) {
501  self::$activation_data[$rec["page_id"] . ":" . $rec["parent_type"] . ":" . $rec["lang"]] = $rec;
502  }
503  }
fetchAssoc(ilDBStatement $statement)
quote($value, string $type)
global $DIC
Definition: shib_login.php:25
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 2189 of file class.ilPageObject.php.

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

2189  : void
2190  {
2191  }
+ Here is the caller graph for this function:

◆ read()

ilPageObject::read ( )

Read page data.

Definition at line 291 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().

291  : void
292  {
293  $this->setActive(true);
294  if ($this->old_nr == 0) {
295  $query = "SELECT * FROM page_object" .
296  " WHERE page_id = " . $this->db->quote($this->id, "integer") .
297  " AND parent_type=" . $this->db->quote($this->getParentType(), "text") .
298  " AND lang = " . $this->db->quote($this->getLanguage(), "text");
299  $pg_set = $this->db->query($query);
300  if (!$this->page_record = $this->db->fetchAssoc($pg_set)) {
301  throw new ilCOPageNotFoundException("Error: Page " . $this->id . " is not in database" .
302  " (parent type " . $this->getParentType() . ", lang: " . $this->getLanguage() . ").");
303  }
304  $this->setActive($this->page_record["active"]);
305  $this->setActivationStart($this->page_record["activation_start"]);
306  $this->setActivationEnd($this->page_record["activation_end"]);
307  $this->setShowActivationInfo($this->page_record["show_activation_info"]);
308  } else {
309  $query = "SELECT * FROM page_history" .
310  " WHERE page_id = " . $this->db->quote($this->id, "integer") .
311  " AND parent_type=" . $this->db->quote($this->getParentType(), "text") .
312  " AND nr = " . $this->db->quote($this->old_nr, "integer") .
313  " AND lang = " . $this->db->quote($this->getLanguage(), "text");
314  $pg_set = $this->db->query($query);
315  $this->page_record = $this->db->fetchAssoc($pg_set);
316  }
317  if (!$this->page_record) {
318  throw new ilCOPageNotFoundException("Error: Page " . $this->id . " is not in database" .
319  " (parent type " . $this->getParentType() . ", lang: " . $this->getLanguage() . ").");
320  }
321  $this->xml = $this->page_record["content"];
322  $this->setParentId((int) $this->page_record["parent_id"]);
323  $this->last_change_user = (int) ($this->page_record["last_change_user"] ?? 0);
324  $this->create_user = (int) ($this->page_record["create_user"] ?? 0);
325  $this->setRenderedContent((string) ($this->page_record["rendered_content"] ?? ""));
326  $this->setRenderMd5((string) ($this->page_record["render_md5"] ?? ""));
327  $this->setRenderedTime((string) ($this->page_record["rendered_time"] ?? ""));
328  $this->setLastChange((string) ($this->page_record["last_change"] ?? ""));
329  }
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 2025 of file class.ilPageObject.php.

References $handler.

2025  : void
2026  {
2027  $this->offline_handler = $handler;
2028  }
$handler
Definition: oai.php:14

◆ releasePageLock()

ilPageObject::releasePageLock ( )

Release page lock.

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

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

2745  : bool
2746  {
2747  $db = $this->db;
2748  $user = $this->user;
2749  $aset = new ilSetting("adve");
2750 
2751  $min = (int) $aset->get("block_mode_minutes");
2752  if ($min > 0) {
2753  // try to set the lock for the user
2754  $ts = time();
2755  $db->manipulate(
2756  "UPDATE page_object SET " .
2757  " edit_lock_user = " . $db->quote($user->getId(), "integer") . "," .
2758  " edit_lock_ts = 0" .
2759  " WHERE edit_lock_user = " . $db->quote($user->getId(), "integer") .
2760  " AND page_id = " . $db->quote($this->getId(), "integer") .
2761  " AND parent_type = " . $db->quote($this->getParentType(), "text")
2762  );
2763 
2764  $set = $db->query(
2765  "SELECT edit_lock_user FROM page_object " .
2766  " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2767  " AND parent_type = " . $db->quote($this->getParentType(), "text")
2768  );
2769  $rec = $db->fetchAssoc($set);
2770  if ($rec["edit_lock_user"] != $user->getId()) {
2771  return false;
2772  }
2773  }
2774 
2775  return true;
2776  }
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 1214 of file class.ilPageObject.php.

References getDomDoc().

1214  : bool
1215  {
1216  return $this->pc_service->fileList()->resolveFileItems(
1217  $this->getDomDoc(),
1218  $a_mapping
1219  );
1220  }
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 1202 of file class.ilPageObject.php.

References getDomDoc().

1202  : bool
1203  {
1204  return $this->pc_service->interactiveImage()->resolveIIMMediaAliases(
1205  $this->getDomDoc(),
1206  $a_mapping
1207  );
1208  }
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 1178 of file class.ilPageObject.php.

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

Referenced by ilQuestionPageParser\processPagesToParse().

1178  : bool
1179  {
1180  return $this->link->resolveIntLinks($this->getDomDoc(), $a_link_map);
1181  }
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 1187 of file class.ilPageObject.php.

1190  : bool {
1191  return $this->pc_service->mediaObject()->resolveMediaAliases(
1192  $this,
1193  $a_mapping,
1194  $a_reuse_existing_by_import
1195  );
1196  }

◆ resolveQuestionReferences()

ilPageObject::resolveQuestionReferences ( array  $a_mapping)

Resolve all quesiont references (after import)

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

References getDomDoc().

1226  : bool
1227  {
1228  $qm = $this->pc_service->question();
1229  return $qm->resolveQuestionReferences(
1230  $this->getDomDoc(),
1231  $a_mapping
1232  );
1233  }
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 2981 of file class.ilPageObject.php.

References ilPCResources\resolveResources().

2981  : bool
2982  {
2983  return ilPCResources::resolveResources($this, $ref_mapping);
2984  }
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 2567 of file class.ilPageObject.php.

References getContentManager(), and update().

2571  : void {
2572  $cm = $this->getContentManager();
2573  $cm->setInitialOpenedContent($a_type, $a_id, $a_target);
2574  $this->update();
2575  }
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 1766 of file class.ilPageObject.php.

References ILIAS\Repository\link().

Referenced by __afterUpdate().

1766  : void
1767  {
1768  $this->link->saveInternalLinks(
1769  $this,
1770  $a_domdoc
1771  );
1772  }
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 1715 of file class.ilPageObject.php.

Referenced by __afterHistoryEntry(), and __afterUpdate().

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

◆ sendParagraph()

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

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

References getDomDoc().

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

2017  : void {
2018  $this->pc_service->paragraph()->send(
2019  $this->getDomDoc(),
2020  $par_id,
2021  $filename
2022  );
2023  }
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 696 of file class.ilPageObject.php.

Referenced by read().

696  : void
697  {
698  if ($a_activationend == "") {
699  $a_activationend = null;
700  }
701  $this->activationend = $a_activationend;
702  }
+ Here is the caller graph for this function:

◆ setActivationStart()

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

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

Referenced by read().

679  : void
680  {
681  if ($a_activationstart == "") {
682  $a_activationstart = null;
683  }
684  $this->activationstart = $a_activationstart;
685  }
+ Here is the caller graph for this function:

◆ setActive()

ilPageObject::setActive ( bool  $a_active)

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

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

469  : void
470  {
471  $this->active = $a_active;
472  }
+ Here is the caller graph for this function:

◆ setConcreteLang()

ilPageObject::setConcreteLang ( string  $a_val)

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

209  {
210  $this->concrete_lang = $a_val;
211  }

◆ 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 1011 of file class.ilPageObject.php.

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

◆ setContainsQuestion()

ilPageObject::setContainsQuestion ( bool  $a_val)

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

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

◆ setContentIdManager()

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

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

References $content_id_manager.

173  : void {
174  $this->content_id_manager = $content_id_manager;
175  }
ILIAS COPage ID ContentIdManager $content_id_manager

◆ setCopyProperties()

ilPageObject::setCopyProperties ( ilPageObject  $new_page)
protected

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

Referenced by copy().

2647  : void
2648  {
2649  }
+ Here is the caller graph for this function:

◆ setEmptyPageXml()

ilPageObject::setEmptyPageXml ( )

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

References setXMLContent().

Referenced by createFromXML().

1273  : void
1274  {
1275  $this->setXMLContent("<PageObject></PageObject>");
1276  }
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 424 of file class.ilPageObject.php.

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

424  : void
425  {
426  $this->id = $a_id;
427  }
+ Here is the caller graph for this function:

◆ setImportMode()

ilPageObject::setImportMode ( bool  $a_val)

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

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

◆ setLanguage()

ilPageObject::setLanguage ( string  $a_val)

Set language.

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

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

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

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

193  : void
194  {
195  $this->language = $a_val;
196  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:25
+ 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 253 of file class.ilPageObject.php.

Referenced by read().

253  : void
254  {
255  $this->lastchange = $a_lastchange;
256  }
+ Here is the caller graph for this function:

◆ setLastChangeUser()

ilPageObject::setLastChangeUser ( int  $a_val)

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

263  : void
264  {
265  $this->last_change_user = $a_val;
266  }

◆ setPageConfig()

ilPageObject::setPageConfig ( ilPageConfig  $a_val)

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

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

203  : void
204  {
205  $this->page_config = $a_val;
206  }
+ Here is the caller graph for this function:

◆ setParentId()

ilPageObject::setParentId ( int  $a_id)

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

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

434  : void
435  {
436  $this->parent_id = $a_id;
437  }
+ Here is the caller graph for this function:

◆ setRenderedContent()

ilPageObject::setRenderedContent ( string  $a_renderedcontent)

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

Referenced by read().

233  : void
234  {
235  $this->renderedcontent = $a_renderedcontent;
236  }
+ Here is the caller graph for this function:

◆ setRenderedTime()

ilPageObject::setRenderedTime ( string  $a_renderedtime)

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

Referenced by read().

243  : void
244  {
245  $this->renderedtime = $a_renderedtime;
246  }
+ Here is the caller graph for this function:

◆ setRenderMd5()

ilPageObject::setRenderMd5 ( string  $a_rendermd5)

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

Referenced by read().

223  : void
224  {
225  $this->rendermd5 = $a_rendermd5;
226  }
+ Here is the caller graph for this function:

◆ setShowActivationInfo()

ilPageObject::setShowActivationInfo ( bool  $a_val)

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

Referenced by read().

273  : void
274  {
275  $this->show_page_act_info = $a_val;
276  }
+ Here is the caller graph for this function:

◆ setTranslationProperties()

ilPageObject::setTranslationProperties ( self  $transl_page)
protected

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

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

Referenced by copyPageToTranslation().

2691  : void
2692  {
2693  $transl_page->setId($this->getId());
2694  $transl_page->setParentId($this->getParentId());
2695  $transl_page->setXMLContent($this->copyXmlContent());
2696  $transl_page->setActive($this->getActive());
2697  $transl_page->setActivationStart($this->getActivationStart());
2698  $transl_page->setActivationEnd($this->getActivationEnd());
2699  }
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 1130 of file class.ilPageObject.php.

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

1130  : void
1131  {
1132  $this->content_id_manager->stripHierIDsFromDom();
1133  }
+ Here is the caller graph for this function:

◆ stripPCIDs()

ilPageObject::stripPCIDs ( )

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

1135  : void
1136  {
1137  $this->content_id_manager->stripPCIDs();
1138  }

◆ 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 1875 of file class.ilPageObject.php.

References getDomDoc(), and update().

1879  {
1880  $cm = $this->page_manager->content($this->getDomDoc());
1881  $cm->switchEnableMultiple($this, $a_hids, $a_self_ass);
1882  if ($a_update) {
1883  return $this->update();
1884  }
1885  return true;
1886  }
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 2803 of file class.ilPageObject.php.

References ilStr\shortenText().

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

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

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

1326  : bool
1327  {
1328  $this->log->debug("ilPageObject, updateFromXML(): start, id: " . $this->getId());
1329 
1330  $content = $this->getXMLContent();
1331 
1332  $this->log->debug("ilPageObject, updateFromXML(): content: " . substr($content, 0, 100));
1333 
1334  $this->buildDom(true);
1335  $dom_doc = $this->getDomDoc();
1336 
1337  $errors = $this->validateDom(true);
1338 
1339  $iel = $this->containsDeactivatedElements($content);
1340  $inl = $this->containsIntLinks($content);
1341 
1342  $this->db->update("page_object", array(
1343  "content" => array("clob", $content),
1344  "parent_id" => array("integer", $this->getParentId()),
1345  "last_change_user" => array("integer", $this->user->getId()),
1346  "last_change" => array("timestamp", ilUtil::now()),
1347  "active" => array("integer", $this->getActive()),
1348  "activation_start" => array("timestamp", $this->getActivationStart()),
1349  "activation_end" => array("timestamp", $this->getActivationEnd()),
1350  "inactive_elements" => array("integer", $iel),
1351  "int_links" => array("integer", $inl),
1352  ), array(
1353  "page_id" => array("integer", $this->getId()),
1354  "parent_type" => array("text", $this->getParentType()),
1355  "lang" => array("text", $this->getLanguage())
1356  ));
1357 
1358  // after update event
1359  $this->__afterUpdate($dom_doc, $content);
1360 
1361  $this->log->debug("ilPageObject, updateFromXML(): end");
1362 
1363  return true;
1364  }
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 1105 of file class.ilPageObject.php.

References stripHierIDs().

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

1105  : ?array
1106  {
1107  $this->stripHierIDs();
1108 
1109  // possible fix for #14820
1110  //libxml_disable_entity_loader(false);
1111 
1112  $error = null;
1113  $this->dom_util->validate($this->dom, $error, $throw);
1114  return $error;
1115  }
+ 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 2483 of file class.ilPageObject.php.

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

2486  : void {
2487  global $DIC;
2488 
2489  $db = $DIC->database();
2490 
2491  $db->update("page_object", array(
2492  "rendered_content" => array("clob", $a_content),
2493  "render_md5" => array("text", $a_md5),
2494  "rendered_time" => array("timestamp", ilUtil::now())
2495  ), array(
2496  "page_id" => array("integer", $this->getId()),
2497  "lang" => array("text", $this->getLanguage()),
2498  "parent_type" => array("text", $this->getParentType())
2499  ));
2500  }
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: shib_login.php:25
ilDBInterface $db
+ Here is the call graph for this function:

Field Documentation

◆ $activation_data

array ilPageObject::$activation_data = array()
staticprotected

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

◆ $activationend

string ilPageObject::$activationend = null
protected

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

Referenced by getActivationEnd().

◆ $activationstart

string ilPageObject::$activationstart = null
protected

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

Referenced by getActivationStart().

◆ $active

bool ilPageObject::$active = false
protected

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

Referenced by getActive().

◆ $concrete_lang

ilPageObject::$concrete_lang = ""
protected

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

Referenced by getConcreteLang().

◆ $contains_int_link

bool ilPageObject::$contains_int_link = false

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

Referenced by containsIntLink().

◆ $contains_question

bool ilPageObject::$contains_question = false
protected

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

Referenced by getContainsQuestion().

◆ $content_id_manager

ILIAS COPage ID ContentIdManager ilPageObject::$content_id_manager
protected

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

Referenced by setContentIdManager().

◆ $create_user

int ilPageObject::$create_user = 0
protected

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

Referenced by getCreationUserId().

◆ $cur_dtd

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

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

◆ $db

◆ $dom

DOMDocument ilPageObject::$dom = null

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

Referenced by getDomDoc().

◆ $dom_builded

bool ilPageObject::$dom_builded = false

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

◆ $dom_util

ILIAS COPage Dom DomUtil ilPageObject::$dom_util
protected

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

◆ $encoding

string ilPageObject::$encoding = ""

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

◆ $exists

array ilPageObject::$exists = array()
static

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

◆ $hier_ids

array ilPageObject::$hier_ids = []
protected

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

◆ $history_saved

bool ilPageObject::$history_saved = false

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

◆ $id

◆ $id_elements

array ilPageObject::$id_elements
protected

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

◆ $import_mode

bool ilPageObject::$import_mode = false
protected

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

Referenced by getImportMode().

◆ $language

string ilPageObject::$language = "-"
protected

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

Referenced by getLanguage().

◆ $last_change_user

int ilPageObject::$last_change_user = 0

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

Referenced by getLastChangeUser().

◆ $lastchange

string ilPageObject::$lastchange = ""
protected

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

Referenced by getLastChange().

◆ $link

ILIAS COPage Link LinkManager ilPageObject::$link
protected

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

◆ $lng

ilLanguage ilPageObject::$lng
protected

◆ $log

ilLogger ilPageObject::$log
protected

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

◆ $lom_services

LOMServices ilPageObject::$lom_services
protected

◆ $needs_parsing

bool ilPageObject::$needs_parsing = false

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

Referenced by needsImportParsing().

◆ $node

◆ $obj_definition

ilObjectDefinition ilPageObject::$obj_definition
protected

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

◆ $offline_handler

object ilPageObject::$offline_handler = null

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

Referenced by getOfflineHandler().

◆ $old_nr

int ilPageObject::$old_nr

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

◆ $page_config

ilPageConfig ilPageObject::$page_config
protected

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

Referenced by getPageConfig().

◆ $page_manager

ILIAS COPage Page PageManager ilPageObject::$page_manager
protected

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

◆ $page_not_found

bool ilPageObject::$page_not_found = false
protected

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

◆ $page_record

array ilPageObject::$page_record = array()
protected

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

◆ $parent_id

int ilPageObject::$parent_id = 0

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

Referenced by getParentId().

◆ $parent_type

string ilPageObject::$parent_type = ""

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

Referenced by ilDashboardPage\getParentType().

◆ $pc_definition

ILIAS COPage PC PCDefinition ilPageObject::$pc_definition
protected

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

◆ $pc_service

ILIAS COPage PC DomainService ilPageObject::$pc_service
protected

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

◆ $reading_time_manager

ILIAS COPage ReadingTime ReadingTimeManager ilPageObject::$reading_time_manager
protected

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

◆ $renderedcontent

string ilPageObject::$renderedcontent = ""
protected

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

Referenced by getRenderedContent().

◆ $renderedtime

string ilPageObject::$renderedtime = ""
protected

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

Referenced by getRenderedTime().

◆ $rendermd5

string ilPageObject::$rendermd5 = ""
protected

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

Referenced by getRenderMd5().

◆ $show_page_act_info

bool ilPageObject::$show_page_act_info = false
protected

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

Referenced by getShowActivationInfo().

◆ $style_manager

ILIAS COPage Style StyleManager ilPageObject::$style_manager
protected

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

◆ $tree

ilTree ilPageObject::$tree
protected

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

Referenced by handleRepositoryLinksOnCopy().

◆ $update_listener_cnt

int ilPageObject::$update_listener_cnt = 0

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

Referenced by addUpdateListener(), and callUpdateListeners().

◆ $update_listeners

array ilPageObject::$update_listeners = []

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

◆ $user

◆ $xml

string ilPageObject::$xml = ""

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

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


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