ILIAS  Release_3_10_x_branch Revision 61812
 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

 __construct ($a_id=0, $a_old_nr=0)
 Constructor public.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setWikiId ($a_wikiid)
 Set Wiki Object Id.
 getWikiId ()
 Get Wiki Object Id.
 create ()
 Create new wiki page.
 update ($a_validate=true, $a_no_history=false)
 update object data
 read ()
 Read wiki data.
 delete ()
 delete wiki page and al related data
 saveInternalLinks ($a_xml)
 save internal links of page
- Public Member Functions inherited from ilPageObject
 ilPageObject ($a_parent_type, $a_id=0, $a_old_nr=0, $a_halt=true)
 Constructor public.
 haltOnError ($a_halt)
 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.
 _exists ($a_parent_type, $a_id)
 checks whether page exists
 buildDom ($a_force=false)
 freeDom ()
getDom ()
 setId ($a_id)
 set id
 getId ()
 setParentId ($a_id)
 getParentId ()
 setParentType ($a_type)
 getParentType ()
 addUpdateListener (&$a_object, $a_method, $a_parameters="")
 callUpdateListeners ()
getContentObject ($a_hier_id, $a_pc_id="")
getContentNode ($a_hier_id, $a_pc_id="")
 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
 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="")
 getBibliographyXML ()
 get a xml string that contains all Bibliography elements, that are referenced by any bibitem alias in the page
 collectMediaObjects ($a_inline_only=true)
 get all media objects, that are referenced and used within the page
 getInternalLinks ()
 get all internal links that are used within the page
 collectFileItems ($a_xml="")
 get all file items 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
 addFileSizes ()
 add file sizes
 resolveIntLinks ()
 Resolves all internal link targets of the page, if targets are available (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)
 createFromXML ()
 create new page object with current xml content
 updateFromXML ()
 updates page object with current xml content
 saveMobUsage ($a_xml, $a_old_nr=0)
 save all usages of media objects (media aliases, media objects, internal links)
 saveFileUsage ($a_xml="", $a_old_nr=0)
 save file usages
 getLastUpdateOfIncludedElements ()
 Get last update of included elements (media objects and files).
 deleteContent ($a_hid, $a_update=true, $a_pcid="")
 delete content object with hierarchical id $a_hid
 deleteContents ($a_hids, $a_update=true)
 delete multiple content objects
 switchEnableMultiple ($a_hids, $a_update=true)
 gui function set enabled if is not enabled and vice versa
 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
 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.
 insertPCIds ()
 Insert Page Content IDs.
 getPageContentsHashes ()
 Get page contents hashes.
 send_paragraph ($par_id, $filename)
 getFO ()
 get fo page content
 registerOfflineHandler ($handler)
 _lookupContainsDeactivatedElements ($a_id, $a_parent_type)
 lookup whether page 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.

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 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 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 Public Member Functions inherited from ilPageObject
static _handleImportRepositoryLinks ($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 Change targest of repository links.
static getRecentChanges ($a_parent_type, $a_parent_id, $a_period=30)
 Get recent pages changes for parent object.
static getAllPages ($a_parent_type, $a_parent_id)
 Get all pages for parent object.
static getNewPages ($a_parent_type, $a_parent_id)
 Get new pages.
static getParentObjectContributors ($a_parent_type, $a_parent_id)
 Get all contributors for parent object.
static getPageContributors ($a_parent_type, $a_page_id)
 Get all contributors for parent object.
static getPagesWithLinks ($a_parent_type, $a_parent_id)
 Get all pages for parent object that contain internal links.

Additional Inherited Members

- Data Fields inherited from ilPageObject
 $id
 $ilias
 $dom
 $xml
 $encoding
 $node
 $cur_dtd = "ilias_pg_3_10.dtd"
 $contains_int_link
 $needs_parsing
 $parent_type
 $parent_id
 $update_listeners
 $update_listener_cnt
 $offline_handler
 $dom_builded
 $history_saved

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 34 of file class.ilWikiPage.php.

Constructor & Destructor Documentation

ilWikiPage::__construct (   $a_id = 0,
  $a_old_nr = 0 
)

Constructor public.

Parameters
wikipage id

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

{
parent::__construct("wpg", $a_id, $a_old_nr);
}

Member Function Documentation

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

Checks whether a page with given title exists.

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

References DB_FETCHMODE_ASSOC.

Referenced by saveInternalLinks().

{
global $ilDB;
$query = "SELECT * FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id).
" AND title = ".$ilDB->quote($a_title);
$set = $ilDB->query($query);
if($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
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 386 of file class.ilWikiPage.php.

References DB_FETCHMODE_ASSOC, and ilWikiUtil\makeDbTitle().

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

{
global $ilDB;
$a_title = ilWikiUtil::makeDbTitle($a_title);
// delete record of table il_wiki_data
$query = "SELECT * FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id).
" AND title = ".$ilDB->quote($a_title);
$set = $ilDB->query($query);
$pages = array();
if ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilWikiPage::countPages (   $a_wiki_id)
static

Count pages of wiki.

Parameters
int$a_wiki_idWiki ID

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

References DB_FETCHMODE_ASSOC.

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);
$s = $ilDB->query($query);
$r = $s->fetchRow(DB_FETCHMODE_ASSOC);
return $r["cnt"];
}

+ Here is the caller graph for this function:

ilWikiPage::create ( )

Create new wiki page.

Reimplemented from ilPageObject.

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

References ilPageObject\$id, getTitle(), getWikiId(), ilPageObject\getXMLContent(), saveInternalLinks(), and ilPageObject\setId().

{
global $ilDB;
$query = "INSERT INTO il_wiki_page (".
"title".
", wiki_id".
" ) VALUES (".
$ilDB->quote($this->getTitle())
.",".$ilDB->quote($this->getWikiId())
.")";
$ilDB->query($query);
$id = $ilDB->getLastInsertId();
$this->setId($id);
// create page object
$this->saveInternalLinks($this->getXMLContent());
}

+ Here is the call graph for this function:

ilWikiPage::delete ( )

delete wiki page and al related data

public

Reimplemented from ilPageObject.

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

References ilInternalLink\_deleteAllLinksToTarget(), ilPageObject\getId(), getLinksToPage(), getTitle(), and getWikiId().

{
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");
// delete comments and notes of this page
// (we keep them first)
// delete record of table il_wiki_data
$query = "DELETE FROM il_wiki_page".
" WHERE id = ".$ilDB->quote($this->getId());
$ilDB->query($query);
// delete co page
// make links of other pages to this page a missing link
foreach($linking_pages as $lp)
{
$st = $ilDB->prepareManip("REPLACE INTO il_wiki_missing_page ".
"(wiki_id, source_id, target_name) VALUES ".
"(?,?,?)", array("integer", "integer", "text"));
$ilDB->execute($st, 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 199 of file class.ilWikiPage.php.

References DB_FETCHMODE_ASSOC.

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);
$set = $ilDB->query($query);
while($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
$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 218 of file class.ilWikiPage.php.

References DB_FETCHMODE_ASSOC, and ilWikiUtil\makeDbTitle().

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

{
global $ilDB;
$a_title = ilWikiUtil::makeDbTitle($a_title);
$query = "SELECT * FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id).
" AND title = ".$ilDB->quote($a_title);
$set = $ilDB->query($query);
if($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
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 280 of file class.ilWikiPage.php.

References DB_FETCHMODE_ASSOC.

Referenced by getOrphanedPages(), and ilWikiPagesTableGUI\getPages().

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

+ 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 305 of file class.ilWikiPage.php.

References ilInternalLink\_getSourcesOfTarget(), DB_FETCHMODE_ASSOC, and ilUtil\quoteArray().

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 wp.id IN (".implode(",",ilUtil::quoteArray($ids)).")".
" AND wp.id = p.page_id AND p.parent_type = 'wpg'".
" AND wp.wiki_id = ".$ilDB->quote($a_wiki_id).
" ORDER BY title";
$set = $ilDB->query($query);
$pages = array();
while ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
$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 594 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:

static ilWikiPage::getOrphanedPages (   $a_wiki_id)
static

Get orphaned pages of wiki.

public

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

References ilInternalLink\_getSourcesOfTarget(), ilObjWiki\_lookupStartPage(), DB_FETCHMODE_ASSOC, getAllPages(), and ilUtil\quoteArray().

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"];
}
}
// delete record of table il_wiki_data
$query = "SELECT count(*) AS cnt FROM il_wiki_page".
" WHERE id IN (".implode(",",ilUtil::quoteArray($ids)).")".
" AND wiki_id = ".$ilDB->quote($a_wiki_id).
" ORDER BY title";
$set = $ilDB->query($query);
$rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
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 426 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 239 of file class.ilWikiPage.php.

References DB_FETCHMODE_ASSOC, and ilWikiUtil\makeDbTitle().

Referenced by ilObjWikiGUI\addPagesSubTabs(), ilObjWikiGUI\addPageTabs(), 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).
" AND title = ".$ilDB->quote($a_title);
$set = $ilDB->query($query);
if($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
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 412 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:

static ilWikiPage::getPopularPages (   $a_wiki_id)
static

Get popular pages of wiki.

public

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

References DB_FETCHMODE_ASSOC.

Referenced by ilWikiPagesTableGUI\getPages().

{
global $ilDB;
$query = "SELECT wp.*, po.view_cnt as cnt FROM il_wiki_page as wp, page_object as po".
" WHERE wp.wiki_id = ".$ilDB->quote($a_wiki_id).
" AND wp.id = po.page_id ".
" AND po.parent_type = 'wpg' ".
" ORDER BY po.view_cnt";
$set = $ilDB->query($query);
$pages = array();
while($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
$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 566 of file class.ilWikiPage.php.

References countPages(), and DB_FETCHMODE_ASSOC.

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
$query = "SELECT title FROM il_wiki_page".
" WHERE wiki_id = ".$ilDB->quote($a_wiki_id).
" LIMIT $rand, 1";
$s = $ilDB->query($query);
$r = $s->fetchRow(DB_FETCHMODE_ASSOC);
return $r["title"];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWikiPage::getTitle ( )

Get Title.

Returns
string Title

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

References $title.

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

{
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 81 of file class.ilWikiPage.php.

References ilPageObject\getParentId().

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

{
return $this->getParentId();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilWikiPage::lookupTitle (   $a_page_id)
static

Checks whether a page with given title exists.

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

References DB_FETCHMODE_ASSOC.

Referenced by ilSearchResultPresentationGUI\__appendChildLinks(), ilWikiSearchResultsTableGUI\fillRow(), ilWikiRecentChangesTableGUI\fillRow(), ilWikiContributorsTableGUI\fillRow(), ilMediaObjectUsagesTableGUI\fillRow(), getNewPages(), and ilWikiPagesTableGUI\ilWikiPagesTableGUI().

{
global $ilDB;
$query = "SELECT * FROM il_wiki_page".
" WHERE id = ".$ilDB->quote($a_page_id);
$set = $ilDB->query($query);
if($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
return $rec["title"];
}
return false;
}

+ Here is the caller graph for this function:

ilWikiPage::read ( )

Read wiki data.

Reimplemented from ilPageObject.

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

References DB_FETCHMODE_ASSOC, ilPageObject\getId(), setTitle(), and setWikiId().

{
global $ilDB;
$query = "SELECT * FROM il_wiki_page WHERE id = ".
$ilDB->quote($this->getId());
$set = $ilDB->query($query);
$rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
$this->setTitle($rec["title"]);
$this->setWikiId($rec["wiki_id"]);
// get co page
}

+ Here is the call graph for this function:

ilWikiPage::saveInternalLinks (   $a_xml)

save internal links of page

Parameters
stringxml page code

Reimplemented from ilPageObject.

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

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

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)
$stmt = $ilDB->prepare("SELECT * FROM il_wiki_missing_page WHERE ".
" wiki_id = ? AND target_name = ?", array("integer", "text"));
$set = $ilDB->execute($stmt, array($this->getWikiId(), $this->getTitle()));
while ($anmiss = $ilDB->fetchAssoc($set)) // insert internal links instead
{
ilInternalLink::_saveLink("wpg:pg", $anmiss["source_id"], "wpg",
$this->getId(), 0);
}
// now remove the missing page entries
$stmt = $ilDB->prepareManip("DELETE FROM il_wiki_missing_page WHERE ".
" wiki_id = ? AND target_name = ?", array("integer", "text"));
$ilDB->execute($stmt, 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)
$stmt = $ilDB->prepareManip("DELETE FROM il_wiki_missing_page WHERE ".
" wiki_id = ? AND source_id = ?", array("integer", "integer"));
$ilDB->execute($stmt, array($this->getWikiId(), $this->getId()));
// collect the wiki links of the page
include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
$int_wiki_links = ilWikiUtil::collectInternalLinks($a_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
{
$stmt = $ilDB->prepareManip("REPLACE INTO il_wiki_missing_page (wiki_id, source_id, target_name)".
" VALUES (?,?,?)", array("integer", "integer", "text"));
$ilDB->execute($stmt, array($this->getWikiId(), $this->getId(), $wlink));
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilWikiPage::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle

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

References ilWikiUtil\makeDbTitle().

Referenced by read().

{
$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 71 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::update (   $a_validate = true,
  $a_no_history = false 
)

update object data

public

Returns
boolean

Reimplemented from ilPageObject.

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

References ilPageObject\getId(), getTitle(), and getWikiId().

{
global $ilDB;
// update wiki page data
$query = "UPDATE il_wiki_page SET ".
" title = ".$ilDB->quote($this->getTitle()).
",wiki_id = ".$ilDB->quote($this->getWikiId()).
" WHERE id = ".$ilDB->quote($this->getId());
$ilDB->query($query);
parent::update($a_validate, $a_no_history);
return true;
}

+ Here is the call graph for this function:


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