Skip to content
Snippets Groups Projects
Commit 3837d5a9 authored by Olav Morken's avatar Olav Morken
Browse files

Added modinfo module, which lists installed modules.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@824 44740490-163a-0410-bde0-09ae8108e29a
parent aabe3a10
No related branches found
No related tags found
No related merge requests found
This file indicates that the default state of this module
is enabled. To disable, create a file named disable in the
same directory as this file.
<?php
$lang = array(
'modlist_header' => array (
'en' => 'Available modules',
),
'modlist_name' => array (
'en' => 'Name',
),
'modlist_status' => array (
'en' => 'Status',
),
'modlist_enabled' => array (
'en' => 'Enabled',
),
'modlist_disabled' => array (
'en' => 'Disabled',
),
);
?>
\ No newline at end of file
<?php
/**
* Hook to add the modinfo module to the frontpage.
*
* @param array &$links The links on the frontpage, split into sections.
*/
function modinfo_hook_frontpage(&$links) {
assert('is_array($links)');
assert('array_key_exists("links", $links)');
$links['links'][] = array(
'href' => SimpleSAML_Module::getModuleURL('modinfo/'),
'text' => '{modinfo:dict:modlist_header}',
);
}
?>
\ No newline at end of file
<?php
$this->data['header'] = $this->t('{modinfo:dict:modlist_header}');
$this->includeAtTemplateBase('includes/header.php');
#$icon_enabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/accept.png" alt="' .
#htmlspecialchars($this->t(...)" />';
#$icon_disabled = '<img src="/' . $this->data['baseurlpath'] . 'resources/icons/delete.png" alt="disabled" />';
?>
<div id="content">
<h2><?php echo($this->data['header']); ?></h2>
<table>
<tr>
<th><?php echo($this->t('{modinfo:dict:modlist_name}')); ?></th>
<th><?php echo($this->t('{modinfo:dict:modlist_status}')); ?></th>
</tr>
<?php
foreach($this->data['modules'] as $id => $info) {
echo('<tr>');
echo('<td>' . htmlspecialchars($id) . '</td>');
if($info['enabled']) {
echo('<td><img src="/' . $this->data['baseurlpath'] . 'resources/icons/accept.png" alt="' .
htmlspecialchars($this->t('{modinfo:dict:modlist_enabled}')) . '" /></td>');
} else {
echo('<td><img src="/' . $this->data['baseurlpath'] . 'resources/icons/delete.png" alt="' .
htmlspecialchars($this->t('{modinfo:dict:modlist_disabled}')) . '" /></td>');
}
echo('</tr>');
}
?>
</table>
<?php $this->includeAtTemplateBase('includes/footer.php'); ?>
\ No newline at end of file
<?php
$modules = SimpleSAML_Module::getModules();
sort($modules);
$modinfo = array();
foreach($modules as $m) {
$modinfo[$m] = array(
'enabled' => SimpleSAML_Module::isModuleEnabled($m),
);
}
$config = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($config, 'modinfo:modlist.php');
$t->data['modules'] = $modinfo;
$t->show();
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment