source: extensions/Admin_Messages/main.inc.php @ 26040

Last change on this file since 26040 was 12356, checked in by mistic100, 13 years ago

Reorganize language files

File size: 1.8 KB
Line 
1<?php
2/*
3Plugin Name: Admin Messages
4Version: auto
5Description: Allows administrators to leave messages on the main admin page.
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=505
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13global $prefixeTable;
14
15// +-----------------------------------------------------------------------+
16//        Variables globales AM
17// +-----------------------------------------------------------------------+
18define('AM_DIR' , basename(dirname(__FILE__)));
19define('AM_PATH' , PHPWG_PLUGINS_PATH . AM_DIR . '/');
20define('AM_TABLE', $prefixeTable .'admin_messages');
21define('AM_ADMIN', get_root_url() . 'admin.php?page=plugin-' . AM_DIR);
22
23
24// +-----------------------------------------------------------------------+
25//          Triggers
26// +-----------------------------------------------------------------------+
27add_event_handler('get_admin_plugin_menu_links', 'AM_admin_menu');   // Lien d'administration
28add_event_handler('loc_begin_page_tail', 'AM_load_admin_messages'); // affichage sur admin
29
30
31// +-----------------------------------------------------------------------+
32//          Fonctions
33// +-----------------------------------------------------------------------+
34// Lien d'administration
35function AM_admin_menu($menu) {
36  array_push($menu, array(
37    'NAME' => 'Admin Messages',
38    'URL' => AM_ADMIN
39  ));
40  return $menu;
41}
42
43// affichage sur admin
44function AM_load_admin_messages() {
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  }
53}
54?>
Note: See TracBrowser for help on using the repository browser.