ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
sspmod_portal_Portal Class Reference
+ Collaboration diagram for sspmod_portal_Portal:

Public Member Functions

 __construct ($pages, $config=null)
 
 getTabset ($thispage)
 
 isPortalized ($thispage)
 
 getLoginInfo ($translator, $thispage)
 
 getMenu ($thispage)
 

Private Attributes

 $pages
 
 $config
 

Detailed Description

Definition at line 3 of file Portal.php.

Constructor & Destructor Documentation

◆ __construct()

sspmod_portal_Portal::__construct (   $pages,
  $config = null 
)

Definition at line 8 of file Portal.php.

References $config, and $pages.

9  {
10  $this->pages = $pages;
11  $this->config = $config;
12  }

Member Function Documentation

◆ getLoginInfo()

sspmod_portal_Portal::getLoginInfo (   $translator,
  $thispage 
)

Definition at line 37 of file Portal.php.

References $info, $translator, and SimpleSAML\Module\callHooks().

Referenced by getMenu().

38  {
39  $info = array('info' => '', 'translator' => $translator, 'thispage' => $thispage);
40  SimpleSAML\Module::callHooks('portalLoginInfo', $info);
41  return $info['info'];
42  }
static callHooks($hook, &$data=null)
Call a hook in all enabled modules.
Definition: Module.php:281
$translator
Definition: getconsent.php:119
$info
Definition: index.php:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMenu()

sspmod_portal_Portal::getMenu (   $thispage)

Definition at line 44 of file Portal.php.

References $config, $name, $t, $text, SimpleSAML_Configuration\getInstance(), getLoginInfo(), and getTabset().

45  {
48  $tabset = $this->getTabset($thispage);
49  $logininfo = $this->getLoginInfo($t, $thispage);
50  $text = '';
51  $text .= '<ul class="tabset_tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">';
52  foreach ($this->pages as $pageid => $page) {
53  if (isset($tabset) && !in_array($pageid, $tabset, true)) {
54  continue;
55  }
56  $name = 'uknown';
57  if (isset($page['text'])) {
58  $name = $page['text'];
59  }
60  if (isset($page['shorttext'])) {
61  $name = $page['shorttext'];
62  }
63  if (!isset($page['href'])) {
64  $text .= '<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#">' . $t->t($name) . '</a></li>';
65  } else if($pageid === $thispage ) {
66  $text .= '<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#">' . $t->t($name) . '</a></li>';
67  } else {
68  $text .= '<li class="ui-state-default ui-corner-top"><a href="' . $page['href'] . '">' . $t->t($name) . '</a></li>';
69  }
70 
71  }
72  $text .= '</ul>';
73  if (!empty($logininfo)) {
74  $text .= '<p class="logininfo" style="text-align: right; margin: 0px">' . $logininfo . '</p>';
75  }
76 
77  return $text;
78  }
getTabset($thispage)
Definition: Portal.php:14
$text
Definition: errorreport.php:18
getLoginInfo($translator, $thispage)
Definition: Portal.php:37
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
+ Here is the call graph for this function:

◆ getTabset()

sspmod_portal_Portal::getTabset (   $thispage)

Definition at line 14 of file Portal.php.

Referenced by getMenu().

15  {
16  if (!isset($this->config)) {
17  return null;
18  }
19  foreach($this->config as $set) {
20  if (in_array($thispage, $set, true)) {
21  return $set;
22  }
23  }
24  return null;
25  }
+ Here is the caller graph for this function:

◆ isPortalized()

sspmod_portal_Portal::isPortalized (   $thispage)

Definition at line 27 of file Portal.php.

28  {
29  foreach($this->config as $set) {
30  if (in_array($thispage, $set, true)) {
31  return true;
32  }
33  }
34  return false;
35  }

Field Documentation

◆ $config

sspmod_portal_Portal::$config
private

Definition at line 6 of file Portal.php.

Referenced by __construct(), and getMenu().

◆ $pages

sspmod_portal_Portal::$pages
private

Definition at line 5 of file Portal.php.

Referenced by __construct().


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