Datei: plugins/example.acp.php
Quellcode
Darstellung:
-
<?php
- /**
- * Plugin example: ACP
- *
- */
- class ACPExample extends BMPlugin
- {
- function ACPExample()
- {
- $this->name = 'ACP example';
- $this->author = 'B1G Software';
- $this->web = 'http://www.b1g.de';
- $this->mail = 'info@b1g.de';
- $this->version = '1.1';
- $this->designedfor = '7.2.0';
- $this->type = BMPLUGIN_DEFAULT;
-
- $this->admin_pages = true;
- $this->admin_page_title = 'ACP example';
- }
-
- function AdminHandler()
- {
- global $tpl;
-
- if(!isset($_REQUEST['action']))
- $_REQUEST['action'] = 'page1';
-
- $tabs = array(
- 0 => array(
- 'title' => 'Page 1',
- 'link' => $this->_adminLink() . '&action=page1&',
- 'active' => $_REQUEST['action'] == 'page1'
- ),
- 1 => array(
- 'title' => 'Page 2',
- 'link' => $this->_adminLink() . '&action=page2&',
- 'active' => $_REQUEST['action'] == 'page2'
- )
- );
-
- $tpl->assign('tabs', $tabs);
-
- if($_REQUEST['action'] == 'page1')
- $tpl->assign('page', $this->_templatePath('acpsample.page1.tpl'));
- else if($_REQUEST['action'] == 'page2')
- $tpl->assign('page', $this->_templatePath('acpsample.page2.tpl'));
- }
-
- function getNotices()
- {
- $notices = array();
-
- $notices[] = array('type' => 'info',
- 'text' => 'ACP example plugin is activated',
- 'link' => $this->_adminLink() . '&');
-
- return($notices);
- }
- }
-
- /**
- * register plugin
- */
- $plugins->registerPlugin('ACPExample');
- ?>