[9421] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Admin Messages |
---|
[10982] | 4 | Version: auto |
---|
[9421] | 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 | */ |
---|
| 10 | |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 12 | |
---|
| 13 | global $prefixeTable; |
---|
| 14 | |
---|
| 15 | // +-----------------------------------------------------------------------+ |
---|
[12356] | 16 | // Variables globales AM |
---|
[9421] | 17 | // +-----------------------------------------------------------------------+ |
---|
| 18 | define('AM_DIR' , basename(dirname(__FILE__))); |
---|
[9786] | 19 | define('AM_PATH' , PHPWG_PLUGINS_PATH . AM_DIR . '/'); |
---|
[9421] | 20 | define('AM_TABLE', $prefixeTable .'admin_messages'); |
---|
[9786] | 21 | define('AM_ADMIN', get_root_url() . 'admin.php?page=plugin-' . AM_DIR); |
---|
[9421] | 22 | |
---|
| 23 | |
---|
| 24 | // +-----------------------------------------------------------------------+ |
---|
[12356] | 25 | // Triggers |
---|
[9421] | 26 | // +-----------------------------------------------------------------------+ |
---|
[12356] | 27 | add_event_handler('get_admin_plugin_menu_links', 'AM_admin_menu'); // Lien d'administration |
---|
[9421] | 28 | add_event_handler('loc_begin_page_tail', 'AM_load_admin_messages'); // affichage sur admin |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | // +-----------------------------------------------------------------------+ |
---|
[12356] | 32 | // Fonctions |
---|
[9421] | 33 | // +-----------------------------------------------------------------------+ |
---|
| 34 | // Lien d'administration |
---|
| 35 | function AM_admin_menu($menu) { |
---|
[12356] | 36 | array_push($menu, array( |
---|
| 37 | 'NAME' => 'Admin Messages', |
---|
| 38 | 'URL' => AM_ADMIN |
---|
| 39 | )); |
---|
| 40 | return $menu; |
---|
[9421] | 41 | } |
---|
| 42 | |
---|
| 43 | // affichage sur admin |
---|
| 44 | function AM_load_admin_messages() { |
---|
[12356] | 45 | global $template, $page, $conf, $user; |
---|
| 46 | |
---|
| 47 | if (script_basename() == 'admin' AND defined('IN_ADMIN') AND IN_ADMIN |
---|
| 48 | AND isset($page['body_id']) AND $page['body_id']=='theAdminPage' |
---|
| 49 | AND $page['page'] == 'intro') |
---|
| 50 | { |
---|
| 51 | include(AM_PATH . 'admin_messages.php'); |
---|
| 52 | } |
---|
[9421] | 53 | } |
---|
| 54 | ?> |
---|