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

Aggregator: Add list of available aggregators, and add link on frontpage.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@886 44740490-163a-0410-bde0-09ae8108e29a
parent ca587754
No related branches found
No related tags found
No related merge requests found
<?php
$lang = array(
'frontpage_link' => array (
'en' => 'Metadata aggregator',
),
'aggregator_header' => array (
'en' => 'Aggregators',
),
'no_aggregators' => array (
'en' => 'No aggregators defined in configuration.',
),
'text' => array (
'en' => 'text',
),
);
?>
\ No newline at end of file
<?php
/**
* Hook to add the aggregator list to the frontpage.
*
* @param array &$links The links on the frontpage, split into sections.
*/
function aggregator_hook_frontpage(&$links) {
assert('is_array($links)');
assert('array_key_exists("links", $links)');
$links['links'][] = array(
'href' => SimpleSAML_Module::getModuleURL('aggregator/'),
'text' => '{aggregator:dict:frontpage_link}',
);
}
?>
\ No newline at end of file
<?php
$this->data['header'] = $this->t('{aggregator:dict:aggregator_header}');
$this->includeAtTemplateBase('includes/header.php');
echo('<div id="content">');
echo('<h1>'. $this->data['header'] . '</h1>');
if (count($this->data['sources']) === 0) {
echo('<p>' . $this->t('{aggregator:dict:no_aggregators}') . '</p>');
} else {
echo('<ul>');
foreach ($this->data['sources'] as $source) {
$encId = urlencode($source);
$encName = htmlspecialchars($source);
echo('<li>');
echo('<a href="?id=' . $encId . '">' . $encName . '</a>');
echo(' <a href="?id=' . $encId . '&amp;mimetype=text/plain">[' . $this->t('{aggregator:dict:text}') . ']</a>');
echo('</li>');
}
echo('</ul>');
}
$this->includeAtTemplateBase('includes/footer.php');
?>
\ No newline at end of file
...@@ -14,8 +14,9 @@ $aggregatorConfig = $globalConfig->copyFromBase('aggregator', 'aggregator.php'); ...@@ -14,8 +14,9 @@ $aggregatorConfig = $globalConfig->copyFromBase('aggregator', 'aggregator.php');
$aggregators = $aggregatorConfig->getArray('aggragators'); $aggregators = $aggregatorConfig->getArray('aggragators');
if (!array_key_exists('id', $_GET)) { if (!array_key_exists('id', $_GET)) {
/* TODO: Show list. */ $t = new SimpleSAML_XHTML_Template($globalConfig, 'aggregator:list.php');
echo('TODO: Show list'); $t->data['sources'] = array_keys($aggregators);
$t->show();
exit; exit;
} }
......
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