ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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)
 
 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)
 
 getLangVarXMLForValue (string $var, string $val)
 
 __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 InternalDomainService $domain
 
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
 
string $concrete_lang = ""
 
ILIAS COPage ID ContentIdManager $content_id_manager
 
ILIAS COPage Page PageManagerInterface $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 111 of file class.ilPageObject.php.

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ __afterDelete()

ilPageObject::__afterDelete ( )
finalprotected

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

1692 : void
1693 {
1694 $this->afterDelete();
1695 }

◆ __afterHistoryEntry()

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

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

1705 : void {
1706 // save style usage
1707 $this->saveStyleUsage($a_old_domdoc, $a_old_nr);
1708
1709 // pc classes hook
1710 $defs = $this->pc_definition->getPCDefinitions();
1711 foreach ($defs as $def) {
1712 $cl = $def["pc_class"];
1713 call_user_func(
1714 $def["pc_class"] . '::afterPageHistoryEntry',
1715 $this,
1716 $a_old_domdoc,
1717 $a_old_content,
1718 $a_old_nr
1719 );
1720 }
1721 }
saveStyleUsage(DOMDocument $a_domdoc, int $a_old_nr=0)
Save all style class/template usages.

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

1386 : void {
1387 // we do not need this if we are creating an empty page
1388 if (!$a_creation || !$a_empty) {
1389 // save internal link information
1390 // the page object is responsible to do this, since it "offers" the
1391 // internal link feature pc and page classes
1392 $this->saveInternalLinks($a_domdoc);
1393
1394 // save style usage
1395 $this->saveStyleUsage($a_domdoc);
1396
1397 // save estimated reading time
1398 $this->reading_time_manager->saveTime($this);
1399
1400 // pc classes hook
1401 $defs = $this->pc_definition->getPCDefinitions();
1402 foreach ($defs as $def) {
1403 $cl = $def["pc_class"];
1404 call_user_func($def["pc_class"] . '::afterPageUpdate', $this, $a_domdoc, $a_xml, $a_creation);
1405 }
1406 }
1407
1408 // call page hook
1409 $this->afterUpdate($a_domdoc, $a_xml);
1410
1411 // call update listeners
1412 $this->callUpdateListeners();
1413 }
afterUpdate(DOMDocument $domdoc, string $xml)
After update.
saveInternalLinks(DOMDocument $a_domdoc)
save internal links of page

◆ __beforeDelete()

ilPageObject::__beforeDelete ( )
finalprotected

Before deletion handler (internal).

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

1682 : void
1683 {
1684 // pc classes hook
1685 $defs = $this->pc_definition->getPCDefinitions();
1686 foreach ($defs as $def) {
1687 $cl = $def["pc_class"];
1688 call_user_func($def["pc_class"] . '::beforePageDelete', $this);
1689 }
1690 }

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

345 : bool {
346 global $DIC;
347
348 $db = $DIC->database();
349
350 if (!$a_no_cache && isset(self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang])) {
351 return self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang];
352 }
353
354 $and_lang = "";
355 if ($a_lang != "") {
356 $and_lang = " AND lang = " . $db->quote($a_lang, "text");
357 }
358
359 $query = "SELECT page_id FROM page_object WHERE page_id = " . $db->quote($a_id, "integer") . " " .
360 "AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang;
361 $set = $db->query($query);
362 if ($row = $db->fetchAssoc($set)) {
363 self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang] = true;
364 return true;
365 } else {
366 self::$exists[$a_parent_type . ":" . $a_id . ":" . $a_lang] = false;
367 return false;
368 }
369 }
ilDBInterface $db
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
fetchAssoc(ilDBStatement $statement)

Referenced by ilImprintGUI\__construct(), ilDclDetailedViewDefinitionGUI\__construct(), ilDashboardPageGUI\__construct(), ilInternalLink\_exists(), ilPageObjectGUI\checkLangPageAvailable(), ilObjContentObject\checkStructure(), ILIAS\Blog\Export\BlogHtmlExport\collectAllPagesPageElements(), ilObjectCopyGUI\copyParentPage(), ilObjForum\delete(), ilWikiPage\deleteAllPagesOfWiki(), ilObjMediaPool\deleteChild(), assQuestion\deletePageOfQuestion(), ilObjContentPage\doCloneObject(), ilObjContentPage\doDelete(), ILIAS\ContentPage\PageMetrics\PageMetricsService\doesPageExistsForLanguage(), ilContentPagePageCommandForwarder\doesPageExistsForLanguage(), ilForumPageCommandForwarder\doesPageExistsForLanguage(), ilAssQuestionFeedback\ensurePageObjectDeleted(), ilAssQuestionFeedbackPageObjectCommandForwarder\ensurePageObjectExists(), ilAssQuestionFeedback\ensurePageObjectExists(), ilContainerStartObjectsGUI\executeCommand(), ilLOEditorGUI\executeCommand(), ilLMPageObjectGUI\executeCommand(), ilObjectCopyGUI\executeNextStepAfterSourceSelection(), ILIAS\LearningModule\Export\LMHtmlExport\exportHTMLPages(), ILIAS\Portfolio\Export\PortfolioHtmlExport\exportHTMLPages(), ILIAS\Wiki\Export\WikiHtmlExport\exportHTMLPages(), ILIAS\Portfolio\Export\PortfolioHtmlExport\exportHTMLPagesPrint(), ILIAS\Wiki\Export\WikiHtmlExport\exportHTMLPagesPrint(), ilObjContentObject\exportXMLPageObjects(), ilLearningModuleImporter\finalProcessing(), ilObjContentObject\fixTree(), ilContainerGUI\forwardToPageObject(), ilGuidedTourAdminGUI\forwardToPageObject(), ilPageMultiLang\getEffectiveLang(), ilLMPresentationGUI\getLMPage(), ilLMContentRendererGUI\getLMPageGUI(), ilLMPresentationGUI\getLMPageGUI(), ILIAS\Container\Page\PageManager\getPage(), ilContainerExporter\getXmlExportTailDependencies(), ilLearningSequenceExporter\getXmlExportTailDependencies(), ilPCQuestion\handleCopiedContent(), ilObjLearningSequence\hasContentPage(), ilQuestionPageParser\processPagesToParse(), ilObjContentObject\validatePages(), and ilContainerXmlWriter\writeSubitems().

+ 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 374 of file class.ilPageObject.php.

378 : bool {
379 return ilPageUtil::_existsAndNotEmpty($a_parent_type, $a_id, $a_lang);
380 }
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)

Referenced by ilDashboardPageGUI\isLanguageAvailable().

+ 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 554 of file class.ilPageObject.php.

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

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

+ 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 616 of file class.ilPageObject.php.

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

Referenced by ilLMNavigationStatus\determineStatus(), ilLMNavigationStatus\getPredecessorPageId(), ilLMNavigationStatus\getSuccessorPageId(), and ilLMContentRendererGUI\renderDeactivatedPageMessage().

+ 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 510 of file class.ilPageObject.php.

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

Referenced by ilDclDetailedViewDefinitionGUI\__construct(), ilObjContentObjectGUI\activatePages(), ILIAS\LearningModule\Editing\EditSubObjectsGUI\activatePages(), ilLMNavigationRendererGUI\addDropdown(), ILIAS\Blog\Permission\PermissionManager\canReadPosting(), ilObjBlog\deliverRSS(), ilLMNavigationStatus\determineStatus(), ilLMPagesTableGUI\fillRow(), ilObjBlogGUI\filterInactivePostings(), ILIAS\LearningModule\Editing\SubObjectRetrieval\getData(), ilDclTextRecordRepresentation\getHTML(), ilLPStatusVisitedPages\getLMPages(), ilLMTOCExplorerGUI\getNodeHref(), ilLMEditorExplorerGUI\getNodeIcon(), ilLMTOCExplorerGUI\getNodeIcon(), ilLMEditorExplorerGUI\getNodeIconAlt(), ilLMNavigationStatus\getPredecessorPageId(), ilLMNavigationStatus\getSuccessorPageId(), ilBlogDraftsDerivedTaskProvider\getTasks(), ilImprint\isActive(), ILIAS\Blog\Permission\PermissionManager\isActive(), ilLMTOCExplorerGUI\isNodeClickable(), ilObjBlogGUI\renderNavigationByDate(), ilLMPresentationGUI\showPrintView(), and ilLMPresentationGUI\showPrintViewSelection().

+ 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 2049 of file class.ilPageObject.php.

2053 : bool {
2054 global $DIC;
2055
2056 $db = $DIC->database();
2057
2058 if ($a_lang == "") {
2059 $a_lang = "-";
2060 }
2061
2062 $query = "SELECT * FROM page_object WHERE page_id = " .
2063 $db->quote($a_id, "integer") . " AND " .
2064 " parent_type = " . $db->quote($a_parent_type, "text") . " AND " .
2065 " lang = " . $db->quote($a_lang, "text") . " AND " .
2066 " inactive_elements = " . $db->quote(1, "integer");
2067 $obj_set = $db->query($query);
2068
2069 if ($obj_rec = $obj_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
2070 return true;
2071 }
2072
2073 return false;
2074 }
const FETCHMODE_ASSOC

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

+ 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 592 of file class.ilPageObject.php.

596 : void {
597 global $DIC;
598
599 $db = $DIC->database();
600
601 // language must be set at least to "-"
602 $a_lang = "-";
603
605 "UPDATE page_object SET active = %s, activation_start = %s, " .
606 " activation_end = %s WHERE page_id = %s" .
607 " AND parent_type = %s AND lang = %s",
608 array("int", "timestamp", "timestamp", "integer", "text", "text"),
609 array((int) $a_active, null, null, $a_id, $a_parent_type, $a_lang)
610 );
611 }
manipulateF(string $query, array $types, array $values)

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

+ 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 665 of file class.ilPageObject.php.

665 : void
666 {
667 global $DIC;
668
669 $db = $DIC->database();
671 "UPDATE page_object SET parent_id = %s WHERE page_id = %s" .
672 " AND parent_type = %s",
673 array("integer", "integer", "text"),
674 array($a_par_id, $a_pg_id, $a_parent_type)
675 );
676 }

References $DIC, and ilDBInterface\manipulateF().

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

+ 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 1180 of file class.ilPageObject.php.

1180 : void
1181 {
1182 $this->pc_service->fileList()->addFileSizes($this->getDomDoc());
1183 }
getDomDoc()
Get dom doc (DOMDocument)

◆ addHierIDs()

◆ addUpdateListener()

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

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

453 : void {
455 $this->update_listeners[$cnt]["object"] = $a_object;
456 $this->update_listeners[$cnt]["method"] = $a_method;
457 $this->update_listeners[$cnt]["parameters"] = $a_parameters;
458 $this->update_listener_cnt++;
459 }

◆ afterConstructor()

ilPageObject::afterConstructor ( )

Reimplemented in ilBlogPosting, ilDashboardPage, ilLMPage, ilPortfolioPage, and ilWikiPage.

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

181 : void
182 {
183 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ afterDelete()

ilPageObject::afterDelete ( )
protected

Reimplemented in ilLMPage.

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

1697 : void
1698 {
1699 }

◆ afterUpdate()

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

After update.

Reimplemented in ilLMPage, and ilWikiPage.

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

1418 : void
1419 {
1420 }

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

782 : void
783 {
784 $this->xml .= $a_xml;
785 }

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

3057 : array|bool {
3058 if (is_array($targets)) {
3059 foreach ($targets as $t) {
3060 $tarr = explode(":", $t);
3061 $cont_obj = $this->getContentObject($tarr[0], $tarr[1]);
3062 if (is_object($cont_obj) && $cont_obj->getType() == "par") {
3063 $cont_obj->setCharacteristic($char_par);
3064 }
3065 if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
3066 $cont_obj->setCharacteristic($char_sec);
3067 }
3068 if (is_object($cont_obj) && $cont_obj->getType() == "media") {
3069 $cont_obj->setClass($char_med);
3070 }
3071 }
3072 return $this->update();
3073 }
3074 return true;
3075 }
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.

◆ 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.

Reimplemented in ilGlossaryDefPage, and ilLMPage.

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

2604 : void
2605 {
2606 }

Referenced by ilPCParagraph\updatePage().

+ Here is the caller graph for this function:

◆ buildDom()

ilPageObject::buildDom ( bool  $a_force = false)

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

382 : string|bool|null
383 {
384 if ($this->dom_builded && !$a_force) {
385 return true;
386 }
387 $error = null;
388 if ($this->getXMLContent() === "") {
389 $this->setXMLContent("<PageObject></PageObject>");
390 }
391 $this->dom = $this->dom_util->docFromString($this->getXMLContent(true), $error);
392 $path = "//PageObject";
393 if (is_null($this->dom)) {
394 throw new ilCOPageException("Invalid page xml (" .
395 $this->getId() . "," . $this->getLanguage() . "): " . $this->getXMLContent(true));
396 }
397 $nodes = $this->dom_util->path($this->dom, $path);
398 if (count($nodes) == 1) {
399 $this->node = $nodes->item(0);
400 } else {
401 throw new ilCOPageException("Invalid page xml (" .
402 $this->getId() . "," . $this->getLanguage() . "): " . $this->getXMLContent(true));
403 }
404
405 if (empty($error)) {
406 $this->dom_builded = true;
407 return true;
408 } else {
409 return $error;
410 }
411 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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
$path
Definition: ltiservices.php:30

References $path, ILIAS\Survey\Mode\getId(), and getLanguage().

Referenced by ilContainerPage\addMissingContainerBlocks(), ILIAS\COPage\ID\ContentIdManager\checkPCIds(), ILIAS\COPage\ID\ContentIdManager\getAllPCIds(), COPageTestBase\getEmptyPageWithDom(), ILIAS\COPage\Compare\PageCompare\getPageContentsHashes(), ilQuestionPageParser\processPagesToParse(), ilContainerPage\removeUnsupportedBlockIds(), and ILIAS\COPage\ReadingTime\ReadingTimeManager\saveTime().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ callUpdateListeners()

ilPageObject::callUpdateListeners ( )

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

461 : void
462 {
463 for ($i = 0; $i < $this->update_listener_cnt; $i++) {
464 $object = $this->update_listeners[$i]["object"];
465 $method = $this->update_listeners[$i]["method"];
466 $parameters = $this->update_listeners[$i]["parameters"];
467 $object->$method($parameters);
468 }
469 }

◆ checkPCIds()

ilPageObject::checkPCIds ( )

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

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

1985 : bool
1986 {
1987 return $this->content_id_manager->checkPCIds();
1988 }

◆ collectMediaObjects()

ilPageObject::collectMediaObjects ( bool  $a_inline_only = true)

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

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

1075 : array
1076 {
1077 $mob_manager = $this->pc_service->mediaObject();
1078 return $mob_manager->collectMediaObjects($this->getDomDoc(), $a_inline_only);
1079 }

◆ containsDeactivatedElements()

ilPageObject::containsDeactivatedElements ( string  $a_content)

Check whether content contains deactivated elements.

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

2079 : bool
2080 {
2081 if (strpos($a_content, " Enabled=\"False\"")) {
2082 return true;
2083 }
2084 return false;
2085 }

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

1033 : bool
1034 {
1036 }

◆ containsIntLinks()

ilPageObject::containsIntLinks ( string  $a_content)

Check whether content contains internal links.

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

2555 : bool
2556 {
2557 if (strpos($a_content, "IntLink")) {
2558 return true;
2559 }
2560 return false;
2561 }

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

2623 : void {
2624 if ($a_parent_type == "") {
2625 $a_parent_type = $this->getParentType();
2626 if ($a_new_parent_id == 0) {
2627 $a_new_parent_id = $this->getParentId();
2628 }
2629 }
2630
2631 foreach (self::lookupTranslations($this->getParentType(), $this->getId()) as $l) {
2632 $existed = false;
2633 $orig_page = ilPageObjectFactory::getInstance($this->getParentType(), $this->getId(), 0, $l);
2634 if (ilPageObject::_exists($a_parent_type, $a_id, $l)) {
2635 if (!$overwrite_existing) {
2636 continue;
2637 }
2638 $new_page_object = ilPageObjectFactory::getInstance($a_parent_type, $a_id, 0, $l);
2639 $existed = true;
2640 } else {
2641 $new_page_object = ilPageObjectFactory::getInstance($a_parent_type, 0, 0, $l);
2642 $new_page_object->setParentId($a_new_parent_id);
2643 $new_page_object->setId($a_id);
2644 }
2645 $new_page_object->setXMLContent($orig_page->copyXMLContent($a_clone_mobs, $a_new_parent_id, $obj_copy_id));
2646 $new_page_object->setActive($orig_page->getActive());
2647 $new_page_object->setActivationStart($orig_page->getActivationStart());
2648 $new_page_object->setActivationEnd($orig_page->getActivationEnd());
2649 $this->setCopyProperties($new_page_object);
2650 if ($existed) {
2651 $new_page_object->buildDom();
2652 $new_page_object->update();
2653 } else {
2654 $new_page_object->create(false);
2655 }
2656 }
2657 }
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
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.

◆ copyContents()

ilPageObject::copyContents ( array  $a_hids)

Copy contents to clipboard.

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

1853 : void
1854 {
1855 $cm = $this->page_manager->content($this->getDomDoc());
1856 $cm->copyContents($a_hids, $this->user);
1857 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ copyPageToTranslation()

ilPageObject::copyPageToTranslation ( string  $a_target_lang)

Copy page to translation.

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

2692 : void {
2693 $transl_page = ilPageObjectFactory::getInstance(
2694 $this->getParentType(),
2695 0,
2696 0,
2697 $a_target_lang
2698 );
2699 $this->setTranslationProperties($transl_page);
2700 $transl_page->create(false);
2701 }
setTranslationProperties(self $transl_page)

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

822 : string {
823 $cm = $this->page_manager->contentFromXml($this->getXMLContent());
824 return $cm->copyXmlContent(
825 $this,
826 $a_clone_mobs,
827 $a_new_parent_id,
828 $obj_copy_id,
829 $self_ass
830 );
831 }

◆ create()

ilPageObject::create ( bool  $a_import = false)

create new page (with current xml data)

Reimplemented in ilBlogPosting, ilPortfolioPage, and ilWikiPage.

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

1788 : void
1789 {
1790 $this->createFromXML();
1791 }
createFromXML()
Create new page object with current xml content.

◆ createFromXML()

ilPageObject::createFromXML ( )

Create new page object with current xml content.

Reimplemented in ilWikiPage.

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

1292 : void
1293 {
1294 $empty = false;
1295 if ($this->getXMLContent() === "") {
1296 $this->setEmptyPageXml();
1297 $empty = true;
1298 }
1299 $content = $this->getXMLContent();
1300 $this->buildDom(true);
1301 $dom_doc = $this->getDomDoc();
1302
1303 $errors = $this->validateDom(true);
1304
1305 $iel = $this->containsDeactivatedElements($content);
1306 $inl = $this->containsIntLinks($content);
1307 // create object
1308 $this->db->insert("page_object", array(
1309 "page_id" => array("integer", $this->getId()),
1310 "parent_id" => array("integer", $this->getParentId()),
1311 "lang" => array("text", $this->getLanguage()),
1312 "content" => array("clob", $content),
1313 "parent_type" => array("text", $this->getParentType()),
1314 "create_user" => array("integer", $this->user->getId()),
1315 "last_change_user" => array("integer", $this->user->getId()),
1316 "active" => array("integer", (int) $this->getActive()),
1317 "activation_start" => array("timestamp", $this->getActivationStart()),
1318 "activation_end" => array("timestamp", $this->getActivationEnd()),
1319 "show_activation_info" => array("integer", (int) $this->getShowActivationInfo()),
1320 "inactive_elements" => array("integer", $iel),
1321 "int_links" => array("integer", $inl),
1322 "created" => array("timestamp", ilUtil::now()),
1323 "last_change" => array("timestamp", ilUtil::now()),
1324 "is_empty" => array("integer", $empty)
1325 ));
1326 // after update event
1327 $this->__afterUpdate($dom_doc, $content, true, $empty);
1328 }
containsDeactivatedElements(string $a_content)
Check whether content contains deactivated elements.
getActive(bool $a_check_scheduled_activation=false)
containsIntLinks(string $a_content)
Check whether content contains internal links.
buildDom(bool $a_force=false)
validateDom(bool $throw=false)
Validate the page content agains page DTD.
__afterUpdate(DOMDocument $a_domdoc, string $a_xml, bool $a_creation=false, bool $a_empty=false)
After update event handler (internal).

References ILIAS\Survey\Mode\getId(), getLanguage(), ilUtil\now(), and ILIAS\Repository\user().

Referenced by ilTestPage\createPageWithNextId().

+ 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 1839 of file class.ilPageObject.php.

1839 : array|bool
1840 {
1841 $this->copyContents($a_hids);
1842 return $this->deleteContents(
1843 $a_hids,
1844 true,
1845 $this->getPageConfig()->getEnableSelfAssessment(),
1846 true
1847 );
1848 }
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.

◆ delete()

ilPageObject::delete ( )

Reimplemented in ilBlogPosting, ilPortfolioPage, and ilWikiPage.

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

1590 : void
1591 {
1592 $copg_logger = ilLoggerFactory::getLogger('copg');
1593 $copg_logger->debug(
1594 "ilPageObject: Delete called for ID '" . $this->getId() . "'," .
1595 " parent type: '" . $this->getParentType() . "', " .
1596 " hist nr: '" . $this->old_nr . "', " .
1597 " lang: '" . $this->getLanguage() . "', "
1598 );
1599
1600 $mobs = array();
1601 if (!$this->page_not_found) {
1602 $this->buildDom();
1603 $mobs = $this->collectMediaObjects(false);
1604 }
1606 $this->getParentType() . ":pg",
1607 $this->getId(),
1608 false,
1609 $this->getLanguage()
1610 );
1611
1612 foreach ($mobs2 as $m) {
1613 if (!in_array($m, $mobs)) {
1614 $mobs[] = $m;
1615 }
1616 }
1617
1618 $copg_logger->debug("ilPageObject: ... found " . count($mobs) . " media objects.");
1619
1620 $this->__beforeDelete();
1621
1622 // treat plugged content
1623 $this->handleDeleteContent();
1624
1625 // delete style usages
1626 $this->deleteStyleUsages(false);
1627
1628 // delete internal links
1629 $this->deleteInternalLinks();
1630
1631 // delete all mob usages
1632 ilObjMediaObject::_deleteAllUsages($this->getParentType() . ":pg", $this->getId());
1633
1634 // delete news
1635 if (!$this->isTranslationPage()) {
1637 $this->getParentId(),
1638 $this->getParentType(),
1639 $this->getId(),
1640 "pg"
1641 );
1642 }
1643
1644 // delete page_object entry
1645 $and = $this->isTranslationPage()
1646 ? " AND lang = " . $this->db->quote($this->getLanguage(), "text")
1647 : "";
1648 $this->db->manipulate("DELETE FROM page_object " .
1649 "WHERE page_id = " . $this->db->quote($this->getId(), "integer") .
1650 " AND parent_type= " . $this->db->quote($this->getParentType(), "text") . $and);
1651
1652 // delete media objects
1653 foreach ($mobs as $mob_id) {
1654 $copg_logger->debug("ilPageObject: ... processing mob " . $mob_id . ".");
1655
1656 if (ilObject::_lookupType($mob_id) != 'mob') {
1657 $copg_logger->debug("ilPageObject: ... type mismatch. Ignoring mob " . $mob_id . ".");
1658 continue;
1659 }
1660
1661 if (ilObject::_exists($mob_id)) {
1662 $copg_logger->debug("ilPageObject: ... delete mob " . $mob_id . ".");
1663
1664 $mob_obj = new ilObjMediaObject($mob_id);
1665 $mob_obj->delete();
1666 } else {
1667 $copg_logger->debug("ilPageObject: ... missing mob " . $mob_id . ".");
1668 }
1669 }
1670
1671 $this->__afterDelete();
1672 }
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 _deleteAllUsages(string $a_type, int $a_id, ?int $a_usage_hist_nr=0, string $a_lang="-")
static _getMobsOfObject(string $a_type, int $a_id, int|false $a_usage_hist_nr=0, string $a_lang="-")
static _lookupType(int $id, bool $reference=false)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
__beforeDelete()
Before deletion handler (internal).
deleteStyleUsages(int $a_old_nr=0)
Delete style usages.
deleteInternalLinks()
Delete internal links.
handleDeleteContent(?DOMNode $a_node=null, $move_operation=false)
Handle content before deletion This currently treats only plugged content If no node is given,...
collectMediaObjects(bool $a_inline_only=true)
get all media objects, that are referenced and used within the page

References ilObjMediaObject\_deleteAllUsages(), ilObject\_exists(), ilObjMediaObject\_getMobsOfObject(), ilObject\_lookupType(), ilNewsItem\deleteNewsOfContext(), ILIAS\Survey\Mode\getId(), getLanguage(), and ilLoggerFactory\getLogger().

+ 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 1799 of file class.ilPageObject.php.

1804 : array|bool {
1805 $pm = $this->page_manager->content($this->getDomDoc());
1806 $pm->deleteContent($this, $a_hid, $a_pcid, $move_operation);
1807 if ($a_update) {
1808 return $this->update();
1809 }
1810 return true;
1811 }

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

1825 : array|bool {
1826 $pm = $this->page_manager->content($this->getDomDoc());
1827 $pm->deleteContents($this, $a_hids, $a_self_ass, $move_operation);
1828 if ($a_update) {
1829 return $this->update();
1830 }
1831 return true;
1832 }

Referenced by ILIAS\COPage\PC\Paragraph\ParagraphCommandActionHandler\cancelCommand(), ILIAS\COPage\PC\Paragraph\ParagraphCommandActionHandler\deleteCommand(), and ILIAS\COPage\PC\Paragraph\ParagraphCommandActionHandler\mergePrevious().

+ Here is the caller graph for this function:

◆ deleteInternalLinks()

ilPageObject::deleteInternalLinks ( )

Delete internal links.

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

1767 : void
1768 {
1769 $this->link->deleteInternalLinks($this);
1770 }

References ILIAS\Repository\link().

+ Here is the call graph for this function:

◆ deleteStyleUsages()

ilPageObject::deleteStyleUsages ( int  $a_old_nr = 0)

Delete style usages.

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

1740 : void
1741 {
1742 $this->style_manager->deleteStyleUsages($this, $a_old_nr);
1743 }

◆ freeDom()

ilPageObject::freeDom ( )

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

413 : void
414 {
415 unset($this->dom);
416 }

◆ generatePCId()

ilPageObject::generatePCId ( )

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

2012 : string
2013 {
2014 return $this->content_id_manager->generatePCId();
2015 }

◆ getActivationEnd()

ilPageObject::getActivationEnd ( )

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

706 : ?string
707 {
709 }

◆ getActivationStart()

ilPageObject::getActivationStart ( )

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

689 : ?string
690 {
692 }

◆ getActive()

ilPageObject::getActive ( bool  $a_check_scheduled_activation = false)

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

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

References ilDateTime\_after(), ilDateTime\_before(), IL_CAL_DATETIME, and IL_CAL_UNIX.

Referenced by ILIAS\Blog\News\NewsManager\handle().

+ 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 2287 of file class.ilPageObject.php.

2291 : array {
2292 global $DIC;
2293
2294 $db = $DIC->database();
2295
2296 $and_lang = "";
2297 if ($a_lang != "") {
2298 $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2299 }
2300
2301 $q = "SELECT * FROM page_object " .
2302 " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2303 " AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang;
2304 $set = $db->query($q);
2305 $pages = array();
2306 while ($page = $db->fetchAssoc($set)) {
2307 $key_add = ($a_lang == "")
2308 ? ":" . $page["lang"]
2309 : "";
2310 $pages[$page["page_id"] . $key_add] = array(
2311 "date" => $page["last_change"],
2312 "id" => $page["page_id"],
2313 "lang" => $page["lang"],
2314 "user" => $page["last_change_user"]
2315 );
2316 }
2317
2318 return $pages;
2319 }
$q
Definition: shib_logout.php:25

References ilDBInterface\quote().

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

+ 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 1993 of file class.ilPageObject.php.

1993 : array
1994 {
1995 return $this->content_id_manager->getAllPCIds();
1996 }

Referenced by ilDclDetailedViewDefinition\isActive().

+ Here is the caller graph for this function:

◆ getConcreteLang()

ilPageObject::getConcreteLang ( )

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

218 : string
219 {
221 }

◆ getContainsQuestion()

ilPageObject::getContainsQuestion ( )

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

1065 : bool
1066 {
1068 }

◆ getContentDomNode()

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

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

755 : ?DOMNode
756 {
757 $cm = $this->page_manager->content($this->getDomDoc());
758 return $cm->getContentDomNode($a_hier_id, $a_pc_id);
759 }

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

+ Here is the caller graph for this function:

◆ getContentManager()

ilPageObject::getContentManager ( )
protected

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

2571 {
2572 $this->buildDom();
2573 return $this->page_manager->content($this->getDomDoc());
2574 }

◆ getContentObject()

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

Get a content object of the page.

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

717 : ?ilPageContent {
718 $node = $this->page_manager->content($this->getDomDoc())->getContentDomNode(
719 $a_hier_id,
720 $a_pc_id
721 );
722 $this->log->debug("getContentObject: " . " $a_hier_id, $a_pc_id, " . $node?->nodeName);
723 return $this->pc_service->getByNode($node, $this);
724 }
Content object of ilPageObject (see ILIAS DTD).

◆ getContentObjectForPcId()

ilPageObject::getContentObjectForPcId ( string  $pcid)

Get content object for pc id.

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

730 {
731 $hier_ids = $this->getHierIdsForPCIds([$pcid]);
732 return $this->getContentObject($hier_ids[$pcid], $pcid);
733 }
getHierIdsForPCIds(array $a_pc_ids)
Get hier ids for a set of pc ids.

Referenced by ILIAS\COPage\PC\Paragraph\ParagraphCommandActionHandler\cancelCommand(), ilPCTableModelProvider\getModels(), and ilDclDetailedViewDefinition\isActive().

+ 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)

Reimplemented in ilWikiPage.

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

2943 : array
2944 {
2945 return array();
2946 }

◆ getCreationUserId()

ilPageObject::getCreationUserId ( )

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

288 : int
289 {
290 return $this->create_user;
291 }

◆ getDomDoc()

◆ getDomNodeForPCId()

ilPageObject::getDomNodeForPCId ( string  $pc_id)

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

761 : ?DOMNode
762 {
763 return $this->getContentDomNode("", $pc_id);
764 }
getContentDomNode(string $a_hier_id, string $a_pc_id="")

◆ getDuplicatePCIds()

ilPageObject::getDuplicatePCIds ( )

Get all duplicate PC Ids.

Returns
int[]

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

2007 : array
2008 {
2009 return $this->content_id_manager->getDuplicatePCIds();
2010 }

◆ getEditLock()

ilPageObject::getEditLock ( )

Get page lock.

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

2721 : bool
2722 {
2723 $db = $this->db;
2725
2726 $min = $this->getEffectiveEditLockTime();
2727 if ($min > 0) {
2728 // try to set the lock for the user
2729 $ts = time();
2730 $db->manipulate(
2731 "UPDATE page_object SET " .
2732 " edit_lock_user = " . $db->quote($user->getId(), "integer") . "," .
2733 " edit_lock_ts = " . $db->quote($ts, "integer") .
2734 " WHERE (edit_lock_user = " . $db->quote($user->getId(), "integer") . " OR " .
2735 " edit_lock_ts < " . $db->quote(time() - ($min * 60), "integer") . ") " .
2736 " AND page_id = " . $db->quote($this->getId(), "integer") .
2737 " AND parent_type = " . $db->quote($this->getParentType(), "text")
2738 );
2739
2740 $set = $db->query(
2741 "SELECT edit_lock_user FROM page_object " .
2742 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2743 " AND parent_type = " . $db->quote($this->getParentType(), "text")
2744 );
2745 $rec = $db->fetchAssoc($set);
2746 if (($rec["edit_lock_user"] ?? 0) != $user->getId()) {
2747 return false;
2748 }
2749 }
2750
2751 return true;
2752 }
manipulate(string $query)
Run a (write) Query on the database.

References ilDBInterface\fetchAssoc(), ilObject\getId(), ilDBInterface\manipulate(), ilDBInterface\query(), and ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getEditLockInfo()

ilPageObject::getEditLockInfo ( )

Get edit lock info.

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

2793 : array
2794 {
2795 $db = $this->db;
2796
2797 $aset = new ilSetting("adve");
2798 $min = (int) $aset->get("block_mode_minutes");
2799
2800 $set = $db->query(
2801 "SELECT edit_lock_user, edit_lock_ts FROM page_object " .
2802 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2803 " AND parent_type = " . $db->quote($this->getParentType(), "text")
2804 );
2805 $rec = $db->fetchAssoc($set);
2806 $rec["edit_lock_until"] = $rec["edit_lock_ts"] + $min * 60;
2807
2808 return $rec;
2809 }
ILIAS Setting Class.

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

+ Here is the call graph for this function:

◆ getEffectiveEditLockTime()

ilPageObject::getEffectiveEditLockTime ( )

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

2977 : int
2978 {
2979 if ($this->getPageConfig()->getEditLockSupport() == false) {
2980 return 0;
2981 }
2982
2983 $aset = new ilSetting("adve");
2984 $min = (int) $aset->get("block_mode_minutes");
2985
2986 return $min;
2987 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getFirstParagraphText()

ilPageObject::getFirstParagraphText ( )

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

1005 : string
1006 {
1007 return $this->pc_service->paragraph()->getFirstParagraphText($this);
1008 }

◆ getHierIdForPcId()

ilPageObject::getHierIdForPcId ( string  $pcid)

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

1159 : string
1160 {
1161 return $this->content_id_manager->getHierIdForPcId($pcid);
1162 }

Referenced by ILIAS\COPage\PC\Paragraph\ParagraphCommandActionHandler\cancelCommand(), and ILIAS\COPage\PC\Paragraph\ParagraphCommandActionHandler\mergePrevious().

+ Here is the caller graph for this function:

◆ getHierIds()

ilPageObject::getHierIds ( )

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

1136 : array
1137 {
1138 return $this->content_id_manager->getHierIds();
1139 }

◆ getHierIdsForPCIds()

ilPageObject::getHierIdsForPCIds ( array  $a_pc_ids)

Get hier ids for a set of pc ids.

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

1154 : array
1155 {
1156 return $this->content_id_manager->getHierIdsForPCIds($a_pc_ids);
1157 }

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

+ Here is the caller graph for this function:

◆ getHistoryEntries()

ilPageObject::getHistoryEntries ( )

Get History Entries.

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

2090 : array
2091 {
2092 $db = $this->db;
2093
2094 $h_query = "SELECT * FROM page_history " .
2095 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2096 " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2097 " AND lang = " . $db->quote($this->getLanguage(), "text") .
2098 " ORDER BY hdate DESC";
2099
2100 $hset = $db->query($h_query);
2101 $hentries = array();
2102
2103 while ($hrec = $db->fetchAssoc($hset)) {
2104 $hrec["sortkey"] = (int) $hrec["nr"];
2105 $hrec["user"] = (int) $hrec["user_id"];
2106 $hentries[] = $hrec;
2107 }
2108 //var_dump($hentries);
2109 return $hentries;
2110 }

References ilDBInterface\fetchAssoc(), ILIAS\Survey\Mode\getId(), getLanguage(), ILIAS\Repository\int(), ilDBInterface\query(), and ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getHistoryEntry()

ilPageObject::getHistoryEntry ( int  $a_old_nr)

Get History Entry.

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

2115 : ?array
2116 {
2117 $db = $this->db;
2118
2119 $res = $db->queryF(
2120 "SELECT * FROM page_history " .
2121 " WHERE page_id = %s " .
2122 " AND parent_type = %s " .
2123 " AND nr = %s" .
2124 " AND lang = %s",
2125 array("integer", "text", "integer", "text"),
2126 array($this->getId(), $this->getParentType(), $a_old_nr, $this->getLanguage())
2127 );
2128 if ($hrec = $db->fetchAssoc($res)) {
2129 return $hrec;
2130 }
2131
2132 return null;
2133 }
$res
Definition: ltiservices.php:69

References $res, ilDBInterface\fetchAssoc(), ILIAS\Survey\Mode\getId(), getLanguage(), and ilDBInterface\queryF().

+ 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 2140 of file class.ilPageObject.php.

2140 : array
2141 {
2142 $db = $this->db;
2143
2144 // determine previous entry
2145 $and_nr = ($a_nr > 0)
2146 ? " AND nr < " . $db->quote($a_nr, "integer")
2147 : "";
2148 $res = $db->query("SELECT MAX(nr) mnr FROM page_history " .
2149 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2150 " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2151 " AND lang = " . $db->quote($this->getLanguage(), "text") .
2152 $and_nr);
2153 $row = $db->fetchAssoc($res);
2154 if ($row["mnr"] > 0) {
2155 $res = $db->query("SELECT * FROM page_history " .
2156 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2157 " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2158 " AND lang = " . $db->quote($this->getLanguage(), "text") .
2159 " AND nr = " . $db->quote((int) $row["mnr"], "integer"));
2160 $row = $db->fetchAssoc($res);
2161 $ret["previous"] = $row;
2162 }
2163
2164 // determine next entry
2165 $res = $db->query("SELECT MIN(nr) mnr FROM page_history " .
2166 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2167 " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2168 " AND lang = " . $db->quote($this->getLanguage(), "text") .
2169 " AND nr > " . $db->quote($a_nr, "integer"));
2170 $row = $db->fetchAssoc($res);
2171 if ($row["mnr"] > 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((int) $row["mnr"], "integer"));
2177 $row = $db->fetchAssoc($res);
2178 $ret["next"] = $row;
2179 }
2180
2181 // current
2182 if ($a_nr > 0) {
2183 $res = $db->query("SELECT * FROM page_history " .
2184 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2185 " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2186 " AND lang = " . $db->quote($this->getLanguage(), "text") .
2187 " AND nr = " . $db->quote($a_nr, "integer"));
2188 } else {
2189 $res = $db->query("SELECT page_id, last_change hdate, parent_type, parent_id, last_change_user user_id, content, lang FROM page_object " .
2190 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2191 " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2192 " AND lang = " . $db->quote($this->getLanguage(), "text"));
2193 }
2194 $row = $db->fetchAssoc($res);
2195 $ret["current"] = $row;
2196
2197 return $ret;
2198 }

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

+ Here is the call graph for this function:

◆ getId()

◆ getIliasAbsolutePath()

ilPageObject::getIliasAbsolutePath ( )
protected

Reimplemented in ilUnitTestPageObject.

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

807 : string
808 {
809 return ILIAS_ABSOLUTE_PATH;
810 }

◆ getImportMode()

ilPageObject::getImportMode ( )

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

1043 : bool
1044 {
1045 return $this->import_mode;
1046 }

◆ getInitialOpenedContent()

ilPageObject::getInitialOpenedContent ( )

Get initial opened content.

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

2592 : array
2593 {
2594 $cm = $this->getContentManager();
2595 return $cm->getInitialOpenedContent();
2596 }

◆ getInternalLinks()

ilPageObject::getInternalLinks ( )

get all internal links that are used within the page

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

1084 : array
1085 {
1086 return $this->link->getInternalLinks($this->getDomDoc());
1087 }

References ILIAS\Repository\link().

+ Here is the call graph for this function:

◆ getLanguage()

ilPageObject::getLanguage ( )

◆ getLanguageVariablesXML()

ilPageObject::getLanguageVariablesXML ( int  $style_id = 0)

Get language variables as XML.

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

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

◆ getLangVarXML()

ilPageObject::getLangVarXML ( string  $var)
protected

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

991 : string
992 {
993 return $this->getLangVarXMLForValue(
994 $var,
995 $this->lng->txt("cont_" . $var)
996 );
997 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getLangVarXMLForValue()

ilPageObject::getLangVarXMLForValue ( string  $var,
string  $val 
)
protected

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

999 : string
1000 {
1001 $val = str_replace('"', "&quot;", $val);
1002 return "<LV name=\"$var\" value=\"" . $val . "\"/>";
1003 }

◆ getLastChange()

ilPageObject::getLastChange ( )

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

263 : string
264 {
265 return $this->lastchange;
266 }

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

2955 : string {
2956 global $DIC;
2957
2958 $db = $DIC->database();
2959
2960 $and_lang = "";
2961 if ($a_lang != "") {
2962 $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2963 }
2964
2965 $db->setLimit(1, 0);
2966 $q = "SELECT last_change FROM page_object " .
2967 " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2968 " AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang .
2969 " ORDER BY last_change DESC";
2970
2971 $set = $db->query($q);
2972 $rec = $db->fetchAssoc($set);
2973
2974 return $rec["last_change"];
2975 }
setLimit(int $limit, int $offset=0)

References ilDBInterface\quote().

Referenced by ilWikiUserHTMLExport\getProcess().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLastChangeUser()

ilPageObject::getLastChangeUser ( )

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

273 : int
274 {
276 }

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

1750 : string
1751 {
1753 $this->getParentType() . ":pg",
1754 $this->getId()
1755 );
1756 $files = ilObjFile::_getFilesOfObject(
1757 $this->getParentType() . ":pg",
1758 $this->getId()
1759 );
1760 $objs = array_merge($mobs, $files);
1762 }
static _getLastUpdateOfObjects(array $obj_ids)

References ilObject\_getLastUpdateOfObjects(), ilObjMediaObject\_getMobsOfObject(), and ILIAS\Survey\Mode\getId().

+ 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 1103 of file class.ilPageObject.php.

1103 : string
1104 {
1105 $mob_manager = $this->pc_service->mediaObject();
1106 return $mob_manager->getMediaAliasElement(
1107 $this->getDomDoc(),
1108 $a_mob_id,
1109 $a_nr
1110 );
1111 }

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

1095 : string {
1096 $mob_manager = $this->pc_service->mediaObject();
1097 return $mob_manager->getMultimediaXML($this->getDomDoc(), $offline);
1098 }

◆ getNewPages()

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

Get new pages.

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

2328 : array {
2329 global $DIC;
2330
2331 $db = $DIC->database();
2332
2333 $and_lang = "";
2334 if ($a_lang != "") {
2335 $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2336 }
2337
2338 $pages = array();
2339
2340 $q = "SELECT * FROM page_object " .
2341 " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2342 " AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang .
2343 " ORDER BY created DESC";
2344 $set = $db->query($q);
2345 while ($page = $db->fetchAssoc($set)) {
2346 if ($page["created"] != "") {
2347 $pages[] = array(
2348 "created" => $page["created"],
2349 "id" => $page["page_id"],
2350 "lang" => $page["lang"],
2351 "user" => $page["create_user"],
2352 );
2353 }
2354 }
2355
2356 return $pages;
2357 }

References ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getOfflineHandler()

ilPageObject::getOfflineHandler ( )

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

2041 : ?object
2042 {
2044 }

◆ getPageConfig()

ilPageObject::getPageConfig ( )

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

224 {
225 return $this->page_config;
226 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPageConfig $page_config

Referenced by ilLMPage\afterConstructor(), and ilWikiPage\afterConstructor().

+ 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 2431 of file class.ilPageObject.php.

2435 : array {
2436 global $DIC;
2437
2438 $db = $DIC->database();
2439
2440 $and_lang = "";
2441 if ($a_lang != "") {
2442 $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2443 }
2444
2445 $contributors = array();
2446 $set = $db->queryF(
2447 "SELECT last_change_user, lang FROM page_object " .
2448 " WHERE page_id = %s AND parent_type = %s " .
2449 " AND last_change_user != %s" . $and_lang,
2450 array("integer", "text", "integer"),
2451 array($a_page_id, $a_parent_type, 0)
2452 );
2453
2454 while ($page = $db->fetchAssoc($set)) {
2455 if ($a_lang == "") {
2456 $contributors[$page["last_change_user"]][$page["lang"]] = 1;
2457 } else {
2458 $contributors[$page["last_change_user"]] = 1;
2459 }
2460 }
2461
2462 $set = $db->queryF(
2463 "SELECT count(*) as cnt, lang, page_id, user_id FROM page_history " .
2464 " WHERE page_id = %s AND parent_type = %s AND user_id != %s " . $and_lang .
2465 " GROUP BY user_id, page_id, lang ",
2466 array("integer", "text", "integer"),
2467 array($a_page_id, $a_parent_type, 0)
2468 );
2469 while ($hpage = $db->fetchAssoc($set)) {
2470 if ($a_lang === "") {
2471 $contributors[$hpage["user_id"]][$page["lang"]] =
2472 ($contributors[$hpage["user_id"]][$page["lang"]] ?? 0) + $hpage["cnt"];
2473 } else {
2474 $contributors[$hpage["user_id"]] =
2475 ($contributors[$hpage["user_id"]] ?? 0) + $hpage["cnt"];
2476 }
2477 }
2478
2479 $c = array();
2480 foreach ($contributors as $k => $co) {
2481 $name = ilObjUser::_lookupName($k);
2482 $c[] = array("user_id" => $k,
2483 "pages" => $co,
2484 "lastname" => $name["lastname"],
2485 "firstname" => $name["firstname"]
2486 );
2487 }
2488
2489 return $c;
2490 }
static _lookupName(int $a_user_id)
$c
Definition: deliver.php:25

References ilDBInterface\quote().

Referenced by ilBlogPostingGUI\getPageHeading(), and ILIAS\Blog\News\NewsManager\handle().

+ 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 2517 of file class.ilPageObject.php.

2521 : array {
2522 global $DIC;
2523
2524 $db = $DIC->database();
2525
2526 $and_lang = "";
2527 if ($a_lang != "") {
2528 $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2529 }
2530
2531 $q = "SELECT * FROM page_object " .
2532 " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2533 " AND parent_type = " . $db->quote($a_parent_type, "text") .
2534 " AND int_links = " . $db->quote(1, "integer") . $and_lang;
2535 $set = $db->query($q);
2536 $pages = array();
2537 while ($page = $db->fetchAssoc($set)) {
2538 $key_add = ($a_lang == "")
2539 ? ":" . $page["lang"]
2540 : "";
2541 $pages[$page["page_id"] . $key_add] = array(
2542 "date" => $page["last_change"],
2543 "id" => $page["page_id"],
2544 "lang" => $page["lang"],
2545 "user" => $page["last_change_user"]
2546 );
2547 }
2548
2549 return $pages;
2550 }

References ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getParagraphForPCID()

ilPageObject::getParagraphForPCID ( string  $pcid)

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

1010 : ?ilPCParagraph
1011 {
1012 return $this->pc_service->paragraph()->getParagraphForPCID($this, $pcid);
1013 }
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 738 of file class.ilPageObject.php.

739 {
740 $content_object = $this->getContentObjectForPcId($pcid);
741 $node = $content_object->getDomNode();
742 $node = $node->parentNode;
743 while ($node) {
744 if ($node->nodeName == "PageContent") {
745 $pcid = $node->getAttribute("PCID");
746 if ($pcid != "") {
747 return $this->getContentObjectForPcId($pcid);
748 }
749 }
750 $node = $node->parentNode;
751 }
752 return null;
753 }
getContentObjectForPcId(string $pcid)
Get content object for pc id.

Referenced by ILIAS\COPage\PC\Paragraph\ParagraphCommandActionHandler\cancelCommand().

+ Here is the caller 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 2364 of file class.ilPageObject.php.

2368 : array {
2369 global $DIC;
2370
2371 $db = $DIC->database();
2372 $profile = $DIC->copage()->internal()->domain()->profile();
2373
2374 $and_lang = "";
2375 if ($a_lang != "") {
2376 $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2377 }
2378
2379 $contributors = array();
2380 $set = $db->queryF(
2381 "SELECT last_change_user, lang, page_id FROM page_object " .
2382 " WHERE parent_id = %s AND parent_type = %s " .
2383 " AND last_change_user != %s" . $and_lang,
2384 array("integer", "text", "integer"),
2385 array($a_parent_id, $a_parent_type, 0)
2386 );
2387
2388 while ($page = $db->fetchAssoc($set)) {
2389 if ($a_lang == "") {
2390 $contributors[$page["last_change_user"]][$page["page_id"]][$page["lang"]] = 1;
2391 } else {
2392 $contributors[$page["last_change_user"]][$page["page_id"]] = 1;
2393 }
2394 }
2395
2396 $set = $db->queryF(
2397 "SELECT count(*) as cnt, lang, page_id, user_id FROM page_history " .
2398 " WHERE parent_id = %s AND parent_type = %s AND user_id != %s " . $and_lang .
2399 " GROUP BY page_id, user_id, lang ",
2400 array("integer", "text", "integer"),
2401 array($a_parent_id, $a_parent_type, 0)
2402 );
2403 while ($hpage = $db->fetchAssoc($set)) {
2404 if ($a_lang == "") {
2405 $contributors[$hpage["user_id"]][$hpage["page_id"]][$hpage["lang"]] =
2406 ($contributors[$hpage["user_id"]][$hpage["page_id"]][$hpage["lang"]] ?? 0) + $hpage["cnt"];
2407 } else {
2408 $contributors[$hpage["user_id"]][$hpage["page_id"]] =
2409 ($contributors[$hpage["user_id"]][$hpage["page_id"]] ?? 0) + $hpage["cnt"];
2410 }
2411 }
2412
2413 $c = array();
2414 foreach ($contributors as $k => $co) {
2415 if ($profile->exists($k)) {
2416 $name = ilObjUser::_lookupName($k);
2417 $c[] = array("user_id" => $k,
2418 "pages" => $co,
2419 "lastname" => $name["lastname"],
2420 "firstname" => $name["firstname"]
2421 );
2422 }
2423 }
2424
2425 return $c;
2426 }

References ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getParentType()

◆ getPCIdForHierId()

ilPageObject::getPCIdForHierId ( string  $hier_id)

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

1172 : string
1173 {
1174 return $this->content_id_manager->getPCIdForHierId($hier_id);
1175 }

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

+ 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 1167 of file class.ilPageObject.php.

1167 : array
1168 {
1169 return $this->content_id_manager->getPCIdsForHierIds($hier_ids);
1170 }

◆ getPCModel()

ilPageObject::getPCModel ( )

Get page component model.

Returns
array

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

3010 : array
3011 {
3012 $model = [];
3013 /*
3014 $this->log->debug("--- Get page model start");
3015 $model = [];
3016 foreach ($this->getAllPCIds() as $pc_id) {
3017 $co = $this->getContentObjectForPcId($pc_id);
3018 if ($co !== null) {
3019 $co_model = $co->getModel();
3020 if ($co_model !== null) {
3021 $model[$pc_id] = $co_model;
3022 }
3023 }
3024 }
3025 $this->log->debug("--- Get page model end");
3026 */
3027
3028 $config = $this->getPageConfig();
3029 foreach ($this->pc_definition->getPCDefinitions() as $def) {
3030 $model_provider = $this->pc_definition->getPCModelProviderByName($def["name"]);
3031 if ($config->getEnablePCType($def["name"]) || $def["name"] === "PlaceHolder") {
3032 if (!is_null($model_provider)) {
3033 foreach ($model_provider->getModels(
3034 $this->dom_util,
3035 $this
3036 ) as $pc_id => $co_model) {
3037 $model[$pc_id] = $co_model;
3038 }
3039 }
3040 }
3041 }
3042 return $model;
3043 }

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

2229 : array {
2230 global $DIC;
2231
2232 $db = $DIC->database();
2233
2234 $and_lang = "";
2235 if ($a_lang != "") {
2236 $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2237 }
2238
2239 $page_changes = array();
2240 $limit_ts = date('Y-m-d H:i:s', time() - ($a_period * 24 * 60 * 60));
2241 $q = "SELECT * FROM page_object " .
2242 " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2243 " AND parent_type = " . $db->quote($a_parent_type, "text") .
2244 " AND last_change >= " . $db->quote($limit_ts, "timestamp") . $and_lang;
2245 // " AND (TO_DAYS(now()) - TO_DAYS(last_change)) <= ".((int)$a_period);
2246 $set = $db->query($q);
2247 while ($page = $db->fetchAssoc($set)) {
2248 $page_changes[] = array(
2249 "date" => $page["last_change"],
2250 "id" => $page["page_id"],
2251 "lang" => $page["lang"],
2252 "type" => "page",
2253 "user" => $page["last_change_user"]
2254 );
2255 }
2256
2257 $and_str = "";
2258 if ($a_period > 0) {
2259 $limit_ts = date('Y-m-d H:i:s', time() - ($a_period * 24 * 60 * 60));
2260 $and_str = " AND hdate >= " . $db->quote($limit_ts, "timestamp") . " ";
2261 }
2262
2263 $q = "SELECT * FROM page_history " .
2264 " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2265 " AND parent_type = " . $db->quote($a_parent_type, "text") .
2266 $and_str . $and_lang;
2267 $set = $db->query($q);
2268 while ($page = $db->fetchAssoc($set)) {
2269 $page_changes[] = array(
2270 "date" => $page["hdate"],
2271 "id" => $page["page_id"],
2272 "lang" => $page["lang"],
2273 "type" => "hist",
2274 "nr" => $page["nr"],
2275 "user" => $page["user_id"]
2276 );
2277 }
2278
2279 $page_changes = ilArrayUtil::sortArray($page_changes, "date", "desc");
2280
2281 return $page_changes;
2282 }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)

References ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getRenderedContent()

ilPageObject::getRenderedContent ( )

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

243 : string
244 {
246 }

◆ getRenderedTime()

ilPageObject::getRenderedTime ( )

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

253 : string
254 {
255 return $this->renderedtime;
256 }

◆ getRenderMd5()

ilPageObject::getRenderMd5 ( )

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

233 : string
234 {
235 return $this->rendermd5;
236 }

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

3001 : ?int
3002 {
3003 return $this->getParentId();
3004 }

◆ getShowActivationInfo()

ilPageObject::getShowActivationInfo ( )

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

283 : bool
284 {
286 }

◆ getXMLContent()

ilPageObject::getXMLContent ( bool  $a_incl_head = false)

get xml content of page

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

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

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

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

Referenced by ILIAS\COPage\ReadingTime\ReadingTimeManager\saveTime().

+ 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 842 of file class.ilPageObject.php.

842 : void
843 {
844 $pm = $this->page_manager->content($this->getDomDoc());
845 $pm->handleDeleteContent($this, $a_node, $move_operation);
846 }

◆ handleRepositoryLinksOnCopy()

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

Handle repository links on copy process.

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

1268 : void {
1269 $this->buildDom();
1270
1272 $this->log->debug("Handle repository links...");
1273
1274 $defs = $this->pc_definition->getPCDefinitions();
1275 foreach ($defs as $def) {
1276 if (method_exists($def["pc_class"], 'afterRepositoryCopy')) {
1277 call_user_func($def["pc_class"] . '::afterRepositoryCopy', $this, $a_mapping, $a_source_ref_id);
1278 }
1279 }
1280
1281 $this->link->handleRepositoryLinksOnCopy($this->getDomDoc(), $a_mapping, $a_source_ref_id, $tree);
1282 }

◆ hasDuplicatePCIds()

ilPageObject::hasDuplicatePCIds ( )

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

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

◆ increaseViewCnt()

ilPageObject::increaseViewCnt ( )

Increase view cnt.

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

2207 : void
2208 {
2209 $db = $this->db;
2210
2211 $db->manipulate("UPDATE page_object " .
2212 " SET view_cnt = view_cnt + 1 " .
2213 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2214 " AND parent_type = " . $db->quote($this->getParentType(), "text") .
2215 " AND lang = " . $db->quote($this->getLanguage(), "text"));
2216 }

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

+ Here is the call graph for this function:

◆ initPageConfig()

ilPageObject::initPageConfig ( )

Reimplemented in ilUnitTestPageObject.

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

187 : void
188 {
189 $this->setPageConfig(
190 $this->domain->pageConfig($this->getParentType())
191 );
192 }
setPageConfig(ilPageConfig $a_val)

Referenced by __construct().

+ 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 1902 of file class.ilPageObject.php.

1908 : void {
1909 $cm = $this->page_manager->content($this->getDomDoc());
1910 $cm->insertContent(
1911 $a_cont_obj,
1912 $a_pos,
1913 $a_mode,
1914 $a_pcid,
1915 $remove_placeholder,
1916 $this->getPageConfig()->getEnablePCType("PlaceHolder")
1917 );
1918 }

Referenced by ilPCLearningHistory\create().

+ 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 1923 of file class.ilPageObject.php.

1928 : void {
1929 $cm = $this->page_manager->content($this->getDomDoc());
1930 $cm->insertContentNode(
1931 $a_cont_node,
1932 $a_pos,
1933 $a_mode,
1934 $a_pcid
1935 );
1936 }

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

1977 : void {
1978 $cm = $this->page_manager->content($this->getDomDoc());
1979 $cm->insertInstIntoIDs($a_inst, $a_res_ref_to_obj_id);
1980 }

◆ insertPCIds()

ilPageObject::insertPCIds ( )

Insert Page Content IDs.

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

2020 : void
2021 {
2022 $this->content_id_manager->insertPCIds();
2023 }

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

+ Here is the caller graph for this function:

◆ isTranslationPage()

ilPageObject::isTranslationPage ( )
protected

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

1674 : bool
1675 {
1676 return !in_array($this->getLanguage(), ["", "-"]);
1677 }

References getLanguage().

+ Here is the call graph for this function:

◆ lookupParentId()

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

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

653 : int
654 {
655 global $DIC;
656
657 $db = $DIC->database();
658
659 $res = $db->query("SELECT parent_id FROM page_object WHERE page_id = " . $db->quote($a_id, "integer") . " " .
660 "AND parent_type=" . $db->quote($a_type, "text"));
661 $rec = $db->fetchAssoc($res);
662 return (int) ($rec["parent_id"] ?? 0);
663 }

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

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

+ 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 2667 of file class.ilPageObject.php.

2670 : array {
2671 global $DIC;
2672
2673 $db = $DIC->database();
2674
2675 $set = $db->query(
2676 "SELECT lang FROM page_object " .
2677 " WHERE page_id = " . $db->quote($a_id, "integer") .
2678 " AND parent_type = " . $db->quote($a_parent_type, "text")
2679 );
2680 $langs = array();
2681 while ($rec = $db->fetchAssoc($set)) {
2682 $langs[] = $rec["lang"];
2683 }
2684 return $langs;
2685 }

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

+ 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 1951 of file class.ilPageObject.php.

1956 : array|bool {
1957 $cm = $this->page_manager->content($this->getDomDoc());
1958 $cm->moveContentAfter(
1959 $this,
1960 $a_source,
1961 $a_target,
1962 $a_spcid,
1963 $a_tpcid
1964 );
1965 return $this->update();
1966 }

Referenced by ILIAS\COPage\PC\Paragraph\ParagraphCommandActionHandler\cancelCommand().

+ Here is the caller 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 1251 of file class.ilPageObject.php.

1251 : bool
1252 {
1253 $this->buildDom();
1254 $this->addHierIDs();
1255 return $this->link->moveIntLinks(
1256 $this->getDomDoc(),
1257 $a_from_to
1258 );
1259 }
addHierIDs()
Add hierarchical ID (e.g.

References ILIAS\Repository\link().

+ Here is the call graph for this function:

◆ needsImportParsing()

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

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

1048 : bool
1049 {
1050 if ($a_parse === true) {
1051 $this->needs_parsing = true;
1052 }
1053 if ($a_parse === false) {
1054 $this->needs_parsing = false;
1055 }
1056 return $this->needs_parsing;
1057 }

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

1867 : array|bool {
1869 $cm = $this->page_manager->content($this->getDomDoc());
1870 $cm->pasteContents(
1871 $user,
1872 $a_hier_id,
1873 $this,
1874 $a_self_ass
1875 );
1876 return $this->update();
1877 }

◆ performAutomaticModifications()

ilPageObject::performAutomaticModifications ( )

Perform automatic modifications (may be overwritten by sub classes)

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

2566 : void
2567 {
2568 }

◆ preloadActivationDataByParentId()

static ilPageObject::preloadActivationDataByParentId ( int  $a_parent_id)
static

Preload activation data by Parent Id.

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

493 : void
494 {
495 global $DIC;
496
497 $db = $DIC->database();
498 $set = $db->query(
499 "SELECT page_id, parent_type, lang, active, activation_start, activation_end, show_activation_info FROM page_object " .
500 " WHERE parent_id = " . $db->quote($a_parent_id, "integer")
501 );
502 while ($rec = $db->fetchAssoc($set)) {
503 self::$activation_data[$rec["page_id"] . ":" . $rec["parent_type"] . ":" . $rec["lang"]] = $rec;
504 }
505 }

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

Referenced by ilLMExplorerGUI\__construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preparePageForCompare()

ilPageObject::preparePageForCompare ( ilPageObject  $page)

Reimplemented in ilWikiPage.

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

2200 : void
2201 {
2202 }

◆ read()

ilPageObject::read ( )

Read page data.

Reimplemented in ilBlogPosting, and ilPortfolioPage.

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

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

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerOfflineHandler()

ilPageObject::registerOfflineHandler ( object  $handler)

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

2036 : void
2037 {
2038 $this->offline_handler = $handler;
2039 }
$handler
Definition: oai.php:31

References $handler.

◆ releasePageLock()

ilPageObject::releasePageLock ( )

Release page lock.

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

2757 : bool
2758 {
2759 $db = $this->db;
2761 $aset = new ilSetting("adve");
2762
2763 $min = (int) $aset->get("block_mode_minutes");
2764 if ($min > 0) {
2765 // try to set the lock for the user
2766 $ts = time();
2767 $db->manipulate(
2768 "UPDATE page_object SET " .
2769 " edit_lock_user = " . $db->quote($user->getId(), "integer") . "," .
2770 " edit_lock_ts = 0" .
2771 " WHERE edit_lock_user = " . $db->quote($user->getId(), "integer") .
2772 " AND page_id = " . $db->quote($this->getId(), "integer") .
2773 " AND parent_type = " . $db->quote($this->getParentType(), "text")
2774 );
2775
2776 $set = $db->query(
2777 "SELECT edit_lock_user FROM page_object " .
2778 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2779 " AND parent_type = " . $db->quote($this->getParentType(), "text")
2780 );
2781 $rec = $db->fetchAssoc($set);
2782 if ($rec["edit_lock_user"] != $user->getId()) {
2783 return false;
2784 }
2785 }
2786
2787 return true;
2788 }

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

+ Here is the call graph for this function:

◆ resolveFileItems()

ilPageObject::resolveFileItems ( array  $a_mapping)

Resolve file items (after import)

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

1225 : bool
1226 {
1227 return $this->pc_service->fileList()->resolveFileItems(
1228 $this->getDomDoc(),
1229 $a_mapping
1230 );
1231 }

◆ resolveIIMMediaAliases()

ilPageObject::resolveIIMMediaAliases ( array  $a_mapping)

Resolve iim media aliases (in ilContObjParse)

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

1213 : bool
1214 {
1215 return $this->pc_service->interactiveImage()->resolveIIMMediaAliases(
1216 $this->getDomDoc(),
1217 $a_mapping
1218 );
1219 }

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

1189 : bool
1190 {
1191 return $this->link->resolveIntLinks($this->getDomDoc(), $a_link_map);
1192 }

References ILIAS\Repository\link().

Referenced by ilQuestionPageParser\processPagesToParse().

+ 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 1198 of file class.ilPageObject.php.

1201 : bool {
1202 return $this->pc_service->mediaObject()->resolveMediaAliases(
1203 $this,
1204 $a_mapping,
1205 $a_reuse_existing_by_import
1206 );
1207 }

◆ resolveQuestionReferences()

ilPageObject::resolveQuestionReferences ( array  $a_mapping)

Resolve all quesiont references (after import)

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

1237 : bool
1238 {
1239 $qm = $this->pc_service->question();
1240 return $qm->resolveQuestionReferences(
1241 $this->getDomDoc(),
1242 $a_mapping
1243 );
1244 }

◆ resolveResources()

ilPageObject::resolveResources ( array  $ref_mapping)

Resolve resources.

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

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

2993 : bool
2994 {
2995 return ilPCResources::resolveResources($this, $ref_mapping);
2996 }
static resolveResources(ilPageObject $page, array $ref_mappings)

References ilPCResources\resolveResources().

+ 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 2579 of file class.ilPageObject.php.

2583 : void {
2584 $cm = $this->getContentManager();
2585 $cm->setInitialOpenedContent($a_type, $a_id, $a_target);
2586 $this->update();
2587 }

◆ saveInternalLinks()

ilPageObject::saveInternalLinks ( DOMDocument  $a_domdoc)

save internal links of page

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

Reimplemented in ilWikiPage.

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

1777 : void
1778 {
1779 $this->link->saveInternalLinks(
1780 $this,
1781 $a_domdoc
1782 );
1783 }

References ILIAS\Repository\link().

+ Here is the call graph for this function:

◆ saveStyleUsage()

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

Save all style class/template usages.

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

1729 : void {
1730 $this->style_manager->saveStyleUsage(
1731 $this,
1732 $a_domdoc,
1733 $a_old_nr
1734 );
1735 }

◆ sendParagraph()

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

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

2028 : void {
2029 $this->pc_service->paragraph()->send(
2030 $this->getDomDoc(),
2031 $par_id,
2032 $filename
2033 );
2034 }
$filename
Definition: buildRTE.php:78

◆ setActivationEnd()

ilPageObject::setActivationEnd ( ?string  $a_activationend)

Set Activation End.

Parameters
string$a_activationendIL_CAL_DATETIME format

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

698 : void
699 {
700 if ($a_activationend == "") {
701 $a_activationend = null;
702 }
703 $this->activationend = $a_activationend;
704 }

◆ setActivationStart()

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

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

681 : void
682 {
683 if ($a_activationstart == "") {
684 $a_activationstart = null;
685 }
686 $this->activationstart = $a_activationstart;
687 }

◆ setActive()

ilPageObject::setActive ( bool  $a_active)

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

471 : void
472 {
473 $this->active = $a_active;
474 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setConcreteLang()

ilPageObject::setConcreteLang ( string  $a_val)

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

213 : void
214 {
215 $this->concrete_lang = $a_val;
216 }

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

1023 : void
1024 {
1025 $this->contains_int_link = $a_contains_link;
1026 }

◆ setContainsQuestion()

ilPageObject::setContainsQuestion ( bool  $a_val)

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

1060 : void
1061 {
1062 $this->contains_question = $a_val;
1063 }

◆ setContentIdManager()

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

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

177 : void {
178 $this->content_id_manager = $content_id_manager;
179 }
ILIAS COPage ID ContentIdManager $content_id_manager

Referenced by COPageTestBase\getEmptyPageWithDom().

+ Here is the caller graph for this function:

◆ setCopyProperties()

ilPageObject::setCopyProperties ( ilPageObject  $new_page)
protected

Reimplemented in ilWikiPage.

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

2659 : void
2660 {
2661 }

◆ setEmptyPageXml()

ilPageObject::setEmptyPageXml ( )

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

1284 : void
1285 {
1286 $this->setXMLContent("<PageObject></PageObject>");
1287 }

◆ setId()

ilPageObject::setId ( int  $a_id)

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

426 : void
427 {
428 $this->id = $a_id;
429 }

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

+ Here is the caller graph for this function:

◆ setImportMode()

ilPageObject::setImportMode ( bool  $a_val)

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

1038 : void
1039 {
1040 $this->import_mode = $a_val;
1041 }

◆ setLanguage()

ilPageObject::setLanguage ( string  $a_val)

Set language.

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

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

198 : void
199 {
200 $this->language = $a_val;
201 }

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

Referenced by __construct().

+ 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 258 of file class.ilPageObject.php.

258 : void
259 {
260 $this->lastchange = $a_lastchange;
261 }

◆ setLastChangeUser()

ilPageObject::setLastChangeUser ( int  $a_val)

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

268 : void
269 {
270 $this->last_change_user = $a_val;
271 }

◆ setPageConfig()

ilPageObject::setPageConfig ( ilPageConfig  $a_val)

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

208 : void
209 {
210 $this->page_config = $a_val;
211 }

Referenced by ilUnitTestPageObject\initPageConfig().

+ Here is the caller graph for this function:

◆ setParentId()

ilPageObject::setParentId ( int  $a_id)

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

436 : void
437 {
438 $this->parent_id = $a_id;
439 }

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

+ Here is the caller graph for this function:

◆ setRenderedContent()

ilPageObject::setRenderedContent ( string  $a_renderedcontent)

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

238 : void
239 {
240 $this->renderedcontent = $a_renderedcontent;
241 }

◆ setRenderedTime()

ilPageObject::setRenderedTime ( string  $a_renderedtime)

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

248 : void
249 {
250 $this->renderedtime = $a_renderedtime;
251 }

◆ setRenderMd5()

ilPageObject::setRenderMd5 ( string  $a_rendermd5)

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

228 : void
229 {
230 $this->rendermd5 = $a_rendermd5;
231 }

◆ setShowActivationInfo()

ilPageObject::setShowActivationInfo ( bool  $a_val)

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

278 : void
279 {
280 $this->show_page_act_info = $a_val;
281 }

◆ setTranslationProperties()

ilPageObject::setTranslationProperties ( self  $transl_page)
protected

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

2703 : void
2704 {
2705 $transl_page->setId($this->getId());
2706 $transl_page->setParentId($this->getParentId());
2707 $transl_page->setXMLContent($this->copyXmlContent());
2708 $transl_page->setActive($this->getActive());
2709 $transl_page->setActivationStart($this->getActivationStart());
2710 $transl_page->setActivationEnd($this->getActivationEnd());
2711 }
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.

References ILIAS\Survey\Mode\getId().

+ Here is the call 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 772 of file class.ilPageObject.php.

772 : void
773 {
774 $this->encoding = $a_encoding;
775 $this->xml = $a_xml;
776 }

Referenced by COPageTestBase\getEmptyPageWithDom().

+ Here is the caller graph for this function:

◆ stripHierIDs()

ilPageObject::stripHierIDs ( )

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

1141 : void
1142 {
1143 $this->content_id_manager->stripHierIDsFromDom();
1144 }

Referenced by ilPCParagraph\getLastSavedPCId().

+ Here is the caller graph for this function:

◆ stripPCIDs()

ilPageObject::stripPCIDs ( )

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

1146 : void
1147 {
1148 $this->content_id_manager->stripPCIDs();
1149 }

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

1890 : array|bool {
1891 $cm = $this->page_manager->content($this->getDomDoc());
1892 $cm->switchEnableMultiple($this, $a_hids, $a_self_ass);
1893 if ($a_update) {
1894 return $this->update();
1895 }
1896 return true;
1897 }

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

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

References ilStr\shortenText().

Referenced by ilLearningModuleNotification\getPreviewText().

+ 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

Reimplemented in ilUnitTestPageObject, ilPortfolioPage, and ilWikiPage.

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

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

References $lm_set, ilDatePresentation\formatDate(), ILIAS\Survey\Mode\getId(), getLanguage(), ilUserUtil\getNamePresentation(), IL_CAL_UNIX, ILIAS_VERSION_NUMERIC, ILIAS\Repository\lng(), ilUtil\now(), and ILIAS\Repository\user().

Referenced by ilContainerPage\addRepositoryBlockToPage(), ILIAS\COPage\PC\Paragraph\ParagraphCommandActionHandler\cancelCommand(), ilQuestionPageParser\processPagesToParse(), ilContainerPage\removeUnsupportedBlockIds(), and ilPCParagraph\updatePage().

+ 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 1337 of file class.ilPageObject.php.

1337 : bool
1338 {
1339 $this->log->debug("ilPageObject, updateFromXML(): start, id: " . $this->getId());
1340
1341 $content = $this->getXMLContent();
1342
1343 $this->log->debug("ilPageObject, updateFromXML(): content: " . substr($content, 0, 100));
1344
1345 $this->buildDom(true);
1346 $dom_doc = $this->getDomDoc();
1347
1348 $errors = $this->validateDom(true);
1349
1350 $iel = $this->containsDeactivatedElements($content);
1351 $inl = $this->containsIntLinks($content);
1352
1353 $this->db->update("page_object", array(
1354 "content" => array("clob", $content),
1355 "parent_id" => array("integer", $this->getParentId()),
1356 "last_change_user" => array("integer", $this->user->getId()),
1357 "last_change" => array("timestamp", ilUtil::now()),
1358 "active" => array("integer", $this->getActive()),
1359 "activation_start" => array("timestamp", $this->getActivationStart()),
1360 "activation_end" => array("timestamp", $this->getActivationEnd()),
1361 "inactive_elements" => array("integer", $iel),
1362 "int_links" => array("integer", $inl),
1363 ), array(
1364 "page_id" => array("integer", $this->getId()),
1365 "parent_type" => array("text", $this->getParentType()),
1366 "lang" => array("text", $this->getLanguage())
1367 ));
1368
1369 // after update event
1370 $this->__afterUpdate($dom_doc, $content);
1371
1372 $this->log->debug("ilPageObject, updateFromXML(): end");
1373
1374 return true;
1375 }

References ILIAS\Survey\Mode\getId(), getLanguage(), ilUtil\now(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ validateDom()

ilPageObject::validateDom ( bool  $throw = false)

Validate the page content agains page DTD.

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

1116 : ?array
1117 {
1118 $this->stripHierIDs();
1119
1120 // possible fix for #14820
1121 //libxml_disable_entity_loader(false);
1122
1123 $error = null;
1124 $this->dom_util->validate($this->dom, $error, $throw);
1125 return $error;
1126 }

◆ writeRenderedContent()

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

Write rendered content.

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

2498 : void {
2499 global $DIC;
2500
2501 $db = $DIC->database();
2502
2503 $db->update("page_object", array(
2504 "rendered_content" => array("clob", $a_content),
2505 "render_md5" => array("text", $a_md5),
2506 "rendered_time" => array("timestamp", ilUtil::now())
2507 ), array(
2508 "page_id" => array("integer", $this->getId()),
2509 "lang" => array("text", $this->getLanguage()),
2510 "parent_type" => array("text", $this->getParentType())
2511 ));
2512 }
update(string $table_name, array $values, array $where)
@description $where MUST contain existing columns only.

Field Documentation

◆ $activation_data

array ilPageObject::$activation_data = array()
staticprotected

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

◆ $activationend

string ilPageObject::$activationend = null
protected

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

◆ $activationstart

string ilPageObject::$activationstart = null
protected

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

◆ $active

bool ilPageObject::$active = false
protected

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

◆ $concrete_lang

string ilPageObject::$concrete_lang = ""
protected

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

◆ $contains_int_link

bool ilPageObject::$contains_int_link = false

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

◆ $contains_question

bool ilPageObject::$contains_question = false
protected

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

◆ $content_id_manager

ILIAS COPage ID ContentIdManager ilPageObject::$content_id_manager
protected

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

◆ $create_user

int ilPageObject::$create_user = 0
protected

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

◆ $cur_dtd

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

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

◆ $db

ilDBInterface ilPageObject::$db
protected

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

Referenced by ilWikiPage\createFromXML().

◆ $dom

DOMDocument ilPageObject::$dom = null

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

◆ $dom_builded

bool ilPageObject::$dom_builded = false

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

◆ $dom_util

ILIAS COPage Dom DomUtil ilPageObject::$dom_util
protected

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

◆ $domain

ILIAS COPage InternalDomainService ilPageObject::$domain
protected

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

Referenced by __construct().

◆ $encoding

string ilPageObject::$encoding = ""

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

◆ $exists

array ilPageObject::$exists = array()
static

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

◆ $hier_ids

array ilPageObject::$hier_ids = []
protected

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

◆ $history_saved

bool ilPageObject::$history_saved = false

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

◆ $id

◆ $id_elements

array ilPageObject::$id_elements
protected

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

◆ $import_mode

bool ilPageObject::$import_mode = false
protected

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

◆ $language

string ilPageObject::$language = "-"
protected

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

◆ $last_change_user

int ilPageObject::$last_change_user = 0

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

◆ $lastchange

string ilPageObject::$lastchange = ""
protected

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

◆ $link

ILIAS COPage Link LinkManager ilPageObject::$link
protected

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

◆ $lng

ilLanguage ilPageObject::$lng
protected

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

Referenced by ilPortfolioPage\getTitle().

◆ $log

ilLogger ilPageObject::$log
protected

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

◆ $lom_services

LOMServices ilPageObject::$lom_services
protected

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

◆ $needs_parsing

bool ilPageObject::$needs_parsing = false

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

◆ $node

DomNode ilPageObject::$node

◆ $obj_definition

ilObjectDefinition ilPageObject::$obj_definition
protected

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

◆ $offline_handler

object ilPageObject::$offline_handler = null

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

◆ $old_nr

int ilPageObject::$old_nr

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

◆ $page_config

ilPageConfig ilPageObject::$page_config
protected

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

◆ $page_manager

ILIAS COPage Page PageManagerInterface ilPageObject::$page_manager
protected

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

◆ $page_not_found

bool ilPageObject::$page_not_found = false
protected

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

◆ $page_record

array ilPageObject::$page_record = array()
protected

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

◆ $parent_id

int ilPageObject::$parent_id = 0

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

◆ $parent_type

string ilPageObject::$parent_type = ""

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

Referenced by ilDashboardPage\getParentType().

◆ $pc_definition

ILIAS COPage PC PCDefinition ilPageObject::$pc_definition
protected

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

◆ $pc_service

ILIAS COPage PC DomainService ilPageObject::$pc_service
protected

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

◆ $reading_time_manager

ILIAS COPage ReadingTime ReadingTimeManager ilPageObject::$reading_time_manager
protected

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

◆ $renderedcontent

string ilPageObject::$renderedcontent = ""
protected

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

◆ $renderedtime

string ilPageObject::$renderedtime = ""
protected

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

◆ $rendermd5

string ilPageObject::$rendermd5 = ""
protected

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

◆ $show_page_act_info

bool ilPageObject::$show_page_act_info = false
protected

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

◆ $style_manager

ILIAS COPage Style StyleManager ilPageObject::$style_manager
protected

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

◆ $tree

ilTree ilPageObject::$tree
protected

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

◆ $update_listener_cnt

int ilPageObject::$update_listener_cnt = 0

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

◆ $update_listeners

array ilPageObject::$update_listeners = []

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

◆ $user

ilObjUser ilPageObject::$user
protected

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

◆ $xml

string ilPageObject::$xml = ""

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


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