ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilWikiPage Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilWikiPage:
+ Collaboration diagram for ilWikiPage:

Public Member Functions

 getParentType ()
 
 afterConstructor ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setWikiId (int $a_wikiid)
 
 getWikiId ()
 
 setWikiRefId (int $a_wiki_ref_id)
 
 getWikiRefId ()
 
 setBlocked (bool $a_val)
 
 getBlocked ()
 
 setRating (bool $a_val)
 
 getRating ()
 
 hideAdvancedMetadata (bool $a_val)
 
 isAdvancedMetadataHidden ()
 
 createFromXML ()
 Create new page object with current xml content. More...
 
 create (bool $a_import=false)
 create new page (with current xml data) More...
 
 afterUpdate (DOMDocument $domdoc, string $xml)
 After update. More...
 
 update (bool $a_validate=true, bool $a_no_history=false)
 
 read (bool $a_omit_page_read=false)
 
 delete ()
 
 saveInternalLinks (DOMDocument $a_domdoc)
 save internal links of page More...
 
 rename (string $a_new_name)
 Rename page. More...
 
 updateNews (bool $a_update=false)
 
 getContentTemplates ()
 Get content templates. More...
 
 preparePageForCompare (ilPageObject $page)
 
- Public Member Functions inherited from ilPageObject
 __construct (int $a_id=0, int $a_old_nr=0, string $a_lang="-")
 
 setContentIdManager (\ILIAS\COPage\ID\ContentIdManager $content_id_manager)
 
 afterConstructor ()
 
 getParentType ()
 
 initPageConfig ()
 
 setLanguage (string $a_val)
 Set language. More...
 
 getLanguage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 setConcreteLang (string $a_val)
 
 getConcreteLang ()
 
 getPageConfig ()
 
 setRenderMd5 (string $a_rendermd5)
 
 getRenderMd5 ()
 
 setRenderedContent (string $a_renderedcontent)
 
 getRenderedContent ()
 
 setRenderedTime (string $a_renderedtime)
 
 getRenderedTime ()
 
 setLastChange (string $a_lastchange)
 
 getLastChange ()
 
 setLastChangeUser (int $a_val)
 
 getLastChangeUser ()
 
 setShowActivationInfo (bool $a_val)
 
 getShowActivationInfo ()
 
 getCreationUserId ()
 
 read ()
 Read page data. More...
 
 buildDom (bool $a_force=false)
 
 freeDom ()
 
 getDomDoc ()
 Get dom doc (DOMDocument) More...
 
 setId (int $a_id)
 
 getId ()
 
 setParentId (int $a_id)
 
 getParentId ()
 
 addUpdateListener (object $a_object, string $a_method, $a_parameters="")
 
 callUpdateListeners ()
 
 setActive (bool $a_active)
 
 getActive (bool $a_check_scheduled_activation=false)
 
 setActivationStart (?string $a_activationstart)
 
 getActivationStart ()
 
 setActivationEnd (?string $a_activationend)
 Set Activation End. More...
 
 getActivationEnd ()
 
 getContentObject (string $a_hier_id, string $a_pc_id="")
 Get a content object of the page. More...
 
 getContentObjectForPcId (string $pcid)
 Get content object for pc id. More...
 
 getParentContentObjectForPcId (string $pcid)
 Get parent content object for pc id. More...
 
 getContentDomNode (string $a_hier_id, string $a_pc_id="")
 
 getDomNodeForPCId (string $pc_id)
 
 setXMLContent (string $a_xml, string $a_encoding="UTF-8")
 set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD, omit MetaData, use utf-8! More...
 
 appendXMLContent (string $a_xml)
 
 getXMLContent (bool $a_incl_head=false)
 get xml content of page More...
 
 copyXmlContent (bool $a_clone_mobs=false, int $a_new_parent_id=0, int $obj_copy_id=0, bool $self_ass=true)
 Copy content of page; replace page components with copies where necessary (e.g. More...
 
 handleDeleteContent (?DOMNode $a_node=null, $move_operation=false)
 Handle content before deletion This currently treats only plugged content If no node is given, then the whole dom will be scanned. More...
 
 getXMLFromDom (bool $a_incl_head=false, bool $a_append_mobs=false, bool $a_append_bib=false, string $a_append_str="", bool $a_omit_pageobject_tag=false, int $style_id=0, bool $offline=false)
 get xml content of page from dom (use this, if any changes are made to the document) More...
 
 getLanguageVariablesXML (int $style_id=0)
 Get language variables as XML. More...
 
 getFirstParagraphText ()
 
 getParagraphForPCID (string $pcid)
 
 setContainsIntLink (bool $a_contains_link)
 lm parser set this flag to true, if the page contains intern links (this method should only be called by the import parser) todo: move to ilLMPageObject !? More...
 
 containsIntLink ()
 returns true, if page was marked as containing an intern link (via setContainsIntLink) (this method should only be called by the import parser) More...
 
 setImportMode (bool $a_val)
 
 getImportMode ()
 
 needsImportParsing (?bool $a_parse=null)
 
 setContainsQuestion (bool $a_val)
 
 getContainsQuestion ()
 
 collectMediaObjects (bool $a_inline_only=true)
 get all media objects, that are referenced and used within the page More...
 
 getInternalLinks ()
 get all internal links that are used within the page More...
 
 getMultimediaXML (bool $offline=false)
 get a xml string that contains all media object elements, that are referenced by any media alias in the page More...
 
 getMediaAliasElement (int $a_mob_id, int $a_nr=1)
 get complete media object (alias) element More...
 
 validateDom (bool $throw=false)
 Validate the page content agains page DTD. More...
 
 addHierIDs ()
 Add hierarchical ID (e.g. More...
 
 getHierIds ()
 
 stripHierIDs ()
 
 stripPCIDs ()
 
 getHierIdsForPCIds (array $a_pc_ids)
 Get hier ids for a set of pc ids. More...
 
 getHierIdForPcId (string $pcid)
 
 getPCIdsForHierIds (array $hier_ids)
 Get hier ids for a set of pc ids. More...
 
 getPCIdForHierId (string $hier_id)
 
 addFileSizes ()
 add file sizes More...
 
 resolveIntLinks (?array $a_link_map=null)
 Resolves all internal link targets of the page, if targets are available (after import) More...
 
 resolveMediaAliases (array $a_mapping, bool $a_reuse_existing_by_import=false)
 Resolve media aliases (after import) More...
 
 resolveIIMMediaAliases (array $a_mapping)
 Resolve iim media aliases (in ilContObjParse) More...
 
 resolveFileItems (array $a_mapping)
 Resolve file items (after import) More...
 
 resolveQuestionReferences (array $a_mapping)
 Resolve all quesiont references (after import) More...
 
 moveIntLinks (array $a_from_to)
 Move internal links from one destination to another. More...
 
 handleRepositoryLinksOnCopy (array $a_mapping, int $a_source_ref_id)
 Handle repository links on copy process. More...
 
 setEmptyPageXml ()
 
 createFromXML ()
 Create new page object with current xml content. More...
 
 updateFromXML ()
 Updates page object with current xml content This function is currently (8 beta) called by: More...
 
 afterUpdate (DOMDocument $domdoc, string $xml)
 After update. More...
 
 update (bool $a_validate=true, bool $a_no_history=false)
 update complete page content in db (dom xml content is used) More...
 
 delete ()
 
 saveStyleUsage (DOMDocument $a_domdoc, int $a_old_nr=0)
 Save all style class/template usages. More...
 
 deleteStyleUsages (int $a_old_nr=0)
 Delete style usages. More...
 
 getLastUpdateOfIncludedElements ()
 Get last update of included elements (media objects and files). More...
 
 deleteInternalLinks ()
 Delete internal links. More...
 
 saveInternalLinks (DOMDocument $a_domdoc)
 save internal links of page More...
 
 create (bool $a_import=false)
 create new page (with current xml data) More...
 
 deleteContent (string $a_hid, bool $a_update=true, string $a_pcid="", bool $move_operation=false)
 delete content object with hierarchical id $a_hid More...
 
 deleteContents (array $a_hids, bool $a_update=true, bool $a_self_ass=false, bool $move_operation=false)
 Delete multiple content objects. More...
 
 cutContents (array $a_hids)
 Copy contents to clipboard and cut them from the page. More...
 
 copyContents (array $a_hids)
 Copy contents to clipboard. More...
 
 pasteContents (string $a_hier_id, bool $a_self_ass=false)
 Paste contents from pc clipboard. More...
 
 switchEnableMultiple (array $a_hids, bool $a_update=true, bool $a_self_ass=false)
 (De-)activate elements More...
 
 insertContent (ilPageContent $a_cont_obj, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="", bool $remove_placeholder=true)
 insert a content node before/after a sibling or as first child of a parent More...
 
 insertContentNode (DOMNode $a_cont_node, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent More...
 
 moveContentAfter (string $a_source, string $a_target, string $a_spcid="", string $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids) More...
 
 insertInstIntoIDs (string $a_inst, bool $a_res_ref_to_obj_id=true)
 inserts installation id into ids (e.g. More...
 
 checkPCIds ()
 Check, whether (all) page content hashes are set. More...
 
 getAllPCIds ()
 Get all pc ids. More...
 
 hasDuplicatePCIds ()
 
 getDuplicatePCIds ()
 Get all duplicate PC Ids. More...
 
 generatePCId ()
 
 insertPCIds ()
 Insert Page Content IDs. More...
 
 sendParagraph (string $par_id, string $filename)
 
 registerOfflineHandler (object $handler)
 
 getOfflineHandler ()
 
 containsDeactivatedElements (string $a_content)
 Check whether content contains deactivated elements. More...
 
 getHistoryEntries ()
 Get History Entries. More...
 
 getHistoryEntry (int $a_old_nr)
 Get History Entry. More...
 
 getHistoryInfo (int $a_nr)
 Get information about a history entry, its predecessor and its successor. More...
 
 preparePageForCompare (ilPageObject $page)
 
 increaseViewCnt ()
 Increase view cnt. More...
 
 writeRenderedContent (string $a_content, string $a_md5)
 Write rendered content. More...
 
 containsIntLinks (string $a_content)
 Check whether content contains internal links. More...
 
 performAutomaticModifications ()
 Perform automatic modifications (may be overwritten by sub classes) More...
 
 saveInitialOpenedContent (string $a_type, int $a_id, string $a_target)
 Save initial opened content. More...
 
 getInitialOpenedContent ()
 Get initial opened content. More...
 
 beforePageContentUpdate (ilPageContent $a_page_content)
 Before page content update Note: This one is "work in progress", currently only text paragraphs call this hook It is called before the page content object invokes the update procedure of ilPageObject. More...
 
 copy (int $a_id, string $a_parent_type="", int $a_new_parent_id=0, bool $a_clone_mobs=false, int $obj_copy_id=0, bool $overwrite_existing=true)
 Copy page. More...
 
 copyPageToTranslation (string $a_target_lang)
 Copy page to translation. More...
 
 getEditLock ()
 Get page lock. More...
 
 releasePageLock ()
 Release page lock. More...
 
 getEditLockInfo ()
 Get edit lock info. More...
 
 getContentTemplates ()
 Get content templates. More...
 
 getEffectiveEditLockTime ()
 
 resolveResources (array $ref_mapping)
 Resolve resources. More...
 
 getRepoObjId ()
 Get object id of repository object that contains this page, return 0 if page does not belong to a repo object. More...
 
 getPCModel ()
 Get page component model. More...
 
 assignCharacteristic (array $targets, string $char_par, string $char_sec, string $char_med)
 Assign characteristic. More...
 

Static Public Member Functions

static deleteAllPagesOfWiki (int $a_wiki_id)
 
static exists (int $a_wiki_id, string $a_title, string $lang="-")
 Checks whether a page with given title exists. More...
 
static getPageIdForTitle (int $a_wiki_id, string $a_title, string $lang="-")
 Get wiki page object for id and title. More...
 
static lookupTitle (int $a_page_id, string $lang="-")
 
static lookupWikiId (int $a_page_id)
 
static getAllWikiPages (int $a_wiki_id, string $lang="-")
 
static getLinksToPage (int $a_wiki_id, int $a_page_id, string $lang="-")
 
static _wikiPageExists (int $a_wiki_id, string $a_title, string $lang="-")
 
static getWikiContributors (int $a_wiki_id)
 
static getWikiPageContributors (int $a_page_id)
 
static _getPageIdForWikiTitle (int $a_wiki_id, string $a_title)
 
static getPopularPages (int $a_wiki_id)
 
static countPages (int $a_wiki_id)
 
static getRandomPage (int $a_wiki_id)
 
static getNewWikiPages (int $a_wiki_id)
 
static lookupObjIdByPage (int $a_page_id)
 returns the wiki/object id to a given page id More...
 
static getGotoForWikiPageTarget (string $a_target, bool $a_offline=false)
 
static getPagesForSearch (int $a_wiki_id, string $a_term)
 
static lookupAdvancedMetadataHidden (int $a_page_id)
 
- Static Public Member Functions inherited from ilPageObject
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...
 

Protected Member Functions

 getNotificationGUI ()
 This currently violates the layer model, since notifications render the abstracts with a GUI class. More...
 
 setTranslationProperties (ilPageObject $transl_page)
 
 setCopyProperties (ilPageObject $new_page)
 
- Protected Member Functions inherited from ilPageObject
 getIliasAbsolutePath ()
 
 getLangVarXML (string $var)
 
 getLangVarXMLForValue (string $var, string $val)
 
 __afterUpdate (DOMDocument $a_domdoc, string $a_xml, bool $a_creation=false, bool $a_empty=false)
 After update event handler (internal). More...
 
 isTranslationPage ()
 
 __beforeDelete ()
 Before deletion handler (internal). More...
 
 __afterDelete ()
 
 afterDelete ()
 
 __afterHistoryEntry (DOMDocument $a_old_domdoc, string $a_old_content, int $a_old_nr)
 
 getContentManager ()
 
 setCopyProperties (ilPageObject $new_page)
 
 setTranslationProperties (self $transl_page)
 

Protected Attributes

ILIAS Wiki Page PageDBRepository $repo
 
ilLogger $wiki_log
 
ILIAS Wiki InternalService $service
 
int $parent_ref_id = 0
 
string $title = ""
 
bool $blocked = false
 
bool $rating = false
 
bool $hide_adv_md = false
 
- Protected Attributes inherited from ilPageObject
ILIAS COPage InternalDomainService $domain
 
ILIAS COPage Dom DomUtil $dom_util
 
ILIAS COPage Link LinkManager $link
 
ILIAS COPage PC PCDefinition $pc_definition
 
int $create_user = 0
 
array $id_elements
 
bool $page_not_found = false
 
bool $show_page_act_info = false
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilObjUser $user
 
ilLanguage $lng
 
ilTree $tree
 
LOMServices $lom_services
 
int $id
 
string $language = "-"
 
bool $import_mode = false
 
ilLogger $log
 
array $page_record = array()
 
bool $active = false
 
ilPageConfig $page_config
 
string $rendermd5 = ""
 
string $renderedcontent = ""
 
string $renderedtime = ""
 
string $lastchange = ""
 
bool $contains_question = false
 
array $hier_ids = []
 
string $activationstart = null
 
string $activationend = null
 
ILIAS COPage ReadingTime ReadingTimeManager $reading_time_manager
 
string $concrete_lang = ""
 
ILIAS COPage ID ContentIdManager $content_id_manager
 
ILIAS COPage Page PageManagerInterface $page_manager
 
ILIAS COPage Style StyleManager $style_manager
 
ILIAS COPage PC DomainService $pc_service
 

Additional Inherited Members

- Data Fields inherited from ilPageObject
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 inherited from ilPageObject
static array $exists = array()
 
- Static Protected Attributes inherited from ilPageObject
static array $activation_data = array()
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilWikiPage

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

Definition at line 24 of file class.ilWikiPage.php.

Member Function Documentation

◆ _getPageIdForWikiTitle()

static ilWikiPage::_getPageIdForWikiTitle ( int  $a_wiki_id,
string  $a_title 
)
static
Deprecated:
use getPageIdForTitle instead

Definition at line 581 of file class.ilWikiPage.php.

584 : ?int {
585 return self::getPageIdForTitle($a_wiki_id, $a_title);
586 }
static getPageIdForTitle(int $a_wiki_id, string $a_title, string $lang="-")
Get wiki page object for id and title.

◆ _wikiPageExists()

static ilWikiPage::_wikiPageExists ( int  $a_wiki_id,
string  $a_title,
string  $lang = "-" 
)
static

Definition at line 522 of file class.ilWikiPage.php.

526 : bool {
527 global $DIC;
528
529 if ($lang === "") {
530 $lang = "-";
531 }
532
533 $ilDB = $DIC->database();
534
535 $a_title = ilWikiUtil::makeDbTitle($a_title);
536
537 $query = "SELECT id FROM il_wiki_page" .
538 " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
539 " AND title = " . $ilDB->quote($a_title, "text") .
540 " AND lang = " . $ilDB->quote($lang, "text");
541 $set = $ilDB->query($query);
542
543 if ($ilDB->fetchAssoc($set)) {
544 return true;
545 }
546
547 return false;
548 }
static makeDbTitle(string $a_par)
global $DIC
Definition: shib_login.php:26

Referenced by ilObjWiki\decorateAdvMDValue(), ilWikiPageGUI\insertWikiLinkAC(), and ilObjWikiGUI\isNewTranslatedPage().

+ Here is the caller graph for this function:

◆ afterConstructor()

ilWikiPage::afterConstructor ( )

Reimplemented from ilPageObject.

Definition at line 40 of file class.ilWikiPage.php.

40 : void
41 {
42 global $DIC;
43 $this->service = $DIC->wiki()->internal();
44 $this->getPageConfig()->configureByObjectId($this->getParentId());
45 $this->wiki_log = $this->service->domain()->log();
46 $this->repo = $this->service->repo()->page();
47 }

References $DIC, ilPageObject\getPageConfig(), and ilPageObject\getParentId().

+ Here is the call graph for this function:

◆ afterUpdate()

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

After update.

Reimplemented from ilPageObject.

Definition at line 191 of file class.ilWikiPage.php.

194 : void {
195 // internal == wiki links
196
197 $this->wiki_log->debug("collect internal links");
198 $int_links = count(ilWikiUtil::collectInternalLinks($xml, $this->getWikiId(), true));
199
200 $xpath = new DOMXPath($domdoc);
201
202 // external = internal + external links
203 $ext_links = count($xpath->query('//IntLink'));
204 $ext_links += count($xpath->query('//ExtLink'));
205
206 $footnotes = count($xpath->query('//Footnote'));
207
208
209 // words/characters (xml)
210
211 $xml = strip_tags($xml);
212
213 $num_chars = ilStr::strLen($xml);
214 $num_words = count(explode(" ", $xml));
215
216 $page_data = array(
217 "int_links" => $int_links,
218 "ext_links" => $ext_links,
219 "footnotes" => $footnotes,
220 "num_words" => $num_words,
221 "num_chars" => $num_chars
222 );
223 $this->wiki_log->debug("handle stats");
225 }
static strLen(string $a_string)
Definition: class.ilStr.php:60
const EVENT_PAGE_UPDATED
static handleEvent(int $a_event, ilWikiPage $a_page_obj, ?int $a_user_id=null, ?array $a_additional_data=null)
Handle wiki page event.
static collectInternalLinks(string $s, int $a_wiki_id, bool $a_collect_non_ex=false, string $mode=IL_WIKI_MODE_COLLECT)
Collect internal wiki links of a string.

◆ countPages()

static ilWikiPage::countPages ( int  $a_wiki_id)
static

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

612 : int {
613 global $DIC;
614
615 $ilDB = $DIC->database();
616
617 // delete record of table il_wiki_data
618 $query = "SELECT count(*) as cnt FROM il_wiki_page" .
619 " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
620 " WHERE lang = " . $ilDB->quote("-", "text");
621 $s = $ilDB->query($query);
622 $r = $ilDB->fetchAssoc($s);
623
624 return $r["cnt"];
625 }

◆ create()

ilWikiPage::create ( bool  $a_import = false)

create new page (with current xml data)

Reimplemented from ilPageObject.

Definition at line 139 of file class.ilWikiPage.php.

141 : void {
143
144 // get new id, if not a translation page
145 if (in_array($this->getLanguage(), ["-", ""]) && $this->getId() == 0) {
146 $id = $ilDB->nextId("il_wiki_page");
147 $this->setId($id);
148 }
149
150 $query = "INSERT INTO il_wiki_page (" .
151 "id" .
152 ", title" .
153 ", wiki_id" .
154 ", blocked" .
155 ", rating" .
156 ", hide_adv_md" .
157 ", lang" .
158 ", create_date" .
159 " ) VALUES (" .
160 $ilDB->quote($this->getId(), "integer")
161 . "," . $ilDB->quote($this->getTitle(), "text")
162 . "," . $ilDB->quote($this->getWikiId(), "integer")
163 . "," . $ilDB->quote((int) $this->getBlocked(), "integer")
164 . "," . $ilDB->quote((int) $this->getRating(), "integer")
165 . "," . $ilDB->quote((int) $this->isAdvancedMetadataHidden(), "integer")
166 . "," . $ilDB->quote($this->getLanguage(), "text")
167 . "," . $ilDB->now()
168 . ")";
169 $this->wiki_log->debug($query);
170 $ilDB->manipulate($query);
171
172 // create page object
173 if (!$a_import) {
174 parent::create($a_import);
175 $this->saveInternalLinks($this->getDomDoc());
176
178 $this->getNotificationGUI()->send(
179 "new",
181 $this->getWikiRefId(),
182 $this->getId(),
183 null,
184 $this->getLanguage()
185 );
186 }
187
188 $this->updateNews();
189 }
ilDBInterface $db
getDomDoc()
Get dom doc (DOMDocument)
updateNews(bool $a_update=false)
getNotificationGUI()
This currently violates the layer model, since notifications render the abstracts with a GUI class.
saveInternalLinks(DOMDocument $a_domdoc)
save internal links of page
const EVENT_PAGE_CREATED

References ilPageObject\$id, $ilDB, and ilPageObject\setId().

+ Here is the call graph for this function:

◆ createFromXML()

ilWikiPage::createFromXML ( )

Create new page object with current xml content.

Reimplemented from ilPageObject.

Definition at line 118 of file class.ilWikiPage.php.

118 : void
119 {
121
122 // ilWikiDataset creates wiki pages without copage objects
123 // (see create function in this class, parameter $a_prevent_page_creation)
124 // The ilCOPageImporter will call createFromXML without running through the read
125 // method -> we will miss the important wiki id, thus we read it now
126 // see also bug #12224
127 $set = $ilDB->query(
128 "SELECT id FROM il_wiki_page " .
129 " WHERE id = " . $ilDB->quote($this->getId(), "integer") .
130 " AND lang = " . $ilDB->quote($this->getLanguage(), "text")
131 );
132 if ($rec = $ilDB->fetchAssoc($set)) {
133 $this->read(true);
134 }
135
136 parent::createFromXML();
137 }
read()
Read page data.

References ilPageObject\$db, $ilDB, and ilPageObject\read().

+ Here is the call graph for this function:

◆ delete()

ilWikiPage::delete ( )

Reimplemented from ilPageObject.

Definition at line 294 of file class.ilWikiPage.php.

294 : void
295 {
296 $imp_pages = $this->service->domain()->importantPage($this->getWikiRefId());
297
299
300 // get other pages that link to this page
301 $linking_pages = self::getLinksToPage(
302 $this->getWikiId(),
303 $this->getId()
304 );
305
306 // delete important page
307 // note: the wiki might be already deleted here
308 if (!$this->isTranslationPage()) {
309 if ($imp_pages->isImportantPage($this->getId())) {
310 $imp_pages->removeImportantPage($this->getId());
311 }
312 }
313
314 // delete internal links information to this page
316
318
319 $this->getNotificationGUI()->send(
320 "delete",
322 $this->getWikiRefId(),
323 $this->getId(),
324 null,
325 $this->getLanguage()
326 );
327
328 // remove all notifications
330
331 // delete record of table il_wiki_data
332 $this->repo->delete($this->getId(), $this->getLanguage());
333
334 // delete co page
335 parent::delete();
336
337 // make links of other pages to this page a missing link
338 $missing_page_repo = $this->service->repo()->missingPage();
339 foreach ($linking_pages as $lp) {
340 $missing_page_repo->save(
341 $this->getWikiId(),
342 $lp["id"],
343 $this->getTitle(),
344 $this->getLanguage()
345 );
346 }
347 }
static removeForObject(int $type, int $id)
Remove all notifications for given object.
static getLinksToPage(int $a_wiki_id, int $a_page_id, string $lang="-")
const EVENT_PAGE_DELETED

References $ilDB, ilInternalLink\_deleteAllLinksToTarget(), ilWikiStat\EVENT_PAGE_DELETED, ILIAS\Survey\Mode\getId(), getLanguage(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), ilWikiStat\handleEvent(), ilNotification\removeForObject(), and ilNotification\TYPE_WIKI_PAGE.

+ Here is the call graph for this function:

◆ deleteAllPagesOfWiki()

static ilWikiPage::deleteAllPagesOfWiki ( int  $a_wiki_id)
static

Definition at line 349 of file class.ilWikiPage.php.

349 : void
350 {
351 global $DIC;
352
353 $ilDB = $DIC->database();
354
355 // delete record of table il_wiki_data
356 $query = "SELECT * FROM il_wiki_page" .
357 " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer");
358 $set = $ilDB->query($query);
359
360 while ($rec = $ilDB->fetchAssoc($set)) {
361 if (ilWikiPage::_exists("wpg", $rec["id"], 0, $rec["lang"])) {
362 $wiki_page = new ilWikiPage($rec["id"], 0, $rec["lang"]);
363 $wiki_page->delete();
364 }
365 }
366 }
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $DIC, $ilDB, and ilPageObject\_exists().

Referenced by ilObjWiki\delete().

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

◆ exists()

static ilWikiPage::exists ( int  $a_wiki_id,
string  $a_title,
string  $lang = "-" 
)
static

Checks whether a page with given title exists.

Definition at line 371 of file class.ilWikiPage.php.

375 : bool {
376 global $DIC;
377
378 $ilDB = $DIC->database();
379
380 $a_title = ilWikiUtil::makeDbTitle($a_title);
381
382 $query = "SELECT id FROM il_wiki_page" .
383 " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
384 " AND title = " . $ilDB->quote($a_title, "text") .
385 " AND lang = " . $ilDB->quote($lang, "text");
386 $set = $ilDB->query($query);
387 if ($rec = $ilDB->fetchAssoc($set)) {
388 return true;
389 }
390
391 return false;
392 }

◆ getAllWikiPages()

static ilWikiPage::getAllWikiPages ( int  $a_wiki_id,
string  $lang = "-" 
)
static

Definition at line 458 of file class.ilWikiPage.php.

461 : array {
462 global $DIC;
463
464 $ilDB = $DIC->database();
465
466 $pages = parent::getAllPages("wpg", $a_wiki_id);
467
468 $query = "SELECT * FROM il_wiki_page" .
469 " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
470 " AND lang = " . $ilDB->quote($lang, "text") .
471 " ORDER BY title";
472 $set = $ilDB->query($query);
473
474 $pg = array();
475 while ($rec = $ilDB->fetchAssoc($set)) {
476 if (isset($pages[$rec["id"]])) {
477 $pg[$rec["id"]] = $pages[$rec["id"]];
478 $pg[$rec["id"]]["title"] = $rec["title"];
479 }
480 }
481
482 return $pg;
483 }

Referenced by ILIAS\Wiki\WikiPrintViewProviderGUI\__construct(), ilObjWiki\cloneObject(), ILIAS\Wiki\Export\WikiHtmlExport\exportHTMLPages(), ILIAS\Wiki\Export\WikiHtmlExport\exportHTMLPagesPrint(), ILIAS\Wiki\WikiPrintViewProviderGUI\getSelectionForm(), ilWikiPageTemplateGUI\listTemplates(), and ilInternalLinkGUI\showLinkHelp().

+ Here is the caller graph for this function:

◆ getBlocked()

ilWikiPage::getBlocked ( )

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

93 : bool
94 {
95 return $this->blocked;
96 }

References $blocked.

◆ getContentTemplates()

ilWikiPage::getContentTemplates ( )

Get content templates.

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

Reimplemented from ilPageObject.

Definition at line 864 of file class.ilWikiPage.php.

864 : array
865 {
866 $wt = new ilWikiPageTemplate($this->getWikiId());
867 $templates = array();
868 foreach ($wt->getAllInfo(ilWikiPageTemplate::TYPE_ADD_TO_PAGE, $this->getLanguage()) as $t) {
869 $templates[] = array("id" => $t["wpage_id"], "parent_type" => "wpg", "title" => $t["title"]);
870 }
871 return $templates;
872 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilWikiPageTemplate\TYPE_ADD_TO_PAGE.

◆ getGotoForWikiPageTarget()

static ilWikiPage::getGotoForWikiPageTarget ( string  $a_target,
bool  $a_offline = false 
)
static

Definition at line 847 of file class.ilWikiPage.php.

850 : string {
851 if (!$a_offline) {
852 $href = "./goto.php?target=wiki_wpage_" . $a_target;
853 } else {
854 $href = ILIAS_HTTP_PATH . "/goto.php?target=wiki_wpage_" . $a_target;
855 }
856 return $href;
857 }

Referenced by ilLMPageObjectGUI\getLinkXML(), and ilPageLinker\getLinkXML().

+ Here is the caller graph for this function:

◆ getLinksToPage()

static ilWikiPage::getLinksToPage ( int  $a_wiki_id,
int  $a_page_id,
string  $lang = "-" 
)
static

Definition at line 485 of file class.ilWikiPage.php.

489 : array {
490 global $DIC;
491
492 if ($lang === "") {
493 $lang = "-";
494 }
495 $ilDB = $DIC->database();
496
497 $sources = ilInternalLink::_getSourcesOfTarget("wpg", $a_page_id, 0);
498 $ids = array();
499 foreach ($sources as $source) {
500 if ($source["type"] === "wpg:pg" && $source["lang"] === $lang) {
501 $ids[] = $source["id"];
502 }
503 }
504
505 // get wiki page record
506 $query = "SELECT * FROM il_wiki_page wp, page_object p" .
507 " WHERE " . $ilDB->in("wp.id", $ids, false, "integer") .
508 " AND wp.id = p.page_id AND wp.lang = p.lang AND p.parent_type = " . $ilDB->quote("wpg", "text") .
509 " AND wp.wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
510 " AND wp.lang = " . $ilDB->quote($lang, "text") .
511 " ORDER BY title";
512 $set = $ilDB->query($query);
513
514 $pages = array();
515 while ($rec = $ilDB->fetchAssoc($set)) {
516 $pages[] = array_merge($rec, array("user" => $rec["last_change_user"],
517 "date" => $rec["last_change"]));
518 }
519 return $pages;
520 }

Referenced by ilWikiPageGUI\deleteWikiPageConfirmationScreen().

+ Here is the caller graph for this function:

◆ getNewWikiPages()

static ilWikiPage::getNewWikiPages ( int  $a_wiki_id)
static

Definition at line 652 of file class.ilWikiPage.php.

654 : array {
655 $pages = parent::getNewPages("wpg", $a_wiki_id);
656 foreach ($pages as $k => $page) {
657 $pages[$k]["title"] = self::lookupTitle($page["id"]);
658 }
659
660 return $pages;
661 }
static lookupTitle(int $a_page_id, string $lang="-")

◆ getNotificationGUI()

ilWikiPage::getNotificationGUI ( )
protected

This currently violates the layer model, since notifications render the abstracts with a GUI class.

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

54 {
55 return $this->service->gui()->notification();
56 }
This class is only in GUI layer, since it needs to get the abstracts for the page GUI.

◆ getPageIdForTitle()

static ilWikiPage::getPageIdForTitle ( int  $a_wiki_id,
string  $a_title,
string  $lang = "-" 
)
static

Get wiki page object for id and title.

Definition at line 398 of file class.ilWikiPage.php.

402 : ?int {
403 global $DIC;
404
405 if ($lang === "") {
406 $lang = "-";
407 }
408
409 $ilDB = $DIC->database();
410
411 $a_title = ilWikiUtil::makeDbTitle($a_title);
412
413 $query = "SELECT * FROM il_wiki_page" .
414 " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
415 " AND title = " . $ilDB->quote($a_title, "text") .
416 " AND lang = " . $ilDB->quote($lang, "text");
417 $set = $ilDB->query($query);
418 if ($rec = $ilDB->fetchAssoc($set)) {
419 return (int) $rec["id"];
420 }
421
422 return null;
423 }

Referenced by ilObjWikiGUI\addPagesSubTabs(), ilObjWikiGUI\addPageTabs(), ilObjWiki\cloneObject(), and ilWikiPageGUI\renamePage().

+ Here is the caller graph for this function:

◆ getPagesForSearch()

static ilWikiPage::getPagesForSearch ( int  $a_wiki_id,
string  $a_term 
)
static

Definition at line 874 of file class.ilWikiPage.php.

877 : array {
878 global $DIC;
879
880 $ilDB = $DIC->database();
881
882 $set = $ilDB->query("SELECT DISTINCT title FROM il_wiki_page" .
883 " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
884 " AND " . $ilDB->like("title", "text", "%" . $a_term . "%") .
885 " ORDER by title");
886 $res = array();
887 while ($rec = $ilDB->fetchAssoc($set)) {
888 $res[] = $rec["title"];
889 }
890
891 return $res;
892 }
$res
Definition: ltiservices.php:69

Referenced by ilWikiPageGUI\insertWikiLinkAC().

+ Here is the caller graph for this function:

◆ getParentType()

ilWikiPage::getParentType ( )

Reimplemented from ilPageObject.

Definition at line 35 of file class.ilWikiPage.php.

35 : string
36 {
37 return "wpg";
38 }

◆ getPopularPages()

static ilWikiPage::getPopularPages ( int  $a_wiki_id)
static

Definition at line 588 of file class.ilWikiPage.php.

590 : array {
591 global $DIC;
592
593 $ilDB = $DIC->database();
594
595 $query = "SELECT wp.*, po.view_cnt as cnt FROM il_wiki_page wp, page_object po" .
596 " WHERE wp.wiki_id = " . $ilDB->quote($a_wiki_id, "integer") .
597 " AND wp.id = po.page_id " .
598 " AND po.parent_type = " . $ilDB->quote("wpg", "text") . " " .
599 " ORDER BY po.view_cnt";
600 $set = $ilDB->query($query);
601
602 $pages = array();
603 while ($rec = $ilDB->fetchAssoc($set)) {
604 $pages[] = $rec;
605 }
606
607 return $pages;
608 }

◆ getRandomPage()

static ilWikiPage::getRandomPage ( int  $a_wiki_id)
static

Definition at line 627 of file class.ilWikiPage.php.

629 : string {
630 global $DIC;
631
632 $ilDB = $DIC->database();
633
634 $cnt = self::countPages($a_wiki_id);
635
636 if ($cnt < 1) {
637 return "";
638 }
639
640 $random = new \Random\Randomizer();
641 $rand = $random->getInt(1, $cnt);
642
643 $ilDB->setLimit(1, $rand);
644 $query = "SELECT title FROM il_wiki_page" .
645 " WHERE wiki_id = " . $ilDB->quote($a_wiki_id, "integer");
646 $s = $ilDB->query($query);
647 $r = $ilDB->fetchAssoc($s);
648
649 return $r["title"];
650 }
static countPages(int $a_wiki_id)

Referenced by ilObjWikiGUI\randomPageObject().

+ Here is the caller graph for this function:

◆ getRating()

ilWikiPage::getRating ( )

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

103 : bool
104 {
105 return $this->rating;
106 }

References $rating.

◆ getTitle()

ilWikiPage::getTitle ( )

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

63 : string
64 {
65 return $this->title;
66 }

References $title.

Referenced by ilObjWikiGUI\lookupSubObjectTitle().

+ Here is the caller graph for this function:

◆ getWikiContributors()

static ilWikiPage::getWikiContributors ( int  $a_wiki_id)
static

Definition at line 550 of file class.ilWikiPage.php.

552 : array {
553 return parent::getParentObjectContributors("wpg", $a_wiki_id);
554 }

Referenced by ilWikiContributorsTableGUI\getContributors().

+ Here is the caller graph for this function:

◆ getWikiId()

ilWikiPage::getWikiId ( )

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

73 : int
74 {
75 return $this->getParentId();
76 }

References ilPageObject\getParentId().

Referenced by ilWikiStat\handlePageDeletion().

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

◆ getWikiPageContributors()

static ilWikiPage::getWikiPageContributors ( int  $a_page_id)
static

Definition at line 556 of file class.ilWikiPage.php.

558 : array {
559 return parent::getPageContributors("wpg", $a_page_id);
560 }

Referenced by ilWikiPageGUI\deleteWikiPageConfirmationScreen().

+ Here is the caller graph for this function:

◆ getWikiRefId()

ilWikiPage::getWikiRefId ( )

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

83 : int
84 {
86 }

References $parent_ref_id.

◆ hideAdvancedMetadata()

ilWikiPage::hideAdvancedMetadata ( bool  $a_val)

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

108 : void
109 {
110 $this->hide_adv_md = $a_val;
111 }

◆ isAdvancedMetadataHidden()

ilWikiPage::isAdvancedMetadataHidden ( )

Definition at line 113 of file class.ilWikiPage.php.

113 : bool
114 {
115 return $this->hide_adv_md;
116 }

References $hide_adv_md.

◆ lookupAdvancedMetadataHidden()

static ilWikiPage::lookupAdvancedMetadataHidden ( int  $a_page_id)
static

Definition at line 894 of file class.ilWikiPage.php.

896 : bool {
897 global $DIC;
898
899 $ilDB = $DIC->database();
900
901 $query = "SELECT * FROM il_wiki_page" .
902 " WHERE id = " . $ilDB->quote($a_page_id, "integer");
903 $set = $ilDB->query($query);
904 if ($rec = $ilDB->fetchAssoc($set)) {
905 return (bool) $rec["hide_adv_md"];
906 }
907
908 return false;
909 }

Referenced by ilWikiFunctionsBlockGUI\getLegacyContent().

+ Here is the caller graph for this function:

◆ lookupObjIdByPage()

static ilWikiPage::lookupObjIdByPage ( int  $a_page_id)
static

returns the wiki/object id to a given page id

Definition at line 667 of file class.ilWikiPage.php.

669 : ?int {
670 global $DIC;
671
672 $ilDB = $DIC->database();
673
674 $query = "SELECT wiki_id FROM il_wiki_page" .
675 " WHERE id = " . $ilDB->quote($a_page_id, "integer");
676 $set = $ilDB->query($query);
677 if ($rec = $ilDB->fetchAssoc($set)) {
678 return (int) $rec["wiki_id"];
679 }
680
681 return null;
682 }

◆ lookupTitle()

static ilWikiPage::lookupTitle ( int  $a_page_id,
string  $lang = "-" 
)
static

◆ lookupWikiId()

static ilWikiPage::lookupWikiId ( int  $a_page_id)
static

Definition at line 441 of file class.ilWikiPage.php.

443 : ?int {
444 global $DIC;
445
446 $ilDB = $DIC->database();
447
448 $query = "SELECT wiki_id FROM il_wiki_page" .
449 " WHERE id = " . $ilDB->quote($a_page_id, "integer");
450 $set = $ilDB->query($query);
451 if ($rec = $ilDB->fetchAssoc($set)) {
452 return (int) $rec["wiki_id"];
453 }
454
455 return null;
456 }

Referenced by ilObjWikiAccess\_checkGoto(), ilObjWikiGUI\_goto(), ilWikiImporter\finalProcessing(), and ILIAS\Wiki\Page\ImportResolver\getIdForImportId().

+ Here is the caller graph for this function:

◆ preparePageForCompare()

ilWikiPage::preparePageForCompare ( ilPageObject  $page)

Reimplemented from ilPageObject.

Definition at line 911 of file class.ilWikiPage.php.

911 : void
912 {
913 $page->setWikiRefId($this->getWikiRefId());
914 }

◆ read()

ilWikiPage::read ( bool  $a_omit_page_read = false)

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

271 : void {
273
274 $query = "SELECT * FROM il_wiki_page WHERE id = " .
275 $ilDB->quote($this->getId(), "integer") .
276 " AND lang = " . $ilDB->quote($this->getLanguage(), "text");
277
278 $set = $ilDB->query($query);
279 $rec = $ilDB->fetchAssoc($set);
280
281 $this->setTitle($rec["title"]);
282 $this->setWikiId((int) $rec["wiki_id"]);
283 $this->setBlocked((bool) $rec["blocked"]);
284 $this->setRating((bool) $rec["rating"]);
285 $this->hideAdvancedMetadata((bool) $rec["hide_adv_md"]);
286
287 // get co page
288 if (!$a_omit_page_read) {
289 parent::read();
290 }
291 }
setRating(bool $a_val)
setBlocked(bool $a_val)
hideAdvancedMetadata(bool $a_val)
setWikiId(int $a_wikiid)
setTitle(string $a_title)

◆ rename()

ilWikiPage::rename ( string  $a_new_name)

Rename page.

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

689 : string {
691
692 // replace unallowed characters
693 $a_new_name = str_replace(array("<", ">"), '', $a_new_name);
694
695 // replace multiple whitespace characters by one single space
696 $a_new_name = trim(preg_replace('!\s+!', ' ', $a_new_name));
697
698 $page_title = ilWikiUtil::makeDbTitle($a_new_name);
699 $pg_id = self::getPageIdForTitle($this->getWikiId(), $page_title, $this->getLanguage());
700
701 $xml_new_name = str_replace("&", "&amp;", $a_new_name);
702
703 if ($pg_id == 0 || $pg_id == $this->getId()) {
704 $sources = ilInternalLink::_getSourcesOfTarget("wpg", $this->getId(), 0);
705
706 $this->log->debug("nr of pages linking to renamed page: " . count($sources));
707 foreach ($sources as $s) {
708 if ($s["type"] === "wpg:pg" && ilPageObject::_exists("wpg", $s["id"])) {
709 $wpage = new ilWikiPage($s["id"], 0, $s["lang"]);
710 $wpage->setWikiRefId($this->getWikiRefId());
711
712 $wiki_id = ilWikiPage::lookupWikiId($s["id"]);
714 $wpage->getXMLContent(),
715 $wiki_id,
716 false,
718 );
719 $this->log->debug("nr internal links: " . count($col));
720 $new_content = $wpage->getXMLContent();
721 foreach ($col as $c) {
722 // this complicated procedure is needed due to the fact
723 // that depending on the collation e = é is true
724 // in the (mysql) database
725 // see bug http://www.ilias.de/mantis/view.php?id=11227
726 $t1 = ilWikiUtil::makeDbTitle($c["nt"]->mTextform);
727 $t2 = ilWikiUtil::makeDbTitle($this->getTitle());
728
729 // this one replaces C2A0 (&nbsp;) by a usual space
730 // otherwise the comparision will fail, since you
731 // get these characters from tiny if more than one
732 // space is repeated in a string. This may not be
733 // 100% but we do not store $t1 anywhere and only
734 // modify it for the comparison
735 $t1 = preg_replace('/\xC2\xA0/', ' ', $t1);
736 $t2 = preg_replace('/\xC2\xA0/', ' ', $t2);
737
738 $set = $ilDB->query($q = "SELECT " . $ilDB->quote($t1, "text") . " = " . $ilDB->quote($t2, "text") . " isequal");
739 $rec = $ilDB->fetchAssoc($set);
740
741 if ($rec["isequal"]) {
742 $new_content =
743 str_replace(
744 "[[" . $c["nt"]->mTextform . "]]",
745 "[[" . $xml_new_name . "]]",
746 $new_content
747 );
748 if ($c["text"] != "") {
749 $new_content =
750 str_replace(
751 "[[" . $c["text"] . "]]",
752 "[[" . $xml_new_name . "]]",
753 $new_content
754 );
755 }
756 $add = ($c["text"] != "")
757 ? "|" . $c["text"]
758 : "";
759 $new_content =
760 str_replace(
761 "[[" . $c["nt"]->mTextform . $add . "]]",
762 "[[" . $xml_new_name . $add . "]]",
763 $new_content
764 );
765 }
766 }
767 $wpage->setXMLContent($new_content);
768 //echo htmlentities($new_content);
769 $wpage->update();
770 }
771 }
772
773 if (ilObjWiki::_lookupStartPage($this->getWikiId()) === $this->getTitle()) {
774 ilObjWiki::writeStartPage($this->getWikiId(), $a_new_name);
775 }
776
777 $this->setTitle($a_new_name);
778
779 $this->update();
780 }
781
782 return $a_new_name;
783 }
const IL_WIKI_MODE_EXT_COLLECT
static writeStartPage(int $a_id, string $a_name)
static _lookupStartPage(int $a_wiki_id)
update(bool $a_validate=true, bool $a_no_history=false)
static lookupWikiId(int $a_page_id)
$c
Definition: deliver.php:25
$q
Definition: shib_logout.php:25

◆ saveInternalLinks()

ilWikiPage::saveInternalLinks ( DOMDocument  $a_domdoc)

save internal links of page

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

Reimplemented from ilPageObject.

Definition at line 562 of file class.ilWikiPage.php.

564 : void {
565 parent::saveInternalLinks($a_domdoc);
566
567 if ($this->getWikiRefId() > 0) {
568 $link_manager = $this->service->domain()->links($this->getWikiRefId());
569 $link_manager->saveInternalLinksForPage(
570 $a_domdoc,
571 $this->getId(),
572 $this->getTitle(),
573 $this->getLanguage()
574 );
575 }
576 }

References ILIAS\Survey\Mode\getId(), getLanguage(), and ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle().

+ Here is the call graph for this function:

◆ setBlocked()

ilWikiPage::setBlocked ( bool  $a_val)

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

88 : void
89 {
90 $this->blocked = $a_val;
91 }

◆ setCopyProperties()

ilWikiPage::setCopyProperties ( ilPageObject  $new_page)
protected

Reimplemented from ilPageObject.

Definition at line 922 of file class.ilWikiPage.php.

922 : void
923 {
924 // see #44256
925 if ($new_page->getWikiId() === 0 || $new_page->getWikiId() === $this->getWikiId()) {
926 $new_page->setWikiRefId($this->getWikiRefId());
927 }
928 }

◆ setRating()

ilWikiPage::setRating ( bool  $a_val)

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

98 : void
99 {
100 $this->rating = $a_val;
101 }

◆ setTitle()

ilWikiPage::setTitle ( string  $a_title)

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

58 : void
59 {
60 $this->title = ilWikiUtil::makeDbTitle($a_title);
61 }

References ilWikiUtil\makeDbTitle().

+ Here is the call graph for this function:

◆ setTranslationProperties()

ilWikiPage::setTranslationProperties ( ilPageObject  $transl_page)
protected

Definition at line 916 of file class.ilWikiPage.php.

916 : void
917 {
918 parent::setTranslationProperties($transl_page);
919 $transl_page->setWikiRefId($this->getWikiRefId());
920 }

◆ setWikiId()

ilWikiPage::setWikiId ( int  $a_wikiid)

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

68 : void
69 {
70 $this->setParentId($a_wikiid);
71 }
setParentId(int $a_id)

References ilPageObject\setParentId().

+ Here is the call graph for this function:

◆ setWikiRefId()

ilWikiPage::setWikiRefId ( int  $a_wiki_ref_id)

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

78 : void
79 {
80 $this->parent_ref_id = $a_wiki_ref_id;
81 }

◆ update()

ilWikiPage::update ( bool  $a_validate = true,
bool  $a_no_history = false 
)
Returns
array|bool
Exceptions
ilDateTimeException

Reimplemented from ilPageObject.

Definition at line 231 of file class.ilWikiPage.php.

234 : array|bool {
236 $this->wiki_log->debug("start...");
237 // update wiki page data
238 $query = "UPDATE il_wiki_page SET " .
239 " title = " . $ilDB->quote($this->getTitle(), "text") .
240 ",wiki_id = " . $ilDB->quote($this->getWikiId(), "integer") .
241 ",blocked = " . $ilDB->quote((int) $this->getBlocked(), "integer") .
242 ",rating = " . $ilDB->quote((int) $this->getRating(), "integer") .
243 ",hide_adv_md = " . $ilDB->quote((int) $this->isAdvancedMetadataHidden(), "integer") .
244 " WHERE id = " . $ilDB->quote($this->getId(), "integer") .
245 " AND lang = " . $ilDB->quote($this->getLanguage(), "text");
246 $ilDB->manipulate($query);
247 $updated = parent::update($a_validate, $a_no_history);
248 if ($updated === true) {
249 $this->wiki_log->debug("send notification");
250 $this->getNotificationGUI()->send(
251 "update",
253 $this->getWikiRefId(),
254 $this->getId(),
255 null,
256 $this->getLanguage()
257 );
258
259 $this->wiki_log->debug("update news");
261 $this->updateNews(true);
262 } else {
263 return $updated;
264 }
265
266 return true;
267 }
static raiseContentChanged(int $obj_id)

◆ updateNews()

ilWikiPage::updateNews ( bool  $a_update = false)

Definition at line 786 of file class.ilWikiPage.php.

788 : void {
789 $ilUser = $this->user;
790
791 $news_set = new ilSetting("news");
792 $default_visibility = ($news_set->get("default_visibility") != "")
793 ? $news_set->get("default_visibility")
794 : "users";
795
796 if (!$a_update) {
797 $news_item = new ilNewsItem();
798 $news_item->setContext(
799 $this->getWikiId(),
800 "wiki",
801 $this->getId(),
802 "wpg"
803 );
804 $news_item->setPriority(NEWS_NOTICE);
805 $news_item->setTitle($this->getTitle());
806 $news_item->setContentTextIsLangVar(true);
807 $news_item->setContent("wiki_news_page_created");
808 $news_item->setUserId($ilUser->getId());
809 $news_item->setVisibility($default_visibility);
810 $news_item->create();
811 } else {
812 // get last news item of the day (if existing)
814 $this->getWikiId(),
815 "wiki",
816 $this->getId(),
817 "wpg",
818 true
819 );
820
821 if ($news_id > 0) {
822 $news_item = new ilNewsItem($news_id);
823 $news_item->setContent("wiki_news_page_changed");
824 $news_item->setUserId($ilUser->getId());
825 $news_item->setTitle($this->getTitle());
826 $news_item->setContentTextIsLangVar(true);
827 $news_item->update(true);
828 } else {
829 $news_item = new ilNewsItem();
830 $news_item->setContext(
831 $this->getWikiId(),
832 "wiki",
833 $this->getId(),
834 "wpg"
835 );
836 $news_item->setPriority(NEWS_NOTICE);
837 $news_item->setTitle($this->getTitle());
838 $news_item->setContentTextIsLangVar(true);
839 $news_item->setContent("wiki_news_page_changed");
840 $news_item->setUserId($ilUser->getId());
841 $news_item->setVisibility($default_visibility);
842 $news_item->create();
843 }
844 }
845 }
const NEWS_NOTICE
A news item can be created by different sources.
static getLastNewsIdForContext(int $a_context_obj_id, string $a_context_obj_type, int $a_context_sub_obj_id=0, string $a_context_sub_obj_type="", bool $a_only_today=false)
Get last news id of news set related to a certain context.
ILIAS Setting Class.

Field Documentation

◆ $blocked

bool ilWikiPage::$blocked = false
protected

Definition at line 31 of file class.ilWikiPage.php.

Referenced by getBlocked().

◆ $hide_adv_md

bool ilWikiPage::$hide_adv_md = false
protected

Definition at line 33 of file class.ilWikiPage.php.

Referenced by isAdvancedMetadataHidden().

◆ $parent_ref_id

int ilWikiPage::$parent_ref_id = 0
protected

Definition at line 29 of file class.ilWikiPage.php.

Referenced by getWikiRefId().

◆ $rating

bool ilWikiPage::$rating = false
protected

Definition at line 32 of file class.ilWikiPage.php.

Referenced by getRating().

◆ $repo

ILIAS Wiki Page PageDBRepository ilWikiPage::$repo
protected

Definition at line 26 of file class.ilWikiPage.php.

◆ $service

ILIAS Wiki InternalService ilWikiPage::$service
protected

Definition at line 28 of file class.ilWikiPage.php.

◆ $title

string ilWikiPage::$title = ""
protected

Definition at line 30 of file class.ilWikiPage.php.

Referenced by getTitle().

◆ $wiki_log

ilLogger ilWikiPage::$wiki_log
protected

Definition at line 27 of file class.ilWikiPage.php.


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