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

Static Protected Attributes

static array $activation_data = array()
 

Detailed Description

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

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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

1690 : void
1691 {
1692 $this->afterDelete();
1693 }

◆ __afterHistoryEntry()

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

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

1703 : void {
1704 // save style usage
1705 $this->saveStyleUsage($a_old_domdoc, $a_old_nr);
1706
1707 // pc classes hook
1708 $defs = $this->pc_definition->getPCDefinitions();
1709 foreach ($defs as $def) {
1710 $cl = $def["pc_class"];
1711 call_user_func(
1712 $def["pc_class"] . '::afterPageHistoryEntry',
1713 $this,
1714 $a_old_domdoc,
1715 $a_old_content,
1716 $a_old_nr
1717 );
1718 }
1719 }
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 1379 of file class.ilPageObject.php.

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

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

◆ _exists()

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

Checks whether page exists.

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

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

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

373 : bool {
374 return ilPageUtil::_existsAndNotEmpty($a_parent_type, $a_id, $a_lang);
375 }
static _existsAndNotEmpty(string $a_parent_type, int $a_id, string $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)

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

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

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

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

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

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

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

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

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

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

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

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

◆ addHierIDs()

◆ addUpdateListener()

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

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

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

◆ afterConstructor()

ilPageObject::afterConstructor ( )

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

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

177 : void
178 {
179 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ afterDelete()

ilPageObject::afterDelete ( )
protected

Reimplemented in ilLMPage.

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

1695 : void
1696 {
1697 }

◆ afterUpdate()

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

After update.

Reimplemented in ilLMPage, and ilWikiPage.

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

1416 : void
1417 {
1418 }

◆ appendXMLContent()

ilPageObject::appendXMLContent ( string  $a_xml)
   append xml content to page
   setXMLContent must be called before and the same encoding must be used

s

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

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

◆ assignCharacteristic()

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

Assign characteristic.

Returns
array|bool
Exceptions
ilCOPagePCEditException
ilCOPageUnknownPCTypeException
ilDateTimeException

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

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

2601 : void
2602 {
2603 }

Referenced by ilPCParagraph\updatePage().

+ Here is the caller graph for this function:

◆ buildDom()

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

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

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

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

◆ checkPCIds()

ilPageObject::checkPCIds ( )

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

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

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

◆ collectMediaObjects()

ilPageObject::collectMediaObjects ( bool  $a_inline_only = true)

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

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

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

◆ containsDeactivatedElements()

ilPageObject::containsDeactivatedElements ( string  $a_content)

Check whether content contains deactivated elements.

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

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

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

1031 : bool
1032 {
1034 }

◆ containsIntLinks()

ilPageObject::containsIntLinks ( string  $a_content)

Check whether content contains internal links.

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

2552 : bool
2553 {
2554 if (strpos($a_content, "IntLink")) {
2555 return true;
2556 }
2557 return false;
2558 }

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

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

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

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

2689 : void {
2690 $transl_page = ilPageObjectFactory::getInstance(
2691 $this->getParentType(),
2692 0,
2693 0,
2694 $a_target_lang
2695 );
2696 $this->setTranslationProperties($transl_page);
2697 $transl_page->create(false);
2698 }
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 815 of file class.ilPageObject.php.

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

◆ create()

ilPageObject::create ( bool  $a_import = false)

create new page (with current xml data)

Reimplemented in ilBlogPosting, ilPortfolioPage, and ilWikiPage.

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

1786 : void
1787 {
1788 $this->createFromXML();
1789 }
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 1290 of file class.ilPageObject.php.

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

1838 {
1839 $this->copyContents($a_hids);
1840 return $this->deleteContents(
1841 $a_hids,
1842 true,
1843 $this->getPageConfig()->getEnableSelfAssessment(),
1844 true
1845 );
1846 }
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 1588 of file class.ilPageObject.php.

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

1802 {
1803 $pm = $this->page_manager->content($this->getDomDoc());
1804 $pm->deleteContent($this, $a_hid, $a_pcid, $move_operation);
1805 if ($a_update) {
1806 return $this->update();
1807 }
1808 return true;
1809 }

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

1823 {
1824 $pm = $this->page_manager->content($this->getDomDoc());
1825 $pm->deleteContents($this, $a_hids, $a_self_ass, $move_operation);
1826 if ($a_update) {
1827 return $this->update();
1828 }
1829 return true;
1830 }

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

1765 : void
1766 {
1767 $this->link->deleteInternalLinks($this);
1768 }

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

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

◆ freeDom()

ilPageObject::freeDom ( )

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

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

◆ generatePCId()

ilPageObject::generatePCId ( )

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

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

◆ getActivationEnd()

ilPageObject::getActivationEnd ( )

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

704 : ?string
705 {
707 }

◆ getActivationStart()

ilPageObject::getActivationStart ( )

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

687 : ?string
688 {
690 }

◆ getActive()

ilPageObject::getActive ( bool  $a_check_scheduled_activation = false)

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

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

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

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

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

Referenced by ilDclDetailedViewDefinition\isActive().

+ Here is the caller graph for this function:

◆ getConcreteLang()

ilPageObject::getConcreteLang ( )

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

213 : string
214 {
216 }

◆ getContainsQuestion()

ilPageObject::getContainsQuestion ( )

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

1063 : bool
1064 {
1066 }

◆ getContentDomNode()

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

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

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

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

2568 {
2569 $this->buildDom();
2570 return $this->page_manager->content($this->getDomDoc());
2571 }

◆ getContentObject()

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

Get a content object of the page.

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

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

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

+ Here is the caller graph for this function:

◆ getContentObjectForPcId()

ilPageObject::getContentObjectForPcId ( string  $pcid)

Get content object for pc id.

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

728 {
729 $hier_ids = $this->getHierIdsForPCIds([$pcid]);
730 return $this->getContentObject($hier_ids[$pcid], $pcid);
731 }
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 2940 of file class.ilPageObject.php.

2940 : array
2941 {
2942 return array();
2943 }

◆ getCreationUserId()

ilPageObject::getCreationUserId ( )

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

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

◆ getDomDoc()

◆ getDomNodeForPCId()

ilPageObject::getDomNodeForPCId ( string  $pc_id)

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

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

◆ getDuplicatePCIds()

ilPageObject::getDuplicatePCIds ( )

Get all duplicate PC Ids.

Returns
int[]

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

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

◆ getEditLock()

ilPageObject::getEditLock ( )

Get page lock.

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

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

2790 : array
2791 {
2792 $db = $this->db;
2793
2794 $aset = new ilSetting("adve");
2795 $min = (int) $aset->get("block_mode_minutes");
2796
2797 $set = $db->query(
2798 "SELECT edit_lock_user, edit_lock_ts FROM page_object " .
2799 " WHERE page_id = " . $db->quote($this->getId(), "integer") .
2800 " AND parent_type = " . $db->quote($this->getParentType(), "text")
2801 );
2802 $rec = $db->fetchAssoc($set);
2803 $rec["edit_lock_until"] = $rec["edit_lock_ts"] + $min * 60;
2804
2805 return $rec;
2806 }
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 2974 of file class.ilPageObject.php.

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

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getFirstParagraphText()

ilPageObject::getFirstParagraphText ( )

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

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

◆ getHierIdForPcId()

ilPageObject::getHierIdForPcId ( string  $pcid)

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

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

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

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

◆ getHierIdsForPCIds()

ilPageObject::getHierIdsForPCIds ( array  $a_pc_ids)

Get hier ids for a set of pc ids.

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

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

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

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

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

2113 : ?array
2114 {
2115 $db = $this->db;
2116
2117 $res = $db->queryF(
2118 "SELECT * FROM page_history " .
2119 " WHERE page_id = %s " .
2120 " AND parent_type = %s " .
2121 " AND nr = %s" .
2122 " AND lang = %s",
2123 array("integer", "text", "integer", "text"),
2124 array($this->getId(), $this->getParentType(), $a_old_nr, $this->getLanguage())
2125 );
2126 if ($hrec = $db->fetchAssoc($res)) {
2127 return $hrec;
2128 }
2129
2130 return null;
2131 }
$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 2138 of file class.ilPageObject.php.

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

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

805 : string
806 {
807 return ILIAS_ABSOLUTE_PATH;
808 }

◆ getImportMode()

ilPageObject::getImportMode ( )

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

1041 : bool
1042 {
1043 return $this->import_mode;
1044 }

◆ getInitialOpenedContent()

ilPageObject::getInitialOpenedContent ( )

Get initial opened content.

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

2589 : array
2590 {
2591 $cm = $this->getContentManager();
2592 return $cm->getInitialOpenedContent();
2593 }

◆ getInternalLinks()

ilPageObject::getInternalLinks ( )

get all internal links that are used within the page

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

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

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

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

References $txt.

◆ getLangVarXML()

ilPageObject::getLangVarXML ( string  $var)
protected

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

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

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getLangVarXMLForValue()

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

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

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

◆ getLastChange()

ilPageObject::getLastChange ( )

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

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

◆ getLastChangeByParent()

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

Get all pages for parent object.

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

2952 : string {
2953 global $DIC;
2954
2955 $db = $DIC->database();
2956
2957 $and_lang = "";
2958 if ($a_lang != "") {
2959 $and_lang = " AND lang = " . $db->quote($a_lang, "text");
2960 }
2961
2962 $db->setLimit(1, 0);
2963 $q = "SELECT last_change FROM page_object " .
2964 " WHERE parent_id = " . $db->quote($a_parent_id, "integer") .
2965 " AND parent_type = " . $db->quote($a_parent_type, "text") . $and_lang .
2966 " ORDER BY last_change DESC";
2967
2968 $set = $db->query($q);
2969 $rec = $db->fetchAssoc($set);
2970
2971 return $rec["last_change"];
2972 }
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 268 of file class.ilPageObject.php.

268 : int
269 {
271 }

◆ getLastUpdateOfIncludedElements()

ilPageObject::getLastUpdateOfIncludedElements ( )

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

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

Todo:
: move to content include class

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

1748 : string
1749 {
1751 $this->getParentType() . ":pg",
1752 $this->getId()
1753 );
1754 $files = ilObjFile::_getFilesOfObject(
1755 $this->getParentType() . ":pg",
1756 $this->getId()
1757 );
1758 $objs = array_merge($mobs, $files);
1760 }
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 1101 of file class.ilPageObject.php.

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

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

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

◆ getNewPages()

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

Get new pages.

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

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

References ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getOfflineHandler()

ilPageObject::getOfflineHandler ( )

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

2039 : ?object
2040 {
2042 }

◆ getPageConfig()

ilPageObject::getPageConfig ( )

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

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

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

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

References ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getParagraphForPCID()

ilPageObject::getParagraphForPCID ( string  $pcid)

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

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

◆ getParentContentObjectForPcId()

ilPageObject::getParentContentObjectForPcId ( string  $pcid)

Get parent content object for pc id.

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

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

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

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

References ilDBInterface\quote().

+ Here is the call graph for this function:

◆ getParentType()

◆ getPCIdForHierId()

ilPageObject::getPCIdForHierId ( string  $hier_id)

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

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

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

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

◆ getPCModel()

ilPageObject::getPCModel ( )

Get page component model.

Returns
array

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

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

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

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

238 : string
239 {
241 }

◆ getRenderedTime()

ilPageObject::getRenderedTime ( )

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

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

◆ getRenderMd5()

ilPageObject::getRenderMd5 ( )

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

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

◆ getRepoObjId()

ilPageObject::getRepoObjId ( )

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

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

2998 : ?int
2999 {
3000 return $this->getParentId();
3001 }

◆ getShowActivationInfo()

ilPageObject::getShowActivationInfo ( )

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

278 : bool
279 {
281 }

◆ getXMLContent()

ilPageObject::getXMLContent ( bool  $a_incl_head = false)

get xml content of page

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

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

◆ getXMLFromDom()

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

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

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

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

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

◆ handleRepositoryLinksOnCopy()

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

Handle repository links on copy process.

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

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

◆ hasDuplicatePCIds()

ilPageObject::hasDuplicatePCIds ( )

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

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

◆ increaseViewCnt()

ilPageObject::increaseViewCnt ( )

Increase view cnt.

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

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

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

+ Here is the call graph for this function:

◆ initPageConfig()

ilPageObject::initPageConfig ( )

Reimplemented in ilUnitTestPageObject.

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

183 : void
184 {
186 $this->setPageConfig($cfg);
187 }
static getConfigInstance(string $a_parent_type)
Get page config instance.
setPageConfig(ilPageConfig $a_val)

References ilPageObjectFactory\getConfigInstance().

Referenced by __construct().

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

◆ insertContent()

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

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

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

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

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

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

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

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

◆ insertPCIds()

ilPageObject::insertPCIds ( )

Insert Page Content IDs.

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

2018 : void
2019 {
2020 $this->content_id_manager->insertPCIds();
2021 }

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

+ Here is the caller graph for this function:

◆ isTranslationPage()

ilPageObject::isTranslationPage ( )
protected

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

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

References getLanguage().

+ Here is the call graph for this function:

◆ lookupParentId()

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

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

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

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

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

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

1954 {
1955 $cm = $this->page_manager->content($this->getDomDoc());
1956 $cm->moveContentAfter(
1957 $this,
1958 $a_source,
1959 $a_target,
1960 $a_spcid,
1961 $a_tpcid
1962 );
1963 return $this->update();
1964 }

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

1249 : bool
1250 {
1251 $this->buildDom();
1252 $this->addHierIDs();
1253 return $this->link->moveIntLinks(
1254 $this->getDomDoc(),
1255 $a_from_to
1256 );
1257 }
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 1046 of file class.ilPageObject.php.

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

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

1865 {
1867 $cm = $this->page_manager->content($this->getDomDoc());
1868 $cm->pasteContents(
1869 $user,
1870 $a_hier_id,
1871 $this,
1872 $a_self_ass
1873 );
1874 return $this->update();
1875 }

◆ performAutomaticModifications()

ilPageObject::performAutomaticModifications ( )

Perform automatic modifications (may be overwritten by sub classes)

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

2563 : void
2564 {
2565 }

◆ preloadActivationDataByParentId()

static ilPageObject::preloadActivationDataByParentId ( int  $a_parent_id)
static

Preload activation data by Parent Id.

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

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

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

2198 : void
2199 {
2200 }

◆ read()

ilPageObject::read ( )

Read page data.

Reimplemented in ilBlogPosting, and ilPortfolioPage.

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

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

2034 : void
2035 {
2036 $this->offline_handler = $handler;
2037 }
$handler
Definition: oai.php:29

References $handler.

◆ releasePageLock()

ilPageObject::releasePageLock ( )

Release page lock.

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

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

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

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

◆ resolveIIMMediaAliases()

ilPageObject::resolveIIMMediaAliases ( array  $a_mapping)

Resolve iim media aliases (in ilContObjParse)

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

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

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

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

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

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

◆ resolveQuestionReferences()

ilPageObject::resolveQuestionReferences ( array  $a_mapping)

Resolve all quesiont references (after import)

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

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

◆ resolveResources()

ilPageObject::resolveResources ( array  $ref_mapping)

Resolve resources.

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

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

2990 : bool
2991 {
2992 return ilPCResources::resolveResources($this, $ref_mapping);
2993 }
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 2576 of file class.ilPageObject.php.

2580 : void {
2581 $cm = $this->getContentManager();
2582 $cm->setInitialOpenedContent($a_type, $a_id, $a_target);
2583 $this->update();
2584 }

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

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

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

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

◆ sendParagraph()

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

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

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

◆ setActivationEnd()

ilPageObject::setActivationEnd ( ?string  $a_activationend)

Set Activation End.

Parameters
string$a_activationendIL_CAL_DATETIME format

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

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

◆ setActivationStart()

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

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

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

◆ setActive()

ilPageObject::setActive ( bool  $a_active)

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

469 : void
470 {
471 $this->active = $a_active;
472 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setConcreteLang()

ilPageObject::setConcreteLang ( string  $a_val)

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

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

◆ setContainsIntLink()

ilPageObject::setContainsIntLink ( bool  $a_contains_link)

lm parser set this flag to true, if the page contains intern links (this method should only be called by the import parser) todo: move to ilLMPageObject !?

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

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

1021 : void
1022 {
1023 $this->contains_int_link = $a_contains_link;
1024 }

◆ setContainsQuestion()

ilPageObject::setContainsQuestion ( bool  $a_val)

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

1058 : void
1059 {
1060 $this->contains_question = $a_val;
1061 }

◆ setContentIdManager()

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

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

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

◆ setCopyProperties()

ilPageObject::setCopyProperties ( ilPageObject  $new_page)
protected

Reimplemented in ilWikiPage.

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

2656 : void
2657 {
2658 }

◆ setEmptyPageXml()

ilPageObject::setEmptyPageXml ( )

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

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

◆ setId()

ilPageObject::setId ( int  $a_id)

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

424 : void
425 {
426 $this->id = $a_id;
427 }

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

+ Here is the caller graph for this function:

◆ setImportMode()

ilPageObject::setImportMode ( bool  $a_val)

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

1036 : void
1037 {
1038 $this->import_mode = $a_val;
1039 }

◆ setLanguage()

ilPageObject::setLanguage ( string  $a_val)

Set language.

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

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

193 : void
194 {
195 $this->language = $a_val;
196 }

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

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

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

◆ setLastChange()

ilPageObject::setLastChange ( string  $a_lastchange)

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

253 : void
254 {
255 $this->lastchange = $a_lastchange;
256 }

◆ setLastChangeUser()

ilPageObject::setLastChangeUser ( int  $a_val)

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

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

◆ setPageConfig()

ilPageObject::setPageConfig ( ilPageConfig  $a_val)

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

203 : void
204 {
205 $this->page_config = $a_val;
206 }

Referenced by ilUnitTestPageObject\initPageConfig().

+ Here is the caller graph for this function:

◆ setParentId()

ilPageObject::setParentId ( int  $a_id)

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

434 : void
435 {
436 $this->parent_id = $a_id;
437 }

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

+ Here is the caller graph for this function:

◆ setRenderedContent()

ilPageObject::setRenderedContent ( string  $a_renderedcontent)

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

233 : void
234 {
235 $this->renderedcontent = $a_renderedcontent;
236 }

◆ setRenderedTime()

ilPageObject::setRenderedTime ( string  $a_renderedtime)

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

243 : void
244 {
245 $this->renderedtime = $a_renderedtime;
246 }

◆ setRenderMd5()

ilPageObject::setRenderMd5 ( string  $a_rendermd5)

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

223 : void
224 {
225 $this->rendermd5 = $a_rendermd5;
226 }

◆ setShowActivationInfo()

ilPageObject::setShowActivationInfo ( bool  $a_val)

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

273 : void
274 {
275 $this->show_page_act_info = $a_val;
276 }

◆ setTranslationProperties()

ilPageObject::setTranslationProperties ( self  $transl_page)
protected

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

2700 : void
2701 {
2702 $transl_page->setId($this->getId());
2703 $transl_page->setParentId($this->getParentId());
2704 $transl_page->setXMLContent($this->copyXmlContent());
2705 $transl_page->setActive($this->getActive());
2706 $transl_page->setActivationStart($this->getActivationStart());
2707 $transl_page->setActivationEnd($this->getActivationEnd());
2708 }
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 770 of file class.ilPageObject.php.

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

◆ stripHierIDs()

ilPageObject::stripHierIDs ( )

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

1139 : void
1140 {
1141 $this->content_id_manager->stripHierIDsFromDom();
1142 }

Referenced by ilPCParagraph\getLastSavedPCId().

+ Here is the caller graph for this function:

◆ stripPCIDs()

ilPageObject::stripPCIDs ( )

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

1144 : void
1145 {
1146 $this->content_id_manager->stripPCIDs();
1147 }

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

1888 {
1889 $cm = $this->page_manager->content($this->getDomDoc());
1890 $cm->switchEnableMultiple($this, $a_hids, $a_self_ass);
1891 if ($a_update) {
1892 return $this->update();
1893 }
1894 return true;
1895 }

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

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

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

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

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

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

◆ writeRenderedContent()

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

Write rendered content.

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

2495 : void {
2496 global $DIC;
2497
2498 $db = $DIC->database();
2499
2500 $db->update("page_object", array(
2501 "rendered_content" => array("clob", $a_content),
2502 "render_md5" => array("text", $a_md5),
2503 "rendered_time" => array("timestamp", ilUtil::now())
2504 ), array(
2505 "page_id" => array("integer", $this->getId()),
2506 "lang" => array("text", $this->getLanguage()),
2507 "parent_type" => array("text", $this->getParentType())
2508 ));
2509 }
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 88 of file class.ilPageObject.php.

◆ $activationend

string ilPageObject::$activationend = null
protected

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

◆ $activationstart

string ilPageObject::$activationstart = null
protected

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

◆ $active

bool ilPageObject::$active = false
protected

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

◆ $concrete_lang

ilPageObject::$concrete_lang = ""
protected

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

◆ $contains_int_link

bool ilPageObject::$contains_int_link = false

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

◆ $contains_question

bool ilPageObject::$contains_question = false
protected

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

◆ $content_id_manager

ILIAS COPage ID ContentIdManager ilPageObject::$content_id_manager
protected

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

◆ $create_user

int ilPageObject::$create_user = 0
protected

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

◆ $cur_dtd

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

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

◆ $db

ilDBInterface ilPageObject::$db
protected

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

Referenced by ilWikiPage\createFromXML().

◆ $dom

DOMDocument ilPageObject::$dom = null

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

◆ $dom_builded

bool ilPageObject::$dom_builded = false

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

◆ $dom_util

ILIAS COPage Dom DomUtil ilPageObject::$dom_util
protected

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

◆ $encoding

string ilPageObject::$encoding = ""

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

◆ $exists

array ilPageObject::$exists = array()
static

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

◆ $hier_ids

array ilPageObject::$hier_ids = []
protected

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

◆ $history_saved

bool ilPageObject::$history_saved = false

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

◆ $id

◆ $id_elements

array ilPageObject::$id_elements
protected

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

◆ $import_mode

bool ilPageObject::$import_mode = false
protected

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

◆ $language

string ilPageObject::$language = "-"
protected

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

◆ $last_change_user

int ilPageObject::$last_change_user = 0

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

◆ $lastchange

string ilPageObject::$lastchange = ""
protected

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

◆ $link

ILIAS COPage Link LinkManager ilPageObject::$link
protected

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

◆ $lng

ilLanguage ilPageObject::$lng
protected

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

Referenced by ilPortfolioPage\getTitle().

◆ $log

ilLogger ilPageObject::$log
protected

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

◆ $lom_services

LOMServices ilPageObject::$lom_services
protected

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

◆ $needs_parsing

bool ilPageObject::$needs_parsing = false

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

◆ $node

DomNode ilPageObject::$node

◆ $obj_definition

ilObjectDefinition ilPageObject::$obj_definition
protected

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

◆ $offline_handler

object ilPageObject::$offline_handler = null

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

◆ $old_nr

int ilPageObject::$old_nr

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

◆ $page_config

ilPageConfig ilPageObject::$page_config
protected

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

◆ $page_manager

ILIAS COPage Page PageManager ilPageObject::$page_manager
protected

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

◆ $page_not_found

bool ilPageObject::$page_not_found = false
protected

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

◆ $page_record

array ilPageObject::$page_record = array()
protected

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

◆ $parent_id

int ilPageObject::$parent_id = 0

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

◆ $parent_type

string ilPageObject::$parent_type = ""

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

Referenced by ilDashboardPage\getParentType().

◆ $pc_definition

ILIAS COPage PC PCDefinition ilPageObject::$pc_definition
protected

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

◆ $pc_service

ILIAS COPage PC DomainService ilPageObject::$pc_service
protected

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

◆ $reading_time_manager

ILIAS COPage ReadingTime ReadingTimeManager ilPageObject::$reading_time_manager
protected

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

◆ $renderedcontent

string ilPageObject::$renderedcontent = ""
protected

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

◆ $renderedtime

string ilPageObject::$renderedtime = ""
protected

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

◆ $rendermd5

string ilPageObject::$rendermd5 = ""
protected

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

◆ $show_page_act_info

bool ilPageObject::$show_page_act_info = false
protected

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

◆ $style_manager

ILIAS COPage Style StyleManager ilPageObject::$style_manager
protected

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

◆ $tree

ilTree ilPageObject::$tree
protected

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

◆ $update_listener_cnt

int ilPageObject::$update_listener_cnt = 0

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

◆ $update_listeners

array ilPageObject::$update_listeners = []

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

◆ $user

ilObjUser ilPageObject::$user
protected

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

◆ $xml

string ilPageObject::$xml = ""

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


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