return;
}
- function index()
+ function index($api = TRUE)
{
$this->handler;
if (empty($this->handler)) {
return;
}
- $this->api = TRUE;
+ $this->api = $api;
$Page = $this;
- $res = include "./{$this->handler}/index.php";
- return $res;
+ global $User;
+ return require "./{$this->handler}/index.php";
}
function restricted()
# keep either login or logout parts depending on user level
global $User;
$userexists = $User && property_exists($User, 'login') && $User->login;
- if (! ($userexists and $User->admin("edit {$this->link}")) ) {
+ if (! ($userexists and !empty($this->editable)) ) {
# remove matching elements until first corresponding closing tag
$hideclass = $userexists ? 'logout' : 'login';
$tagmatch = '<([a-z]+) class="'.$hideclass.'"[^>]*>';