1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Admin Messages |
---|
4 | Version: auto |
---|
5 | Description: Allows administrators to leave messages on the main admin page. |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=505 |
---|
7 | Author: Mistic |
---|
8 | Author URI: http://www.strangeplanet.fr |
---|
9 | Has Settings: true |
---|
10 | */ |
---|
11 | |
---|
12 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
13 | |
---|
14 | global $prefixeTable; |
---|
15 | |
---|
16 | // +-----------------------------------------------------------------------+ |
---|
17 | // Variables globales AM |
---|
18 | // +-----------------------------------------------------------------------+ |
---|
19 | define('AM_DIR' , basename(dirname(__FILE__))); |
---|
20 | define('AM_PATH' , PHPWG_PLUGINS_PATH . AM_DIR . '/'); |
---|
21 | define('AM_TABLE', $prefixeTable .'admin_messages'); |
---|
22 | define('AM_ADMIN', get_root_url() . 'admin.php?page=plugin-' . AM_DIR); |
---|
23 | |
---|
24 | |
---|
25 | // +-----------------------------------------------------------------------+ |
---|
26 | // Triggers |
---|
27 | // +-----------------------------------------------------------------------+ |
---|
28 | add_event_handler('loc_begin_page_tail', 'AM_load_admin_messages'); // affichage sur admin |
---|
29 | |
---|
30 | // +-----------------------------------------------------------------------+ |
---|
31 | // Fonctions |
---|
32 | // +-----------------------------------------------------------------------+ |
---|
33 | |
---|
34 | // affichage sur admin |
---|
35 | function AM_load_admin_messages() { |
---|
36 | global $template, $page, $conf, $user; |
---|
37 | |
---|
38 | if (script_basename() == 'admin' AND defined('IN_ADMIN') AND IN_ADMIN |
---|
39 | AND isset($page['body_id']) AND $page['body_id']=='theAdminPage' |
---|
40 | AND $page['page'] == 'intro') |
---|
41 | { |
---|
42 | include(AM_PATH . 'admin_messages.php'); |
---|
43 | } |
---|
44 | } |
---|
45 | ?> |
---|