Datei: plugins/example.userprefs.php
Quellcode
Darstellung:
-
<?php
- /**
- * Plugin example: User preferences
- *
- */
- class UserPrefsExample extends BMPlugin
- {
- function UserPrefsExample()
- {
- $this->name = 'User preferences example';
- $this->author = 'B1G Software';
- $this->web = 'http://www.b1g.de';
- $this->mail = 'info@b1g.de';
- $this->version = '1.0';
- $this->designedfor = '7.0.0';
- $this->type = BMPLUGIN_DEFAULT;
- }
-
- function OnReadLang(&$lang_user, &$lang_client, &$lang_custom, &$lang_admin, $lang)
- {
- $lang_user['userprefs_example'] = 'User preferences example';
- $lang_user['prefs_d_userprefs_example'] = 'Show the user preferences example plugin\'s preferences page.';
- }
-
- function FileHandler($file, $action)
- {
- if($file=='prefs.php')
- {
- $GLOBALS['prefsItems']['userprefs_example'] = true;
- $GLOBALS['prefsImages']['userprefs_example'] = 'plugins/templates/images/userprefs_ico48.png';
- $GLOBALS['prefsIcons']['userprefs_example'] = 'plugins/templates/images/userprefs_ico16.png';
- }
- }
-
- function UserPrefsPageHandler($action)
- {
- global $tpl;
-
- if($action != 'userprefs_example')
- return(false);
-
- $tpl->assign('pageContent', $this->_templatePath('userprefs.prefspage.tpl'));
- $tpl->display('li/index.tpl');
- return(true);
- }
- }
-
- /**
- * register plugin
- */
- $plugins->registerPlugin('UserPrefsExample');
- ?>