source: extensions/Piwecard/main.inc.php @ 19968

Last change on this file since 19968 was 19968, checked in by julien1311, 11 years ago

[piwecard] various improvements

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1<?php
2/*
3 * Plugin Name: Piwecard
4 * Version: auto
5 * Description: envoi de Cartes Virtuelles
6 * Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=487
7 * Author: Tiico & Julien1311
8 * */
9 
10if (!defined('PHPWG_ROOT_PATH'))  die('Hacking attempt!');
11
12global $prefixeTable;
13
14define('ECARD_VERSION', '1.1.0');
15
16define('ECARD_ROOT', dirname(__FILE__));
17define('ECARD_DIR', basename(dirname(__FILE__)));
18define('ECARD_PATH', PHPWG_PLUGINS_PATH.ECARD_DIR.'/');
19define('ECARD_INC_PATH', PHPWG_PLUGINS_PATH . ECARD_DIR . '/include/');
20define('ECARD_INSTALL_PATH', PHPWG_PLUGINS_PATH . ECARD_DIR . '/install/');
21define('ECARD_TABLE', $prefixeTable . 'piwecard');
22define('ECARD_ADMIN',   get_root_url() . 'admin.php?page=plugin-'.ECARD_DIR);
23
24load_language('plugin.lang', ECARD_PATH);
25
26include_once(ECARD_INC_PATH.'piwecard.class.php');
27include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
28include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
29global $page, $template;
30
31// Load language files
32load_language('plugin.lang', ECARD_PATH);       
33
34$ecard = new Piwecard();
35
36// Add ecard to picture page
37add_event_handler('loc_end_picture', array(&$ecard, 'display_ecard_to_picture')); 
38
39add_event_handler('loc_end_section_init', array(&$ecard, 'section_init_ecard'));
40add_event_handler('loc_end_index', array(&$ecard, 'index_ecard'));
41
42add_event_handler('loc_end_page_header', 'css_js_ecard');
43
44set_plugin_data($plugin['id'], $ecard);
45
46/* +-----------------------------------------------------------------------+
47 * | Plugin admin                                                          |
48 * +-----------------------------------------------------------------------+ */
49
50// Add an entry to the plugins menu
51add_event_handler('get_admin_plugin_menu_links', 'ecard_admin_menu');
52
53function ecard_admin_menu($menu) {
54        array_push(
55                $menu, array(
56                        'NAME'  => 'Piwecard',
57                        'URL'   => ECARD_ADMIN,
58                )
59        );     
60        return $menu;
61}
62
63/* +-----------------------------------------------------------------------+
64 * | CSS/JS Style                                                          |
65 * +-----------------------------------------------------------------------+ */
66
67function css_js_ecard() {
68        global $template;
69       
70        if (defined('IN_ADMIN') and IN_ADMIN)
71                $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.ECARD_PATH . 'css/admin.css">');
72       
73        $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.ECARD_PATH . 'css/piwecard.css">');
74}       
75?>
Note: See TracBrowser for help on using the repository browser.