diff --git a/modules/aggregator2/templates/list.php b/modules/aggregator2/templates/list.php new file mode 100644 index 0000000000000000000000000000000000000000..fbe350c212bb2c0e39e1547125b3034e953b7e7f --- /dev/null +++ b/modules/aggregator2/templates/list.php @@ -0,0 +1,33 @@ +<?php +$this->includeAtTemplateBase('includes/header.php'); +?> + <h1><?php echo $this->t('{aggregator2:aggregator:header}'); ?></h1> + +<?php +if (count($this->data['sources']) === 0) { + echo " <p>".$this->t('{aggregator2:aggregator:no_aggregators}')."</p>\n"; +} else { + echo " <ul>"; + + foreach ($this->data['sources'] as $id => $source) { + $encId = urlencode($id); + $params = array( + 'id' => $encId, + ); + echo str_repeat(' ', 8)."<li>\n"; + echo str_repeat(' ', 12).'<a href="'; + echo SimpleSAML_Module::getModuleURL('aggregator2/get.php', $params).'">'.htmlspecialchars($id)."</a>\n"; + echo str_repeat(' ', 12).'<a href="'; + $params['mimetype'] = 'text/plain'; + echo SimpleSAML_Module::getModuleURL('aggregator2/get.php', $params).'">['. + $this->t('{aggregator2:aggregator:text}')."]</a>\n"; + echo str_repeat(' ', 12).'<a href="'; + $params['mimetype'] = 'application/xml'; + echo SimpleSAML_Module::getModuleURL('aggregator2/get.php', $params)."\">[XML]</a>\n"; + echo str_repeat(' ', 8)."</li>\n"; + } + + echo " </ul>\n"; +} + +$this->includeAtTemplateBase('includes/footer.php'); diff --git a/modules/aggregator2/www/index.php b/modules/aggregator2/www/index.php new file mode 100644 index 0000000000000000000000000000000000000000..17764c58e863db47c43af32e4a31b38d5959d604 --- /dev/null +++ b/modules/aggregator2/www/index.php @@ -0,0 +1,11 @@ +<?php + +$ssp_cf = SimpleSAML_Configuration::getInstance(); +$mod_cf = SimpleSAML_Configuration::getConfig('module_aggregator2.php'); + +// get list of sources +$sources = $mod_cf->toArray(); + +$t = new SimpleSAML_XHTML_Template($ssp_cf, 'aggregator2:list.php'); +$t->data['sources'] = $sources; +$t->show();