ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilPageObject Class Reference

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

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

Public Member Functions

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

s More...

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

Static Public Member Functions

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

Data Fields

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

Static Public Attributes

static array $exists = array()
 

Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

static array $activation_data = array()
 

Detailed Description

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

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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

Member Function Documentation

◆ __afterDelete()

ilPageObject::__afterDelete ( )
finalprotected

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

References afterDelete().

Referenced by delete().

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

◆ __afterHistoryEntry()

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

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

References saveStyleUsage().

Referenced by update().

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

◆ __afterUpdate()

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

After update event handler (internal).

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

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

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

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

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

◆ __beforeDelete()

ilPageObject::__beforeDelete ( )
finalprotected

Before deletion handler (internal).

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

Referenced by delete().

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

◆ _exists()

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

Checks whether page exists.

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

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

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

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

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

◆ _existsAndNotEmpty()

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

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

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

References ilPageUtil\_existsAndNotEmpty().

Referenced by ilDashboardPageGUI\isLanguageAvailable().

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

◆ _isScheduledActivation()

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

Check whether page is activated by time schedule.

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

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

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

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

◆ _lookupActivationData()

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

Lookup activation data.

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

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

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

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

◆ _lookupActive()

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

lookup activation status

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

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

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

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

◆ _lookupContainsDeactivatedElements()

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

lookup whether page contains deactivated elements

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

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

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

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

◆ _writeActive()

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

write activation status

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

References $DIC, ilDBInterface\manipulateF(), and null.

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

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

◆ _writeParentId()

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

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

References $DIC, and ilDBInterface\manipulateF().

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

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

◆ addFileSizes()

ilPageObject::addFileSizes ( )

add file sizes

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

References getDomDoc().

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

◆ addHierIDs()

ilPageObject::addHierIDs ( )

Add hierarchical ID (e.g.

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

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

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

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

◆ addUpdateListener()

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

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

References $update_listener_cnt.

Referenced by ilBlogPosting\read().

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

◆ afterConstructor()

ilPageObject::afterConstructor ( )

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

References getParentType().

Referenced by __construct().

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

◆ afterDelete()

ilPageObject::afterDelete ( )
protected

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

Referenced by __afterDelete().

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

◆ afterUpdate()

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

After update.

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

Referenced by __afterUpdate().

1406  : void
1407  {
1408  }
+ Here is the caller graph for this function:

◆ appendXMLContent()

ilPageObject::appendXMLContent ( string  $a_xml)

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

s

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

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

◆ assignCharacteristic()

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

Assign characteristic.

Returns
array|bool
Exceptions
ilCOPagePCEditException
ilCOPageUnknownPCTypeException
ilDateTimeException

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

References getContentObject(), and update().

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

◆ beforePageContentUpdate()

ilPageObject::beforePageContentUpdate ( ilPageContent  $a_page_content)

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

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

Referenced by ilPCParagraph\updatePage().

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

◆ buildDom()

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

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

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

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

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

◆ callUpdateListeners()

ilPageObject::callUpdateListeners ( )

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

References $update_listener_cnt.

Referenced by __afterUpdate().

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

◆ checkPCIds()

ilPageObject::checkPCIds ( )

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

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

Referenced by update().

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

◆ collectMediaObjects()

ilPageObject::collectMediaObjects ( bool  $a_inline_only = true)

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

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

References getDomDoc().

Referenced by delete().

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

◆ containsDeactivatedElements()

ilPageObject::containsDeactivatedElements ( string  $a_content)

Check whether content contains deactivated elements.

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

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

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

◆ containsIntLink()

ilPageObject::containsIntLink ( )

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

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

References $contains_int_link.

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

◆ containsIntLinks()

ilPageObject::containsIntLinks ( string  $a_content)

Check whether content contains internal links.

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

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

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

◆ copy()

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

Copy page.

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

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

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

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

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

◆ copyContents()

ilPageObject::copyContents ( array  $a_hids)

Copy contents to clipboard.

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

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

Referenced by cutContents().

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

◆ copyPageToTranslation()

ilPageObject::copyPageToTranslation ( string  $a_target_lang)

Copy page to translation.

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

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

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

◆ copyXmlContent()

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

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

questions)

Returns
string|string[]|null

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

References getXMLContent().

Referenced by setTranslationProperties().

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

◆ create()

ilPageObject::create ( bool  $a_import = false)

create new page (with current xml data)

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

References createFromXML().

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

◆ createFromXML()

ilPageObject::createFromXML ( )

Create new page object with current xml content.

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

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

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

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

◆ cutContents()

ilPageObject::cutContents ( array  $a_hids)

Copy contents to clipboard and cut them from the page.

Returns
array|bool
Exceptions
ilDateTimeException

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

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

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

◆ delete()

ilPageObject::delete ( )

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

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

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

◆ deleteContent()

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

delete content object with hierarchical id $a_hid

Returns
array|bool
Exceptions
ilDateTimeException
ilWACException

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

References getDomDoc(), and update().

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

◆ deleteContents()

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

Delete multiple content objects.

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

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

References getDomDoc(), and update().

Referenced by cutContents().

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

◆ deleteInternalLinks()

ilPageObject::deleteInternalLinks ( )

Delete internal links.

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

References ILIAS\Repository\link().

Referenced by delete().

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

◆ deleteStyleUsages()

ilPageObject::deleteStyleUsages ( int  $a_old_nr = 0)

Delete style usages.

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

Referenced by delete().

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

◆ freeDom()

ilPageObject::freeDom ( )

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

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

◆ generatePCId()

ilPageObject::generatePCId ( )

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

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

◆ getActivationEnd()

ilPageObject::getActivationEnd ( )

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

References $activationend.

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

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

◆ getActivationStart()

ilPageObject::getActivationStart ( )

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

References $activationstart.

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

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

◆ getActive()

ilPageObject::getActive ( bool  $a_check_scheduled_activation = false)

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

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

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

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

◆ getAllPages()

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

Get all pages for parent object.

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

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

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

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

◆ getAllPCIds()

ilPageObject::getAllPCIds ( )

Get all pc ids.

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

Referenced by ilDclDetailedViewDefinition\isActive().

1981  : array
1982  {
1983  return $this->content_id_manager->getAllPCIds();
1984  }
+ Here is the caller graph for this function:

◆ getConcreteLang()

ilPageObject::getConcreteLang ( )

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

References $concrete_lang.

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

◆ getContainsQuestion()

ilPageObject::getContainsQuestion ( )

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

References $contains_question.

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

◆ getContentDomNode()

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

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

References getDomDoc().

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

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

◆ getContentManager()

ilPageObject::getContentManager ( )
protected

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

References buildDom(), and getDomDoc().

Referenced by getInitialOpenedContent(), and saveInitialOpenedContent().

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

◆ getContentObject()

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

Get a content object of the page.

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

References getDomDoc().

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

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

◆ getContentObjectForPcId()

ilPageObject::getContentObjectForPcId ( string  $pcid)

Get content object for pc id.

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

References getContentObject(), and getHierIdsForPCIds().

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

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

◆ getContentTemplates()

ilPageObject::getContentTemplates ( )

Get content templates.

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

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

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

◆ getCreationUserId()

ilPageObject::getCreationUserId ( )

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

References $create_user.

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

◆ getDomDoc()

ilPageObject::getDomDoc ( )

Get dom doc (DOMDocument)

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

References $dom.

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

419  : DOMDocument
420  {
421  return $this->dom;
422  }
DOMDocument $dom
+ Here is the caller graph for this function:

◆ getDomNodeForPCId()

ilPageObject::getDomNodeForPCId ( string  $pc_id)

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

References getContentDomNode().

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

◆ getDuplicatePCIds()

ilPageObject::getDuplicatePCIds ( )

Get all duplicate PC Ids.

Returns
int[]

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

Referenced by update().

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

◆ getEditLock()

ilPageObject::getEditLock ( )

Get page lock.

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

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

Referenced by update().

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

◆ getEditLockInfo()

ilPageObject::getEditLockInfo ( )

Get edit lock info.

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

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

Referenced by update().

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

◆ getEffectiveEditLockTime()

ilPageObject::getEffectiveEditLockTime ( )

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

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

Referenced by getEditLock().

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

◆ getFirstParagraphText()

ilPageObject::getFirstParagraphText ( )

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

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

◆ getHierIdForPcId()

ilPageObject::getHierIdForPcId ( string  $pcid)

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

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

◆ getHierIds()

ilPageObject::getHierIds ( )

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

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

◆ getHierIdsForPCIds()

ilPageObject::getHierIdsForPCIds ( array  $a_pc_ids)

Get hier ids for a set of pc ids.

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

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

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

◆ getHistoryEntries()

ilPageObject::getHistoryEntries ( )

Get History Entries.

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

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

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

◆ getHistoryEntry()

ilPageObject::getHistoryEntry ( int  $a_old_nr)

Get History Entry.

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

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

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

◆ getHistoryInfo()

ilPageObject::getHistoryInfo ( int  $a_nr)

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

Parameters
int$a_nrNr of history entry

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

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

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

◆ getId()

ilPageObject::getId ( )

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

References $id.

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

429  : int
430  {
431  return $this->id;
432  }
+ Here is the caller graph for this function:

◆ getIliasAbsolutePath()

ilPageObject::getIliasAbsolutePath ( )
protected

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

Referenced by getXMLContent().

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

◆ getImportMode()

ilPageObject::getImportMode ( )

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

References $import_mode.

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

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

◆ getInitialOpenedContent()

ilPageObject::getInitialOpenedContent ( )

Get initial opened content.

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

References getContentManager().

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

◆ getInternalLinks()

ilPageObject::getInternalLinks ( )

get all internal links that are used within the page

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

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

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

◆ getLanguage()

◆ getLanguageVariablesXML()

ilPageObject::getLanguageVariablesXML ( int  $style_id = 0)

Get language variables as XML.

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

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

Referenced by getXMLFromDom().

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

◆ getLangVarXML()

ilPageObject::getLangVarXML ( string  $var)
protected

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

References ILIAS\Repository\lng().

Referenced by getLanguageVariablesXML().

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

◆ getLastChange()

ilPageObject::getLastChange ( )

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

References $lastchange.

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

◆ getLastChangeByParent()

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

Get all pages for parent object.

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

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

Referenced by ilWikiUserHTMLExport\getProcess().

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

◆ getLastChangeUser()

ilPageObject::getLastChangeUser ( )

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

References $last_change_user.

268  : int
269  {
271  }

◆ getLastUpdateOfIncludedElements()

ilPageObject::getLastUpdateOfIncludedElements ( )

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

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

Todo:
: move to content include class

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

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

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

◆ getMediaAliasElement()

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

get complete media object (alias) element

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

References getDomDoc().

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

◆ getMultimediaXML()

ilPageObject::getMultimediaXML ( bool  $offline = false)

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

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

References getDomDoc().

Referenced by getXMLFromDom().

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

◆ getNewPages()

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

Get new pages.

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

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

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

◆ getOfflineHandler()

ilPageObject::getOfflineHandler ( )

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

References $offline_handler.

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

◆ getPageConfig()

ilPageObject::getPageConfig ( )

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

References $page_config.

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

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

◆ getPageContributors()

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

Get all contributors for parent object.

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

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

Referenced by ilBlogPostingGUI\getPageHeading().

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

◆ getPagesWithLinks()

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

Get all pages for parent object that contain internal links.

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

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

Referenced by ilLMPageObject\getPagesWithLinksList().

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

◆ getParagraphForPCID()

ilPageObject::getParagraphForPCID ( string  $pcid)

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

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

◆ getParentContentObjectForPcId()

ilPageObject::getParentContentObjectForPcId ( string  $pcid)

Get parent content object for pc id.

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

References getContentObjectForPcId(), and null.

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

◆ getParentId()

◆ getParentObjectContributors()

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

Get all contributors for parent object.

Parameters
string$a_parent_typeParent Type
int$a_parent_idParent ID

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

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

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

◆ getParentType()

◆ getPCIdForHierId()

ilPageObject::getPCIdForHierId ( string  $hier_id)

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

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

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

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

◆ getPCModel()

ilPageObject::getPCModel ( )

Get page component model.

Returns
array

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

References getPageConfig().

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

◆ getRecentChanges()

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

Get recent pages changes for parent object.

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

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

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

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

◆ getRenderedContent()

ilPageObject::getRenderedContent ( )

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

References $renderedcontent.

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

◆ getRenderedTime()

ilPageObject::getRenderedTime ( )

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

References $renderedtime.

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

◆ getRenderMd5()

ilPageObject::getRenderMd5 ( )

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

References $rendermd5.

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

◆ getRepoObjId()

ilPageObject::getRepoObjId ( )

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

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

References getParentId().

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

◆ getShowActivationInfo()

ilPageObject::getShowActivationInfo ( )

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

References $show_page_act_info.

Referenced by createFromXML(), and update().

278  : bool
279  {
281  }
+ Here is the caller graph for this function:

◆ getXMLContent()

ilPageObject::getXMLContent ( bool  $a_incl_head = false)

get xml content of page

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

References $xml, and getIliasAbsolutePath().

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

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

◆ getXMLFromDom()

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

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

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

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

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

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

◆ handleDeleteContent()

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

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

Parameters
DOMNode | null$a_node

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

References getDomDoc().

Referenced by delete().

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

◆ handleRepositoryLinksOnCopy()

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

Handle repository links on copy process.

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

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

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

◆ hasDuplicatePCIds()

ilPageObject::hasDuplicatePCIds ( )

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

Referenced by update().

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

◆ increaseViewCnt()

ilPageObject::increaseViewCnt ( )

Increase view cnt.

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

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

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

◆ initPageConfig()

ilPageObject::initPageConfig ( )

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

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

Referenced by __construct().

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

◆ insertContent()

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

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

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

References getDomDoc(), and getPageConfig().

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

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

◆ insertContentNode()

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

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

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

References getDomDoc().

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

◆ insertInstIntoIDs()

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

inserts installation id into ids (e.g.

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

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

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

References getDomDoc().

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

◆ insertPCIds()

ilPageObject::insertPCIds ( )

Insert Page Content IDs.

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

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

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

◆ isTranslationPage()

ilPageObject::isTranslationPage ( )
protected

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

References getLanguage().

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

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

◆ lookupParentId()

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

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

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

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

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

◆ lookupTranslations()

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

Lookup translations.

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

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

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

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

◆ moveContentAfter()

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

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

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

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

References getDomDoc(), and update().

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

◆ moveIntLinks()

ilPageObject::moveIntLinks ( array  $a_from_to)

Move internal links from one destination to another.

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

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

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

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

◆ needsImportParsing()

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

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

References $needs_parsing.

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

◆ pasteContents()

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

Paste contents from pc clipboard.

Returns
array|bool
Exceptions
ilDateTimeException

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

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

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

◆ performAutomaticModifications()

ilPageObject::performAutomaticModifications ( )

Perform automatic modifications (may be overwritten by sub classes)

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

Referenced by update().

2553  : void
2554  {
2555  }
+ Here is the caller graph for this function:

◆ preloadActivationDataByParentId()

static ilPageObject::preloadActivationDataByParentId ( int  $a_parent_id)
static

Preload activation data by Parent Id.

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

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

Referenced by ilLMExplorerGUI\__construct().

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

◆ preparePageForCompare()

ilPageObject::preparePageForCompare ( ilPageObject  $page)

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

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

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

◆ read()

ilPageObject::read ( )

Read page data.

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

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

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

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

◆ registerOfflineHandler()

ilPageObject::registerOfflineHandler ( object  $handler)

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

References $handler.

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

◆ releasePageLock()

ilPageObject::releasePageLock ( )

Release page lock.

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

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

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

◆ resolveFileItems()

ilPageObject::resolveFileItems ( array  $a_mapping)

Resolve file items (after import)

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

References getDomDoc().

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

◆ resolveIIMMediaAliases()

ilPageObject::resolveIIMMediaAliases ( array  $a_mapping)

Resolve iim media aliases (in ilContObjParse)

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

References getDomDoc().

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

◆ resolveIntLinks()

ilPageObject::resolveIntLinks ( ?array  $a_link_map = null)

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

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

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

Referenced by ilQuestionPageParser\processPagesToParse().

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

◆ resolveMediaAliases()

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

Resolve media aliases (after import)

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

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

◆ resolveQuestionReferences()

ilPageObject::resolveQuestionReferences ( array  $a_mapping)

Resolve all quesiont references (after import)

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

References getDomDoc().

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

◆ resolveResources()

ilPageObject::resolveResources ( array  $ref_mapping)

Resolve resources.

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

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

References ilPCResources\resolveResources().

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

◆ saveInitialOpenedContent()

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

Save initial opened content.

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

References getContentManager(), and update().

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

◆ saveInternalLinks()

ilPageObject::saveInternalLinks ( DOMDocument  $a_domdoc)

save internal links of page

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

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

References ILIAS\Repository\link().

Referenced by __afterUpdate().

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

◆ saveStyleUsage()

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

Save all style class/template usages.

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

Referenced by __afterHistoryEntry(), and __afterUpdate().

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

◆ sendParagraph()

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

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

References getDomDoc().

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

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

◆ setActivationEnd()

ilPageObject::setActivationEnd ( ?string  $a_activationend)

Set Activation End.

Parameters
string$a_activationendIL_CAL_DATETIME format

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

References null.

Referenced by read().

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

◆ setActivationStart()

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

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

References null.

Referenced by read().

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

◆ setActive()

ilPageObject::setActive ( bool  $a_active)

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

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

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

◆ setConcreteLang()

ilPageObject::setConcreteLang ( string  $a_val)

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

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

◆ setContainsIntLink()

ilPageObject::setContainsIntLink ( bool  $a_contains_link)

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

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

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

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

◆ setContainsQuestion()

ilPageObject::setContainsQuestion ( bool  $a_val)

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

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

◆ setContentIdManager()

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

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

References $content_id_manager.

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

◆ setCopyProperties()

ilPageObject::setCopyProperties ( ilPageObject  $new_page)
protected

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

Referenced by copy().

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

◆ setEmptyPageXml()

ilPageObject::setEmptyPageXml ( )

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

References setXMLContent().

Referenced by createFromXML().

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

◆ setId()

ilPageObject::setId ( int  $a_id)

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

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

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

◆ setImportMode()

ilPageObject::setImportMode ( bool  $a_val)

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

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

◆ setLanguage()

ilPageObject::setLanguage ( string  $a_val)

Set language.

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

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

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

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

193  : void
194  {
195  $this->language = $a_val;
196  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLastChange()

ilPageObject::setLastChange ( string  $a_lastchange)

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

Referenced by read().

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

◆ setLastChangeUser()

ilPageObject::setLastChangeUser ( int  $a_val)

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

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

◆ setPageConfig()

ilPageObject::setPageConfig ( ilPageConfig  $a_val)

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

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

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

◆ setParentId()

ilPageObject::setParentId ( int  $a_id)

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

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

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

◆ setRenderedContent()

ilPageObject::setRenderedContent ( string  $a_renderedcontent)

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

Referenced by read().

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

◆ setRenderedTime()

ilPageObject::setRenderedTime ( string  $a_renderedtime)

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

Referenced by read().

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

◆ setRenderMd5()

ilPageObject::setRenderMd5 ( string  $a_rendermd5)

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

Referenced by read().

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

◆ setShowActivationInfo()

ilPageObject::setShowActivationInfo ( bool  $a_val)

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

Referenced by read().

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

◆ setTranslationProperties()

ilPageObject::setTranslationProperties ( self  $transl_page)
protected

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

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

Referenced by copyPageToTranslation().

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

◆ setXMLContent()

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

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

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

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

Referenced by buildDom(), and setEmptyPageXml().

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

◆ stripHierIDs()

ilPageObject::stripHierIDs ( )

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

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

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

◆ stripPCIDs()

ilPageObject::stripPCIDs ( )

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

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

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

References getDomDoc(), and update().

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

◆ truncateHTML()

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

Truncate (html) string.

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

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

References ilStr\shortenText().

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

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

◆ update()

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

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

Returns
array|bool
Exceptions
ilDateTimeException
ilWACException

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

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

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

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

◆ updateFromXML()

ilPageObject::updateFromXML ( )

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

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

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

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

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

◆ validateDom()

ilPageObject::validateDom ( bool  $throw = false)

Validate the page content agains page DTD.

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

References null, and stripHierIDs().

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

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

◆ writeRenderedContent()

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

Write rendered content.

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

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

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

Field Documentation

◆ $activation_data

array ilPageObject::$activation_data = array()
staticprotected

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

◆ $activationend

string ilPageObject::$activationend = null
protected

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

Referenced by getActivationEnd().

◆ $activationstart

string ilPageObject::$activationstart = null
protected

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

Referenced by getActivationStart().

◆ $active

bool ilPageObject::$active = false
protected

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

Referenced by getActive().

◆ $concrete_lang

ilPageObject::$concrete_lang = ""
protected

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

Referenced by getConcreteLang().

◆ $contains_int_link

bool ilPageObject::$contains_int_link = false

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

Referenced by containsIntLink().

◆ $contains_question

bool ilPageObject::$contains_question = false
protected

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

Referenced by getContainsQuestion().

◆ $content_id_manager

ILIAS COPage ID ContentIdManager ilPageObject::$content_id_manager
protected

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

Referenced by setContentIdManager().

◆ $create_user

int ilPageObject::$create_user = 0
protected

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

Referenced by getCreationUserId().

◆ $cur_dtd

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

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

◆ $db

◆ $dom

DOMDocument ilPageObject::$dom = null

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

Referenced by getDomDoc().

◆ $dom_builded

bool ilPageObject::$dom_builded = false

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

◆ $dom_util

ILIAS COPage Dom DomUtil ilPageObject::$dom_util
protected

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

◆ $encoding

string ilPageObject::$encoding = ""

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

◆ $exists

array ilPageObject::$exists = array()
static

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

◆ $hier_ids

array ilPageObject::$hier_ids = []
protected

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

◆ $history_saved

bool ilPageObject::$history_saved = false

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

◆ $id

◆ $id_elements

array ilPageObject::$id_elements
protected

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

◆ $import_mode

bool ilPageObject::$import_mode = false
protected

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

Referenced by getImportMode().

◆ $language

string ilPageObject::$language = "-"
protected

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

Referenced by getLanguage().

◆ $last_change_user

int ilPageObject::$last_change_user = 0

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

Referenced by getLastChangeUser().

◆ $lastchange

string ilPageObject::$lastchange = ""
protected

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

Referenced by getLastChange().

◆ $link

ILIAS COPage Link LinkManager ilPageObject::$link
protected

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

◆ $lng

ilLanguage ilPageObject::$lng
protected

◆ $log

ilLogger ilPageObject::$log
protected

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

◆ $lom_services

LOMServices ilPageObject::$lom_services
protected

◆ $needs_parsing

bool ilPageObject::$needs_parsing = false

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

Referenced by needsImportParsing().

◆ $node

◆ $obj_definition

ilObjectDefinition ilPageObject::$obj_definition
protected

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

◆ $offline_handler

object ilPageObject::$offline_handler = null

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

Referenced by getOfflineHandler().

◆ $old_nr

int ilPageObject::$old_nr

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

◆ $page_config

ilPageConfig ilPageObject::$page_config
protected

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

Referenced by getPageConfig().

◆ $page_manager

ILIAS COPage Page PageManager ilPageObject::$page_manager
protected

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

◆ $page_not_found

bool ilPageObject::$page_not_found = false
protected

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

◆ $page_record

array ilPageObject::$page_record = array()
protected

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

◆ $parent_id

int ilPageObject::$parent_id = 0

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

Referenced by getParentId().

◆ $parent_type

string ilPageObject::$parent_type = ""

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

Referenced by ilDashboardPage\getParentType().

◆ $pc_definition

ILIAS COPage PC PCDefinition ilPageObject::$pc_definition
protected

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

◆ $pc_service

ILIAS COPage PC DomainService ilPageObject::$pc_service
protected

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

◆ $reading_time_manager

ILIAS COPage ReadingTime ReadingTimeManager ilPageObject::$reading_time_manager
protected

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

◆ $renderedcontent

string ilPageObject::$renderedcontent = ""
protected

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

Referenced by getRenderedContent().

◆ $renderedtime

string ilPageObject::$renderedtime = ""
protected

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

Referenced by getRenderedTime().

◆ $rendermd5

string ilPageObject::$rendermd5 = ""
protected

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

Referenced by getRenderMd5().

◆ $show_page_act_info

bool ilPageObject::$show_page_act_info = false
protected

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

Referenced by getShowActivationInfo().

◆ $style_manager

ILIAS COPage Style StyleManager ilPageObject::$style_manager
protected

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

◆ $tree

ilTree ilPageObject::$tree
protected

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

Referenced by handleRepositoryLinksOnCopy().

◆ $update_listener_cnt

int ilPageObject::$update_listener_cnt = 0

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

Referenced by addUpdateListener(), and callUpdateListeners().

◆ $update_listeners

array ilPageObject::$update_listeners = []

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

◆ $user

◆ $xml

string ilPageObject::$xml = ""

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

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


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