User Menu
Keywords
|
Plugins > AdminAdmin Pages are essentially the same thing as Special Pages, the difference being access is restricted to the administrator. It should be noted that admin pages reside in the "Admin" space instead of the "Special" space and as such any links should reflect this. So instead of $page->regLink('Hello World' ,'/Special/'.$pageOwner['username'].'/'.$wbPluginSpace.'/Hello'); echo wbLinks::special($wbPluginSpace.'/Hello','Hello World');we need $page->regLink('Hello World' ,'/Admin/'.$pageOwner['username'].'/'.$wbPluginSpace.'/Hello'); echo wbLinks::admin($wbPluginSpace.'/Hello','Hello World'); Admin Multiple Tabs (2.1)Using our multiple tabs example in our introduction, we take these changes and turn it into an admin page, remembering to also change out link definitions in links.php. links.php<?php $adminLinks['Hello']['script'] = 'hello.php'; $adminLinks['Hello']['header'] = 'Hello Special'; $adminLinks['Hello']['label'] = '1.3 Hello'; $adminLinks['Hello2']['script'] = 'hello.php'; $adminLinks['Hello2']['header'] = 'Hello Special'; $adminLinks['Hello2']['label'] = '1.3 Hello2'; hello.php<?php global $page,$pageOwner,$wbPluginSpace; // First Hello $contentUri = $page->regLink('Hello World' ,'/Admin/'.$pageOwner['username'].'/'.$wbPluginSpace.'/Hello'); ob_start(); echo 'Hello World'; echo ' - '; echo wbLinks::admin($wbPluginSpace.'/Hello2','Hello World2'); $page->contentB[$contentUri] = wb::get_clean(); // Second Hello $contentUri = $page->regLink('Hello World2' ,'/Admin/'.$pageOwner['username'].'/'.$wbPluginSpace.'/Hello2'); ob_start(); echo wbLinks::admin($wbPluginSpace.'/Hello','Hello World'); echo ' - '; echo 'Hello World2'; $page->contentB[$contentUri] = wb::get_clean(); Notes
See Plugin 2.1.helloAdmin |