Revision [994]

This is an old revision of IncludeAction made by DreckFehler on 2004-08-14 23:36:51.

 

the following action includes another wikipage and takes care not to be trapped in a circular reference, i.e. included pages can include other pages without running into trouble.

actions/include.php

<?php
if (!$page) $page = $mind_vars;
$page = strtolower($page);
if (!$this->config["includes"]) $this->config["includes"][] = strtolower($this->tag);

if (!in_array($page, $this->config["includes"]) && $page != $this->tag) {
    if ($this->HasAccess("read", $page)) {
        $this->config["includes"][] = $page;
        $page = $this->LoadPage($page);

        print $this->Format($page["body"]);
    }
} else print "<span class='error'>Circular reference detected</span>";
?>
There are 10 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki