ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilWikiPage Class Reference

Class ilWikiPage. More...

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

Public Member Functions

 getParentType ()
 Get parent type.
 afterConstructor ()
 After constructor.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setWikiId ($a_wikiid)
 Set Wiki Object Id.
 getWikiId ()
 Get Wiki Object Id.
 setWikiRefId ($a_wiki_ref_id)
 Set Wiki Ref Id.
 getWikiRefId ()
 Get Wiki Ref Id.
 setBlocked ($a_val)
 Set blocked.
 getBlocked ()
 Get blocked.
 setRating ($a_val)
 Set rating.
 getRating ()
 Get rating.
 createFromXML ()
 Create page from xml.
 create ($a_prevent_page_creation=false)
 Create new wiki page.
 update ($a_validate=true, $a_no_history=false)
 update object data
 read ($a_omit_page_read=false)
 Read wiki data.
 delete ()
 delete wiki page and al related data
 saveInternalLinks ($a_domdoc)
 save internal links of page
 rename ($a_new_name)
 Rename page.
 updateNews ($a_update=false)
 Create.
 getNewsContent ()
 Get content for a wiki news item.
- Public Member Functions inherited from ilPageObject
 ilPageObject ($a_id=0, $a_old_nr=0, $a_lang="-")
 Constructor public.
 initPageConfig ()
 Init page config.
 setLanguage ($a_val)
 Set language.
 getLanguage ()
 Get language.
 setPageConfig ($a_val)
 Set page config object.
 getPageConfig ()
 Get page config object.
 setRenderMd5 ($a_rendermd5)
 Set Render MD5.
 getRenderMd5 ()
 Get Render MD5.
 setRenderedContent ($a_renderedcontent)
 Set Rendered Content.
 getRenderedContent ()
 Get Rendered Content.
 setRenderedTime ($a_renderedtime)
 Set Rendered Time.
 getRenderedTime ()
 Get Rendered Time.
 setLastChange ($a_lastchange)
 Set Last Change.
 getLastChange ()
 Get Last Change.
 setLastChangeUser ($a_val)
 Set last change user.
 getLastChangeUser ()
 Get last change user.
 setShowActivationInfo ($a_val)
 Set show page activation info.
 getShowActivationInfo ()
 Get show page activation info.
 read ()
 Read page data.
 buildDom ($a_force=false)
 freeDom ()
 getDom ()
 Deprecated php4DomDocument.
 getDomDoc ()
 Get dom doc (php5 dom document)
 setId ($a_id)
 set id
 getId ()
 setParentId ($a_id)
 getParentId ()
 addUpdateListener (&$a_object, $a_method, $a_parameters="")
 callUpdateListeners ()
 setActive ($a_active)
 set activation
 getActive ($a_check_scheduled_activation=false)
 get activation
 _writeActive ($a_id, $a_parent_type, $a_active, $a_reset_scheduled_activation=true, $a_lang="-")
 write activation status
 _lookupActivationData ($a_id, $a_parent_type, $a_lang="-")
 Lookup activation data.
 _writeParentId ($a_parent_type, $a_pg_id, $a_par_id)
 Write parent id.
 setActivationStart ($a_activationstart)
 Set Activation Start.
 getActivationStart ()
 Get Activation Start.
 setActivationEnd ($a_activationend)
 Set Activation End.
 getActivationEnd ()
 Get Activation End.
 getContentObject ($a_hier_id, $a_pc_id="")
 Get a content object of the page.
getContentNode ($a_hier_id, $a_pc_id="")
 Get content node from dom.
 checkForTag ($a_content_tag, $a_hier_id, $a_pc_id="")
 Get content node from dom.
 lookforhier ($a_hier_id)
getNode ()
 setXMLContent ($a_xml, $a_encoding="UTF-8")
 set xml content of page, start with <PageObject...>, end with </PageObject>, comply with ILIAS DTD, omit MetaData, use utf-8!
 appendXMLContent ($a_xml)
 append xml content to page setXMLContent must be called before and the same encoding must be used
 getXMLContent ($a_incl_head=false)
 get xml content of page
 copyXmlContent ($a_clone_mobs=false)
 Copy content of page; replace page components with copies where necessary (e.g.
 handleCopiedContent ($a_dom, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content.
 newIIMCopies ($temp_dom)
 Replaces media objects in interactive images with copies of the interactive images.
 newMobCopies ($temp_dom)
 Replaces media objects with copies.
 newQuestionCopies (&$temp_dom)
 Replaces existing question content elements with new copies.
 removeQuestions (&$temp_dom)
 Remove questions from document.
 countPageContents ()
 Remove questions from document.
 getXMLFromDom ($a_incl_head=false, $a_append_mobs=false, $a_append_bib=false, $a_append_str="", $a_omit_pageobject_tag=false)
 get xml content of page from dom (use this, if any changes are made to the document)
 getLanguageVariablesXML ()
 Get language variables as XML.
 appendLangVarXML (&$xml, $var)
 getFirstParagraphText ()
 setParagraphContent ($a_hier_id, $a_content)
 Set content of paragraph.
 setContainsIntLink ($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)
 containsIntLink ()
 returns true, if page was marked as containing an intern link (via setContainsIntLink) (this method should only be called by the import parser)
 needsImportParsing ($a_parse="")
 setContainsQuestion ($a_val)
 Set contains question.
 getContainsQuestion ()
 Get contains question.
 collectMediaObjects ($a_inline_only=true)
 get all media objects, that are referenced and used within the page
 getInternalLinks ($a_cnt_multiple=false)
 get all internal links that are used within the page
 getMultimediaXML ()
 get a xml string that contains all media object elements, that are referenced by any media alias in the page
 getMediaAliasElement ($a_mob_id, $a_nr=1)
 get complete media object (alias) element
 validateDom ()
 Validate the page content agains page DTD.
 addHierIDs ()
 Add hierarchical ID (e.g.
 getHierIds ()
 get all hierarchical ids
 getFirstRowIds ()
 get ids of all first table rows
 getFirstColumnIds ()
 get ids of all first table columns
 getListItemIds ()
 get ids of all list items
 getFileItemIds ()
 get ids of all file items
 stripHierIDs ()
 strip all hierarchical id attributes out of the dom tree
 getHierIdsForPCIds ($a_pc_ids)
 Get hier ids for a set of pc ids.
 addFileSizes ()
 add file sizes
 resolveIntLinks ()
 Resolves all internal link targets of the page, if targets are available (after import)
 resolveMediaAliases ($a_mapping)
 Resolve media aliases (after import)
 resolveIIMMediaAliases ($a_mapping)
 Resolve iim media aliases (in ilContObjParse)
 resolveFileItems ($a_mapping)
 Resolve file items (after import)
 resolveQuestionReferences ($a_mapping)
 Resolve all quesion references (after import)
 moveIntLinks ($a_from_to)
 Move internal links from one destination to another.
 handleImportRepositoryLink ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 updateFromXML ()
 Updates page object with current xml content.
 afterUpdate ()
 After update.
 saveStyleUsage ($a_domdoc, $a_old_nr=0)
 Save all style class/template usages.
 deleteStyleUsages ($a_old_nr=0)
 Delete style usages.
 getLastUpdateOfIncludedElements ()
 Get last update of included elements (media objects and files).
 deleteInternalLinks ()
 Delete internal links.
 create ()
 create new page (with current xml data)
 deleteContent ($a_hid, $a_update=true, $a_pcid="")
 delete content object with hierarchical id $a_hid
 deleteContents ($a_hids, $a_update=true, $a_self_ass=false)
 Delete multiple content objects.
 cutContents ($a_hids)
 Copy contents to clipboard and cut them from the page.
 copyContents ($a_hids)
 Copy contents to clipboard.
 pasteContents ($a_hier_id, $a_self_ass=false)
 Paste contents from pc clipboard.
 switchEnableMultiple ($a_hids, $a_update=true, $a_self_ass=false)
 (De-)activate elements
 deleteContentFromHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id >= $a_hid
 deleteContentBeforeHierId ($a_hid, $a_update=true)
 delete content object with hierarchical id < $a_hid
 _moveContentAfterHierId (&$a_source_page, &$a_target_page, $a_hid)
 move content of hierarchical id >= $a_hid to other page
 insertContent (&$a_cont_obj, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent
 insertContentNode (&$a_cont_node, $a_pos, $a_mode=IL_INSERT_AFTER, $a_pcid="")
 insert a content node before/after a sibling or as first child of a parent
 moveContentBefore ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids)
 moveContentAfter ($a_source, $a_target, $a_spcid="", $a_tpcid="")
 move content object from position $a_source before position $a_target (both hierarchical content ids)
 bbCode2XML (&$a_content)
 transforms bbCode to corresponding xml
 insertInstIntoIDs ($a_inst, $a_res_ref_to_obj_id=true)
 inserts installation id into ids (e.g.
 highlightText ($a_text, $proglang, $autoindent)
 Highligths Text with given ProgLang.
 hasHighlighter ($hfile_ext)
 insertSourceCodeParagraphs ($a_output, $outputmode="presentation")
 depending on the SubCharacteristic and ShowLineNumbers attribute the line numbers and html tags for the syntax highlighting will be inserted using the dom xml functions
 checkPCIds ()
 Check, whether (all) page content hashes are set.
 getAllPCIds ()
 Get all pc ids.
 existsPCId ($a_pc_id)
 existsPCId
 generatePcId ($a_pc_ids=false)
 Generate new pc id.
 insertPCIds ()
 Insert Page Content IDs.
 getPageContentsHashes ()
 Get page contents hashes.
 getQuestionIds ()
 Get question ids.
 send_paragraph ($par_id, $filename)
 getFO ()
 get fo page content
 registerOfflineHandler ($handler)
 containsDeactivatedElements ($a_content)
 Check whether content contains deactivated elements.
 getHistoryEntries ()
 Get History Entries.
 getHistoryEntry ($a_old_nr)
 Get History Entry.
 getHistoryInfo ($a_nr)
 Get information about a history entry, its predecessor and its successor.
 addChangeDivClasses ($a_hashes)
 compareVersion ($a_left, $a_right)
 Compares to revisions of the page.
 increaseViewCnt ()
 Increase view cnt.
 writeRenderedContent ($a_content, $a_md5)
 Write rendered content.
 containsIntLinks ($a_content)
 Check whether content contains internal links.
 performAutomaticModifications ()
 Perform automatic modifications (may be overwritten by sub classes)
 saveInitialOpenedContent ($a_type, $a_id, $a_target)
 Save initial opened content.
 getInitialOpenedContent ()
 Get initial opened content.
 beforePageContentUpdate ($a_page_content)
 Before page content update.
 copy ($a_id, $a_parent_type="", $a_parent_id=0, $a_clone_mobs=false)
 Copy page.
 copyPageToTranslation ($a_target_lang)
 Copy page to translation.
 getEditLock ()
 Get page lock.
 releasePageLock ()
 Release page lock.
 getEditLockInfo ()
 Get edit lock info.

Static Public Member Functions

static deleteAllPagesOfWiki ($a_wiki_id)
 delete wiki page and al related data
static exists ($a_wiki_id, $a_title)
 Checks whether a page with given title exists.
static getIdForPageTitle ($a_wiki_id, $a_title)
 Checks whether a page with given title exists.
static getPageIdForTitle ($a_wiki_id, $a_title)
 Get wiki page object for id and title.
static lookupTitle ($a_page_id)
 Checks whether a page with given title exists.
static lookupWikiId ($a_page_id)
 Lookup wiki id.
static getAllPages ($a_wiki_id)
 Get all pages of wiki.
static getLinksToPage ($a_wiki_id, $a_page_id)
 Get links to a page.
static getOrphanedPages ($a_wiki_id)
 Get orphaned pages of wiki.
static _wikiPageExists ($a_wiki_id, $a_title)
 Check whether page exists for wiki or not.
static getParentObjectContributors ($a_wiki_id)
 Get all contributors of wiki.
static getPageContributors ($a_page_id)
 Get all contributors of wiki.
static _getPageIdForWikiTitle ($a_wiki_id, $a_title)
 Checks whether a page with given title exists.
static getPopularPages ($a_wiki_id)
 Get popular pages of wiki.
static countPages ($a_wiki_id)
 Count pages of wiki.
static getRandomPage ($a_wiki_id)
 Get a random page.
static getNewPages ($a_wiki_id)
 Get all pages of wiki.
static lookupObjIdByPage ($a_page_id)
 returns the wiki/object id to a given page id
static getGotoForWikiPageTarget ($a_target, $a_offline=false)
 Get goto href for internal wiki page link target.
- Static Public Member Functions inherited from ilPageObject
static _exists ($a_parent_type, $a_id, $a_lang="")
 Checks whether page exists.
static _existsAndNotEmpty ($a_parent_type, $a_id, $a_lang="-")
 Checks whether page exists and is not empty (may return true on some empty pages)
static preloadActivationDataByParentId ($a_parent_id)
 Preload activation data by Parent Id.
static _lookupActive ($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
 lookup activation status
static _isScheduledActivation ($a_id, $a_parent_type, $a_lang="-")
 Check whether page is activated by time schedule.
static lookupParentId ($a_id, $a_type)
 Lookup parent id.
static _handleImportRepositoryLinks ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 Change targest of repository links.
static _lookupContainsDeactivatedElements ($a_id, $a_parent_type, $a_lang="-")
 lookup whether page contains deactivated elements
static getRecentChanges ($a_parent_type, $a_parent_id, $a_period=30, $a_lang="")
 Get recent pages changes for parent object.
static getAllPages ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all pages for parent object.
static getNewPages ($a_parent_type, $a_parent_id, $a_lang="-")
 Get new pages.
static getParentObjectContributors ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all contributors for parent object.
static getPageContributors ($a_parent_type, $a_page_id, $a_lang="-")
 Get all contributors for parent object.
static getPagesWithLinks ($a_parent_type, $a_parent_id, $a_lang="-")
 Get all pages for parent object that contain internal links.
static lookupTranslations ($a_parent_type, $a_id)
 Lookup translations.

Protected Attributes

 $blocked = false

Additional Inherited Members

- Data Fields inherited from ilPageObject
 $id
 $ilias
 $dom
 $xml
 $encoding
 $node
 $cur_dtd = "ilias_pg_4_4.dtd"
 $contains_int_link
 $needs_parsing
 $parent_type
 $parent_id
 $update_listeners
 $update_listener_cnt
 $offline_handler
 $dom_builded
 $history_saved
 $language = "-"
- Static Public Attributes inherited from ilPageObject
static $exists = array()
- Protected Member Functions inherited from ilPageObject
 __afterUpdate ($a_domdoc, $a_xml, $a_creation=false, $a_empty=false)
 After update event handler (internal).
 __beforeDelete ()
 Before deletion handler (internal).
 __afterHistoryEntry ($a_old_domdoc, $a_old_content, $a_old_nr)
 Before deletion handler (internal).
- Static Protected Attributes inherited from ilPageObject
static $activation_data = array()

Detailed Description

Class ilWikiPage.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Member Function Documentation

static ilWikiPage::_getPageIdForWikiTitle (   $a_wiki_id,
  $a_title 
)
static

Checks whether a page with given title exists.

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

References $query.

Referenced by rename(), ilWikiPageGUI\renamePage(), and saveInternalLinks().

{
global $ilDB;
$query = "SELECT id FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id, "integer").
" AND title = ".$ilDB->quote($a_title, "text");
$set = $ilDB->query($query);
if($rec = $ilDB->fetchAssoc($set))
{
return $rec["id"];
}
return false;
}

+ Here is the caller graph for this function:

static ilWikiPage::_wikiPageExists (   $a_wiki_id,
  $a_title 
)
static

Check whether page exists for wiki or not.

public

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

References $query, and ilWikiUtil\makeDbTitle().

Referenced by ilObjWikiGUI\gotoPageObject(), ilWikiUtil\makeLink(), and ilWikiUtil\processInternalLinks().

{
global $ilDB;
$a_title = ilWikiUtil::makeDbTitle($a_title);
$query = "SELECT id FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id, "integer").
" AND title = ".$ilDB->quote($a_title, "text");
$set = $ilDB->query($query);
$pages = array();
if ($rec = $ilDB->fetchAssoc($set))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWikiPage::afterConstructor ( )

After constructor.

Parameters
@return

Reimplemented from ilPageObject.

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

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

{
$this->getPageConfig()->configureByObjectId($this->getParentId());
}

+ Here is the call graph for this function:

static ilWikiPage::countPages (   $a_wiki_id)
static

Count pages of wiki.

Parameters
int$a_wiki_idWiki ID

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

References $query.

Referenced by getRandomPage().

{
global $ilDB;
// delete record of table il_wiki_data
$query = "SELECT count(*) as cnt FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id, "integer");
$s = $ilDB->query($query);
$r = $ilDB->fetchAssoc($s);
return $r["cnt"];
}

+ Here is the caller graph for this function:

ilWikiPage::create (   $a_prevent_page_creation = false)

Create new wiki page.

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

References ilPageObject\$id, $query, ilPageObject\create(), getBlocked(), ilPageObject\getDomDoc(), ilPageObject\getId(), getRating(), getTitle(), getWikiId(), getWikiRefId(), saveInternalLinks(), ilWikiUtil\sendNotification(), ilPageObject\setId(), ilNotification\TYPE_WIKI, and updateNews().

{
global $ilDB;
$id = $ilDB->nextId("il_wiki_page");
$this->setId($id);
$query = "INSERT INTO il_wiki_page (".
"id".
", title".
", wiki_id".
", blocked".
", rating".
" ) VALUES (".
$ilDB->quote($this->getId(), "integer")
.",".$ilDB->quote($this->getTitle(), "text")
.",".$ilDB->quote((int) $this->getWikiId(), "integer")
.",".$ilDB->quote((int) $this->getBlocked(), "integer")
.",".$ilDB->quote((int) $this->getRating(), "integer")
.")";
$ilDB->manipulate($query);
// create page object
if (!$a_prevent_page_creation)
{
$this->saveInternalLinks($this->getDomDoc());
include_once "./Services/Notification/classes/class.ilNotification.php";
}
$this->updateNews();
}

+ Here is the call graph for this function:

ilWikiPage::createFromXML ( )

Create page from xml.

Reimplemented from ilPageObject.

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

References ilPageObject\read().

{
global $ilDB;
// ilWikiDataset creates wiki pages without copage objects
// (see create function in this class, parameter $a_prevent_page_creation)
// The ilCOPageImporter will call createFromXML without running through the read
// method -> we will miss the important wiki id, thus we read it now
// see also bug #12224
$set = $ilDB->query("SELECT id FROM il_wiki_page ".
" WHERE id = ".$ilDB->quote($this->getId(), "integer")
);
if ($rec = $ilDB->fetchAssoc($set))
{
$this->read(true);
}
}

+ Here is the call graph for this function:

ilWikiPage::delete ( )

delete wiki page and al related data

public

Reimplemented from ilPageObject.

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

References $query, ilInternalLink\_deleteAllLinksToTarget(), ilPageObject\getId(), getLinksToPage(), getTitle(), getWikiId(), getWikiRefId(), ilNotification\removeForObject(), ilWikiUtil\sendNotification(), and ilNotification\TYPE_WIKI_PAGE.

{
global $ilDB;
// get other pages that link to this page
$linking_pages = ilWikiPage::getLinksToPage($this->getWikiId(),
$this->getId());
// delete internal links information to this page
include_once("./Services/COPage/classes/class.ilInternalLink.php");
include_once "./Services/Notification/classes/class.ilNotification.php";
// remove all notifications
include_once "./Services/Notification/classes/class.ilNotification.php";
// delete record of table il_wiki_data
$query = "DELETE FROM il_wiki_page".
" WHERE id = ".$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($query);
// delete co page
// make links of other pages to this page a missing link
foreach($linking_pages as $lp)
{
$ilDB->manipulateF("DELETE FROM il_wiki_missing_page ".
" WHERE wiki_id = %s AND source_id = %s AND target_name = %s ",
array("integer", "integer", "text"),
array($this->getWikiId(), $lp["id"], $this->getTitle()));
$ilDB->manipulateF("INSERT INTO il_wiki_missing_page ".
"(wiki_id, source_id, target_name) VALUES ".
"(%s,%s,%s)",
array("integer", "integer", "text"),
array($this->getWikiId(), $lp["id"], $this->getTitle()));
}
return true;
}

+ Here is the call graph for this function:

static ilWikiPage::deleteAllPagesOfWiki (   $a_wiki_id)
static

delete wiki page and al related data

public

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

References $query.

Referenced by ilObjWiki\delete().

{
global $ilDB;
// delete record of table il_wiki_data
$query = "SELECT * FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id, "integer");
$set = $ilDB->query($query);
while($rec = $ilDB->fetchAssoc($set))
{
$wiki_page = new ilWikiPage($rec["id"]);
$wiki_page->delete();
}
}

+ Here is the caller graph for this function:

static ilWikiPage::exists (   $a_wiki_id,
  $a_title 
)
static

Checks whether a page with given title exists.

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

References $query, and ilWikiUtil\makeDbTitle().

Referenced by ilWikiHandlerGUI\executeCommand(), ilObjWiki\update(), and ilObjWikiGUI\viewPageObject().

{
global $ilDB;
$a_title = ilWikiUtil::makeDbTitle($a_title);
$query = "SELECT id FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id, "integer").
" AND title = ".$ilDB->quote($a_title, "text");
$set = $ilDB->query($query);
if($rec = $ilDB->fetchAssoc($set))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilWikiPage::getAllPages (   $a_wiki_id)
static

Get all pages of wiki.

public

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

References $query.

Referenced by ilObjWiki\cloneObject(), ilObjWikiGUI\editImportantPagesObject(), ilWikiHTMLExport\exportHTMLPages(), getOrphanedPages(), ilWikiPagesTableGUI\getPages(), ilWikiExporter\getXmlExportTailDependencies(), ilWikiPageGUI\initPrintViewSelectionForm(), ilObjWikiGUI\printViewObject(), and ilInternalLinkGUI\showLinkHelp().

{
global $ilDB;
$pages = parent::getAllPages("wpg", $a_wiki_id);
$query = "SELECT * FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id, "integer").
" ORDER BY title";
$set = $ilDB->query($query);
$pg = array();
while($rec = $ilDB->fetchAssoc($set))
{
if (isset($pages[$rec["id"]]))
{
$pg[$rec["id"]] = $pages[$rec["id"]];
$pg[$rec["id"]]["title"] = $rec["title"];
}
}
return $pg;
}

+ Here is the caller graph for this function:

ilWikiPage::getBlocked ( )

Get blocked.

Returns
boolean blocked

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

References $blocked.

Referenced by create(), and update().

{
}

+ Here is the caller graph for this function:

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

Get goto href for internal wiki page link target.

Parameters
@return

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

Referenced by ilGlossaryPresentationGUI\getLinkXML(), ilLMPresentationGUI\getLinkXML(), and ilPageObjectGUI\setDefaultLinkXml().

{
if (!$a_offline)
{
$href = "./goto.php?target=wiki_wpage_".$a_target;
}
else
{
$href = ILIAS_HTTP_PATH."/goto.php?target=wiki_wpage_".$a_target;
}
return $href;
}

+ Here is the caller graph for this function:

static ilWikiPage::getIdForPageTitle (   $a_wiki_id,
  $a_title 
)
static

Checks whether a page with given title exists.

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

References $query, and ilWikiUtil\makeDbTitle().

Referenced by ilWikiUtil\makeLink().

{
global $ilDB;
$a_title = ilWikiUtil::makeDbTitle($a_title);
$query = "SELECT id FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id, "integer").
" AND title = ".$ilDB->quote($a_title, "text");
$set = $ilDB->query($query);
if($rec = $ilDB->fetchAssoc($set))
{
return $rec["id"];
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilWikiPage::getLinksToPage (   $a_wiki_id,
  $a_page_id 
)
static

Get links to a page.

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

References $query, and ilInternalLink\_getSourcesOfTarget().

Referenced by delete(), ilWikiPageGUI\deleteWikiPageConfirmationScreen(), and ilWikiPagesTableGUI\getPages().

{
global $ilDB;
include_once("./Services/COPage/classes/class.ilInternalLink.php");
$sources = ilInternalLink::_getSourcesOfTarget("wpg", $a_page_id, 0);
$ids = array();
foreach ($sources as $source)
{
if ($source["type"] == "wpg:pg")
{
$ids[] = $source["id"];
}
}
// get wiki page record
$query = "SELECT * FROM il_wiki_page wp, page_object p".
" WHERE ".$ilDB->in("wp.id", $ids, false, "integer").
" AND wp.id = p.page_id AND p.parent_type = ".$ilDB->quote("wpg", "text").
" AND wp.wiki_id = ".$ilDB->quote($a_wiki_id, "integer").
" ORDER BY title";
$set = $ilDB->query($query);
$pages = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$pages[] = array_merge($rec, array("user" => $rec["last_change_user"],
"date" => $rec["last_change"]));
}
return $pages;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilWikiPage::getNewPages (   $a_wiki_id)
static

Get all pages of wiki.

public

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

References lookupTitle().

Referenced by ilWikiPagesTableGUI\getPages().

{
global $ilDB;
$pages = parent::getNewPages("wpg", $a_wiki_id);
foreach($pages as $k => $page)
{
$pages[$k]["title"] = ilWikiPage::lookupTitle($page["id"]);
}
return $pages;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWikiPage::getNewsContent ( )

Get content for a wiki news item.

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

{
return "12.1.1: Test User, Max";
}
static ilWikiPage::getOrphanedPages (   $a_wiki_id)
static

Get orphaned pages of wiki.

public

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

References $query, ilInternalLink\_getSourcesOfTarget(), ilObjWiki\_lookupStartPage(), and getAllPages().

Referenced by ilWikiPagesTableGUI\getPages().

{
global $ilDB;
$pages = ilWikiPage::getAllPages($a_wiki_id);
include_once("./Services/COPage/classes/class.ilInternalLink.php");
$orphaned = array();
foreach ($pages as $k => $page)
{
$sources = ilInternalLink::_getSourcesOfTarget("wpg", $page["id"], 0);
$ids = array();
foreach ($sources as $source)
{
if ($source["type"] == "wpg:pg")
{
$ids[] = $source["id"];
}
}
$query = "SELECT count(*) cnt FROM il_wiki_page".
" WHERE ".$ilDB->in("id", $ids, false, "integer").
" AND wiki_id = ".$ilDB->quote($a_wiki_id, "integer").
" GROUP BY wiki_id";
$set = $ilDB->query($query);
$rec = $ilDB->fetchAssoc($set);
if ($rec["cnt"] == 0 &&
ilObjWiki::_lookupStartPage($a_wiki_id) != $page["title"])
{
$orphaned[] = $page;
}
}
return $orphaned;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilWikiPage::getPageContributors (   $a_page_id)
static

Get all contributors of wiki.

public

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

Referenced by ilWikiPageGUI\deleteWikiPageConfirmationScreen().

{
global $ilDB;
$contributors = parent::getPageContributors("wpg", $a_page_id);
return $contributors;
}

+ Here is the caller graph for this function:

static ilWikiPage::getPageIdForTitle (   $a_wiki_id,
  $a_title 
)
static

Get wiki page object for id and title.

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

References $query, and ilWikiUtil\makeDbTitle().

Referenced by ilObjWikiGUI\addPagesSubTabs(), ilObjWikiGUI\addPageTabs(), ilObjWiki\cloneObject(), ilWikiHandlerGUI\executeCommand(), ilWikiPageGUI\getGUIForTitle(), and ilWikiPageGUI\getTabs().

{
global $ilDB;
$a_title = ilWikiUtil::makeDbTitle($a_title);
$query = "SELECT * FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id, "integer").
" AND title = ".$ilDB->quote($a_title, "text");
$set = $ilDB->query($query);
if($rec = $ilDB->fetchAssoc($set))
{
return $rec["id"];
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilWikiPage::getParentObjectContributors (   $a_wiki_id)
static

Get all contributors of wiki.

public

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

Referenced by ilWikiContributorsTableGUI\getContributors().

{
global $ilDB;
$contributors = parent::getParentObjectContributors("wpg", $a_wiki_id);
return $contributors;
}

+ Here is the caller graph for this function:

ilWikiPage::getParentType ( )

Get parent type.

Returns
string parent type

Reimplemented from ilPageObject.

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

{
return "wpg";
}
static ilWikiPage::getPopularPages (   $a_wiki_id)
static

Get popular pages of wiki.

public

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

References $query.

Referenced by ilWikiPagesTableGUI\getPages().

{
global $ilDB;
$query = "SELECT wp.*, po.view_cnt as cnt FROM il_wiki_page wp, page_object po".
" WHERE wp.wiki_id = ".$ilDB->quote($a_wiki_id, "integer").
" AND wp.id = po.page_id ".
" AND po.parent_type = ".$ilDB->quote("wpg", "text")." ".
" ORDER BY po.view_cnt";
$set = $ilDB->query($query);
$pages = array();
while($rec = $ilDB->fetchAssoc($set))
{
$pages[] = $rec;
}
return $pages;
}

+ Here is the caller graph for this function:

static ilWikiPage::getRandomPage (   $a_wiki_id)
static

Get a random page.

Parameters
int$a_wiki_idWiki ID

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

References $query, and countPages().

Referenced by ilObjWikiGUI\randomPageObject().

{
global $ilDB;
$cnt = ilWikiPage::countPages($a_wiki_id);
if ($cnt < 1)
{
return "";
}
$rand = rand(1, $cnt);
// delete record of table il_wiki_data
$ilDB->setLimit(1, $rand);
$query = "SELECT title FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id, "integer");
$s = $ilDB->query($query);
$r = $ilDB->fetchAssoc($s);
return $r["title"];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWikiPage::getRating ( )

Get rating.

Returns
boolean

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

Referenced by create(), and update().

{
return $this->rating;
}

+ Here is the caller graph for this function:

ilWikiPage::getTitle ( )

Get Title.

Returns
string Title

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

Referenced by create(), delete(), rename(), saveInternalLinks(), update(), and updateNews().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilWikiPage::getWikiId ( )

Get Wiki Object Id.

Returns
int Wiki Object Id

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

References ilPageObject\getParentId().

Referenced by create(), delete(), rename(), saveInternalLinks(), update(), and updateNews().

{
return $this->getParentId();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWikiPage::getWikiRefId ( )

Get Wiki Ref Id.

Returns
int Wiki Ref Id

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

Referenced by create(), delete(), and update().

{
return $this->parent_ref_id;
}

+ Here is the caller graph for this function:

static ilWikiPage::lookupObjIdByPage (   $a_page_id)
static

returns the wiki/object id to a given page id

Parameters
$a_page_id
Returns
int the object id

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

References $query.

Referenced by ilObjMediaObject\getParentObjectIdForUsage().

{
global $ilDB;
$query = "SELECT wiki_id FROM il_wiki_page".
" WHERE id = ".$ilDB->quote($a_page_id, "integer");
$set = $ilDB->query($query);
if($rec = $ilDB->fetchAssoc($set))
{
return $rec["wiki_id"];
}
return false;
}

+ Here is the caller graph for this function:

static ilWikiPage::lookupWikiId (   $a_page_id)
static

Lookup wiki id.

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

References $query.

Referenced by ilObjWikiAccess\_checkGoto(), ilObjWikiGUI\_goto(), and ilWikiImporter\finalProcessing().

{
global $ilDB;
$query = "SELECT wiki_id FROM il_wiki_page".
" WHERE id = ".$ilDB->quote($a_page_id, "integer");
$set = $ilDB->query($query);
if ($rec = $ilDB->fetchAssoc($set))
{
return $rec["wiki_id"];
}
return false;
}

+ Here is the caller graph for this function:

ilWikiPage::read (   $a_omit_page_read = false)

Read wiki data.

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

References $query, ilPageObject\getId(), ilPageObject\read(), setBlocked(), setRating(), setTitle(), and setWikiId().

{
global $ilDB;
$query = "SELECT * FROM il_wiki_page WHERE id = ".
$ilDB->quote($this->getId(), "integer");
$set = $ilDB->query($query);
$rec = $ilDB->fetchAssoc($set);
$this->setTitle($rec["title"]);
$this->setWikiId($rec["wiki_id"]);
$this->setBlocked($rec["blocked"]);
$this->setRating($rec["rating"]);
// get co page
if (!$a_omit_page_read)
{
}
}

+ Here is the call graph for this function:

ilWikiPage::rename (   $a_new_name)

Rename page.

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

References ilPageObject\_exists(), _getPageIdForWikiTitle(), ilInternalLink\_getSourcesOfTarget(), ilObjWiki\_lookupStartPage(), ilPageObject\getId(), getTitle(), getWikiId(), IL_WIKI_MODE_EXT_COLLECT, ilWikiUtil\makeDbTitle(), ilWikiUtil\processInternalLinks(), setTitle(), update(), and ilObjWiki\writeStartPage().

{
global $ilDB;
// replace unallowed characters
$a_new_name = str_replace(array("<", ">"), '', $a_new_name);
// replace multiple whitespace characters by one single space
$a_new_name = trim(preg_replace('!\s+!', ' ', $a_new_name));
$page_title = ilWikiUtil::makeDbTitle($a_new_name);
$pg_id = ilWikiPage::_getPageIdForWikiTitle($this->getWikiId(), $page_title);
$xml_new_name = str_replace("&", "&amp;", $a_new_name);
if ($pg_id == 0 || $pg_id == $this->getId())
{
include_once("./Services/COPage/classes/class.ilInternalLink.php");
$sources = ilInternalLink::_getSourcesOfTarget("wpg", $this->getId(), 0);
foreach ($sources as $s)
{
if ($s["type"] == "wpg:pg" && ilPageObject::_exists("wpg", $s["id"]))
{
$wpage = new ilWikiPage($s["id"]);
$col = ilWikiUtil::processInternalLinks($wpage->getXmlContent(), 0,
$new_content = $wpage->getXmlContent();
foreach ($col as $c)
{
// this complicated procedure is needed due to the fact
// that depending on the collation e = é is true
// in the (mysql) database
// see bug http://www.ilias.de/mantis/view.php?id=11227
$t1 = ilWikiUtil::makeDbTitle($c["nt"]->mTextform);
// this one replaces C2A0 (&nbsp;) by a usual space
// otherwise the comparision will fail, since you
// get these characters from tiny if more than one
// space is repeated in a string. This may not be
// 100% but we do not store $t1 anywhere and only
// modify it for the comparison
$t1 = preg_replace('/\xC2\xA0/', ' ', $t1);
$t2 = preg_replace('/\xC2\xA0/', ' ', $t2);
$set = $ilDB->query($q = "SELECT ".$ilDB->quote($t1, "text")." = ".$ilDB->quote($t2, "text")." isequal");
$rec = $ilDB->fetchAssoc($set);
if ($rec["isequal"])
{
$new_content =
str_replace("[[".$c["nt"]->mTextform."]]",
"[[".$xml_new_name."]]", $new_content);
if ($c["text"] != "")
{
$new_content =
str_replace("[[".$c["text"]."]]",
"[[".$xml_new_name."]]", $new_content);
}
$add = ($c["text"] != "")
? "|".$c["text"]
: "";
$new_content =
str_replace("[[".$c["nt"]->mTextform.$add."]]",
"[[".$xml_new_name.$add."]]", $new_content);
}
}
$wpage->setXmlContent($new_content);
//echo htmlentities($new_content);
$wpage->update();
}
}
include_once("./Modules/Wiki/classes/class.ilObjWiki.php");
if (ilObjWiki::_lookupStartPage($this->getWikiId()) == $this->getTitle())
{
ilObjWiki::writeStartPage($this->getWikiId(), $a_new_name);
}
$this->setTitle($a_new_name);
$this->update();
}
return $a_new_name;
}

+ Here is the call graph for this function:

ilWikiPage::saveInternalLinks (   $a_domdoc)

save internal links of page

Parameters
stringxml page code

Reimplemented from ilPageObject.

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

References ilPageObject\$xml, _getPageIdForWikiTitle(), ilInternalLink\_saveLink(), ilWikiUtil\collectInternalLinks(), ilPageObject\getId(), getTitle(), getWikiId(), and ilWikiUtil\makeDbTitle().

Referenced by create().

{
global $ilDB;
// *** STEP 1: Standard Processing ***
// *** STEP 2: Other Pages -> This Page ***
// Check, whether ANOTHER page links to this page as a "missing" page
// (this is the case, when this page is created newly)
$set = $ilDB->queryF("SELECT * FROM il_wiki_missing_page WHERE ".
" wiki_id = %s AND target_name = %s",
array("integer", "text"),
array($this->getWikiId(), ilWikiUtil::makeDbTitle($this->getTitle())));
while ($anmiss = $ilDB->fetchAssoc($set)) // insert internal links instead
{
//echo "adding link";
ilInternalLink::_saveLink("wpg:pg", $anmiss["source_id"], "wpg",
$this->getId(), 0);
}
//exit;
// now remove the missing page entries
$ilDB->manipulateF("DELETE FROM il_wiki_missing_page WHERE ".
" wiki_id = %s AND target_name = %s",
array("integer", "text"),
array($this->getWikiId(), $this->getTitle()));
// *** STEP 3: This Page -> Other Pages ***
// remove the exising "missing page" links for THIS page (they will be re-inserted below)
$ilDB->manipulateF("DELETE FROM il_wiki_missing_page WHERE ".
" wiki_id = %s AND source_id = %s",
array("integer", "integer"),
array($this->getWikiId(), $this->getId()));
// collect the wiki links of the page
include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
$xml = $a_domdoc->saveXML();
$int_wiki_links = ilWikiUtil::collectInternalLinks($xml, $this->getWikiId(), true);
foreach($int_wiki_links as $wlink)
{
$page_id = ilWikiPage::_getPageIdForWikiTitle($this->getWikiId(), $wlink);
if ($page_id > 0) // save internal link for existing page
{
ilInternalLink::_saveLink("wpg:pg", $this->getId(), "wpg",
$page_id, 0);
}
else // save missing link for non-existing page
{
$ilDB->manipulateF("DELETE FROM il_wiki_missing_page WHERE".
" wiki_id = %s AND source_id = %s AND target_name = %s",
array("integer", "integer", "text"),
array($this->getWikiId(), $this->getId(), $wlink));
$ilDB->manipulateF("INSERT INTO il_wiki_missing_page (wiki_id, source_id, target_name)".
" VALUES (%s,%s,%s)",
array("integer", "integer", "text"),
array($this->getWikiId(), $this->getId(), $wlink));
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWikiPage::setBlocked (   $a_val)

Set blocked.

Parameters
boolean$a_valblocked

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

Referenced by read().

{
$this->blocked = $a_val;
}

+ Here is the caller graph for this function:

ilWikiPage::setRating (   $a_val)

Set rating.

Parameters
boolean$a_val

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

Referenced by read().

{
$this->rating = (bool)$a_val;
}

+ Here is the caller graph for this function:

ilWikiPage::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle

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

References ilWikiUtil\makeDbTitle().

Referenced by read(), and rename().

{
$this->title = ilWikiUtil::makeDbTitle($a_title);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWikiPage::setWikiId (   $a_wikiid)

Set Wiki Object Id.

Parameters
int$a_wikiidWiki Object Id

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

References ilPageObject\setParentId().

Referenced by read().

{
$this->setParentId($a_wikiid);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWikiPage::setWikiRefId (   $a_wiki_ref_id)

Set Wiki Ref Id.

Parameters
int$a_wiki_ref_idWiki Ref Id

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

{
$this->parent_ref_id = $a_wiki_ref_id;
}
ilWikiPage::update (   $a_validate = true,
  $a_no_history = false 
)

update object data

public

Returns
boolean

Reimplemented from ilPageObject.

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

References $query, getBlocked(), ilPageObject\getId(), getRating(), getTitle(), getWikiId(), getWikiRefId(), ilWikiUtil\sendNotification(), ilNotification\TYPE_WIKI_PAGE, and updateNews().

Referenced by rename().

{
global $ilDB;
// update wiki page data
$query = "UPDATE il_wiki_page SET ".
" title = ".$ilDB->quote($this->getTitle(), "text").
",wiki_id = ".$ilDB->quote((int) $this->getWikiId(), "integer").
",blocked = ".$ilDB->quote((int) $this->getBlocked(), "integer").
",rating = ".$ilDB->quote((int) $this->getRating(), "integer").
" WHERE id = ".$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($query);
$updated = parent::update($a_validate, $a_no_history);
if ($updated === true)
{
include_once "./Services/Notification/classes/class.ilNotification.php";
$this->updateNews(true);
}
else
{
return $updated;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWikiPage::updateNews (   $a_update = false)

Create.

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

References $ilUser, ilPageObject\getId(), ilNewsItem\getLastNewsIdForContext(), getTitle(), getWikiId(), and NEWS_NOTICE.

Referenced by create(), and update().

{
global $ilUser;
$news_set = new ilSetting("news");
$default_visibility = ($news_set->get("default_visibility") != "")
? $news_set->get("default_visibility")
: "users";
include_once("./Services/News/classes/class.ilNewsItem.php");
if (!$a_update)
{
$news_item = new ilNewsItem();
$news_item->setContext(
$this->getWikiId(), "wiki",
$this->getId(), "wpg");
$news_item->setPriority(NEWS_NOTICE);
$news_item->setTitle($this->getTitle());
$news_item->setContentTextIsLangVar(true);
$news_item->setContent("wiki_news_page_created");
$news_item->setUserId($ilUser->getId());
$news_item->setVisibility($default_visibility);
$news_item->create();
}
else
{
// get last news item of the day (if existing)
$this->getWikiId(), "wiki",
$this->getId(), "wpg", true);
if ($news_id > 0)
{
$news_item = new ilNewsItem($news_id);
$news_item->setContent("wiki_news_page_changed");
$news_item->setUserId($ilUser->getId());
$news_item->setTitle($this->getTitle());
$news_item->setContentTextIsLangVar(true);
$news_item->update(true);
}
else
{
$news_item = new ilNewsItem();
$news_item->setContext(
$this->getWikiId(), "wiki",
$this->getId(), "wpg");
$news_item->setPriority(NEWS_NOTICE);
$news_item->setTitle($this->getTitle());
$news_item->setContentTextIsLangVar(true);
$news_item->setContent("wiki_news_page_changed");
$news_item->setUserId($ilUser->getId());
$news_item->setVisibility($default_visibility);
$news_item->create();
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilWikiPage::$blocked = false
protected

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

Referenced by getBlocked().


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