diff options
author | vdigital <vdigital@piwigo.org> | 2007-01-03 20:31:54 +0000 |
---|---|---|
committer | vdigital <vdigital@piwigo.org> | 2007-01-03 20:31:54 +0000 |
commit | aa5f1e3358e0123d785755d90d25a5cee340f754 (patch) | |
tree | e55c59254224cd270fc4373bb42bc6e089f4fe73 /plugins/admin_advices/main.inc.php | |
parent | 9fc9785c74d82b0b6524d719f31fc57fe68e6ed1 (diff) |
"Admin Advices !" Standard plugin : May give you sometimes an advice on the administration page.
A draft version: With 3 advices in English and only one in French.
Maybe we can have more than 50 advices from a starting point.
This plugin is mainly for beginners but not only.
git-svn-id: http://piwigo.org/svn/trunk@1694 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | plugins/admin_advices/main.inc.php | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/plugins/admin_advices/main.inc.php b/plugins/admin_advices/main.inc.php new file mode 100644 index 000000000..c6362a72b --- /dev/null +++ b/plugins/admin_advices/main.inc.php @@ -0,0 +1,56 @@ +<?php /*
+Plugin Name: Admin Advices !
+Author: PhpWebGallery team
+Description: Give you an advice on the administration page.
+*/
+
+add_event_handler('loc_begin_page_tail', 'set_admin_advice' );
+
+
+function set_admin_advice()
+{
+ global $page, $user, $template, $conf;
+
+ // This Plugin works only on the Admin page
+ if ( isset($page['body_id']) and $page['body_id']=='theAdminPage'
+ and isset($page['page']) and $page['page'] == 'intro' )
+ {
+ // Setup Advice Language (Maybe there is already a variable)
+ $advlang = ( isset($user['language']) ) ?
+ $user['language'] : $conf['default_language']; // en_UK.iso-8859-1
+
+ $adv = array();
+
+// Include language advices
+ include_once( PHPWG_ROOT_PATH
+ . "plugins/admin_advices/$advlang/lang.adv.php" );
+
+// If there is an advice
+ if ( $cond )
+ {
+// $template->set_filenames( array( 'advice' => 'admin_advices.tpl' ));
+ $template->set_filenames(array(
+ 'admin_advice' =>
+ PHPWG_ROOT_PATH.'/plugins/admin_advices/admin_advices.tpl')
+ );
+ $advice_text = array_shift($adv);
+ $template->assign_vars(
+ array(
+ 'ADVICE_ABOUT' => '$conf[' . "'$confk'] ",
+ 'ADVICE_TEXT' => $advice_text,
+ )
+ );
+ foreach ($adv as $advice)
+ {
+ $template->assign_block_vars(
+ 'More',
+ array(
+ 'ADVICE' => $advice
+ )
+ );
+ }
+ $template->parse('admin_advice');
+ }
+ }
+}
+?>
|