ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Wiki\Content\NavigationManager Class Reference
+ Collaboration diagram for ILIAS\Wiki\Content\NavigationManager:

Public Member Functions

 __construct (PageManager $pm, \ilObjWiki $wiki, int $wpg_id=0, string $page_title="", string $lang="-")
 
 getCurrentPageId ()
 
 getCurrentPageLanguage ()
 

Protected Member Functions

 init ()
 

Protected Attributes

PageManager $pm
 
string $lang
 
string $page_title
 
int $wpg_id
 
ilObjWiki $wiki
 
bool $initialised = false
 

Detailed Description

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

Definition at line 31 of file NavigationManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Wiki\Content\NavigationManager::__construct ( PageManager  $pm,
\ilObjWiki  $wiki,
int  $wpg_id = 0,
string  $page_title = "",
string  $lang = "-" 
)

Member Function Documentation

◆ getCurrentPageId()

ILIAS\Wiki\Content\NavigationManager::getCurrentPageId ( )

Definition at line 85 of file NavigationManager.php.

85 : int
86 {
87 $this->init();
88 return $this->wpg_id;
89 }

References ILIAS\Wiki\Content\NavigationManager\$wpg_id, and ILIAS\Wiki\Content\NavigationManager\init().

+ Here is the call graph for this function:

◆ getCurrentPageLanguage()

ILIAS\Wiki\Content\NavigationManager::getCurrentPageLanguage ( )

Definition at line 91 of file NavigationManager.php.

91 : string
92 {
93 $this->init();
94 return $this->lang;
95 }

References ILIAS\Wiki\Content\NavigationManager\$lang, and ILIAS\Wiki\Content\NavigationManager\init().

+ Here is the call graph for this function:

◆ init()

ILIAS\Wiki\Content\NavigationManager::init ( )
protected

Definition at line 56 of file NavigationManager.php.

56 : void
57 {
58 if (!$this->initialised) {
59
60 // if nothing given, use start page
61 if ($this->wpg_id === 0 && $this->page_title === "") {
62 $this->page_title = $this->wiki->getStartPage();
63 }
64
65 // if no page id given, get page id from requested page title
66 if ($this->wpg_id === 0 && $this->page_title !== "") {
67 $this->wpg_id = (int) $this->pm->getPageIdForTitle($this->page_title, $this->lang);
68 }
69
70 // check if page exists and belongs to wiki
71 if ($this->wpg_id > 0) {
72 if (!$this->pm->exists($this->wpg_id, $this->lang)) {
73 throw new \ilWikiException("Wiki page does not exist (" .
74 $this->wpg_id . "," . $this->lang . ")");
75 }
76 if (!$this->pm->belongsToWiki($this->wpg_id)) {
77 throw new \ilWikiException("Wiki page does not belong to wiki (" .
78 $this->wpg_id . "," . $this->wiki->getId() . ")");
79 }
80 }
81 $this->initialised = true;
82 }
83 }

References ILIAS\Repository\int().

Referenced by ILIAS\Wiki\Content\NavigationManager\getCurrentPageId(), and ILIAS\Wiki\Content\NavigationManager\getCurrentPageLanguage().

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

Field Documentation

◆ $initialised

bool ILIAS\Wiki\Content\NavigationManager::$initialised = false
protected

Definition at line 38 of file NavigationManager.php.

◆ $lang

string ILIAS\Wiki\Content\NavigationManager::$lang
protected

◆ $page_title

string ILIAS\Wiki\Content\NavigationManager::$page_title
protected

◆ $pm

PageManager ILIAS\Wiki\Content\NavigationManager::$pm
protected

◆ $wiki

ilObjWiki ILIAS\Wiki\Content\NavigationManager::$wiki
protected

◆ $wpg_id

int ILIAS\Wiki\Content\NavigationManager::$wpg_id
protected

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