Clean up duplicate code on login and sitemap.
+ function index()
+ {
+ $this->handler;
+ if (empty($this->handler)) {
+ return;
+ }
+ $User = NULL;
+ $Page = $this;
+ $res = include "./{$this->handler}/index.php";
+ return $res;
+ }
+
function restricted()
{
$this->handler;
function restricted()
{
$this->handler;
if (empty($message)) http_response_code(403);
$target = ltrim($_REQUEST['goto'], '/');
$target = new ArchiveArticle("$target.html");
if (empty($message)) http_response_code(403);
$target = ltrim($_REQUEST['goto'], '/');
$target = new ArchiveArticle("$target.html");
-
- if ($target and $target->handler) {
- # run forbidden handler to determine metadata
- $User = NULL;
- $caller = $Page;
- $Page = $target;
- ob_start();
- include "./{$target->handler}/index.php";
- ob_end_clean();
- $Page = $caller;
- }
+ $target->index; # run forbidden handler to determine metadata
if ($target->title) {
$Page->title .= ' voor ' . $target->title;
if ($target->title) {
$Page->title .= ' voor ' . $target->title;
<?php
$article = new ArchiveArticle($Page->place[0]);
<?php
$article = new ArchiveArticle($Page->place[0]);
- if ($article->handler) {
- $Page = $article;
- $User = NULL;
- ob_start();
- include "./{$article->handler}/index.php";
- ob_end_clean();
- $article = $Page;
- }
+ $article->index; # apply handler metadata
printf('<a href="%s">%s</a>', $article->link, $article->name);
if ($article->image) {
printf("\n\t".'<img class="right" src="/%s" />', $article->thumb('100x100'));
printf('<a href="%s">%s</a>', $article->link, $article->name);
if ($article->image) {
printf("\n\t".'<img class="right" src="/%s" />', $article->thumb('100x100'));