[20098] | 1 | <?php |
---|
[8770] | 2 | /* |
---|
| 3 | * Plugin Name: Piwecard |
---|
[19732] | 4 | * Version: auto |
---|
[8771] | 5 | * Description: envoi de Cartes Virtuelles |
---|
[8773] | 6 | * Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=487 |
---|
[19968] | 7 | * Author: Tiico & Julien1311 |
---|
[8770] | 8 | * */ |
---|
[20079] | 9 | |
---|
[8770] | 10 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 11 | |
---|
[20162] | 12 | if (mobile_theme()) |
---|
| 13 | return; |
---|
| 14 | |
---|
[8770] | 15 | global $prefixeTable; |
---|
| 16 | |
---|
[20059] | 17 | define('PIWECARD_ROOT', dirname(__FILE__)); |
---|
| 18 | define('PIWECARD_DIR', basename(dirname(__FILE__))); |
---|
| 19 | define('PIWECARD_PATH', PHPWG_PLUGINS_PATH.PIWECARD_DIR.'/'); |
---|
| 20 | define('PIWECARD_INC_PATH', PHPWG_PLUGINS_PATH . PIWECARD_DIR . '/include/'); |
---|
| 21 | define('PIWECARD_INSTALL_PATH', PHPWG_PLUGINS_PATH . PIWECARD_DIR . '/install/'); |
---|
[20254] | 22 | define('PIWECARD_MAIL_PATH', PHPWG_PLUGINS_PATH . PIWECARD_DIR . '/mail/'); |
---|
[20059] | 23 | define('PIWECARD_TABLE', $prefixeTable . 'piwecard'); |
---|
| 24 | define('PIWECARD_ADMIN', get_root_url() . 'admin.php?page=plugin-'.PIWECARD_DIR); |
---|
[8770] | 25 | |
---|
[20059] | 26 | include_once(PIWECARD_INC_PATH.'piwecard.class.php'); |
---|
[19968] | 27 | include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); |
---|
| 28 | include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); |
---|
[8770] | 29 | global $page, $template; |
---|
| 30 | |
---|
[19732] | 31 | // Load language files |
---|
[20059] | 32 | load_language('plugin.lang', PIWECARD_PATH); |
---|
[8770] | 33 | |
---|
[20010] | 34 | $piwecard = new Piwecard(); |
---|
[8770] | 35 | |
---|
| 36 | // Add ecard to picture page |
---|
[20010] | 37 | add_event_handler('loc_end_picture', array(&$piwecard, 'display_ecard_to_picture')); |
---|
[8770] | 38 | |
---|
[20010] | 39 | add_event_handler('loc_end_section_init', array(&$piwecard, 'section_init_ecard')); |
---|
| 40 | add_event_handler('loc_end_index', array(&$piwecard, 'index_ecard')); |
---|
[8770] | 41 | |
---|
[20010] | 42 | set_plugin_data($plugin['id'], $piwecard); |
---|
[8770] | 43 | |
---|
[19737] | 44 | /* +-----------------------------------------------------------------------+ |
---|
| 45 | * | Plugin admin | |
---|
| 46 | * +-----------------------------------------------------------------------+ */ |
---|
[20079] | 47 | add_event_handler('get_admin_plugin_menu_links', 'piwecard_admin_menu'); |
---|
[19737] | 48 | |
---|
[20079] | 49 | function piwecard_admin_menu($menu) { |
---|
[19737] | 50 | array_push( |
---|
| 51 | $menu, array( |
---|
| 52 | 'NAME' => 'Piwecard', |
---|
[20059] | 53 | 'URL' => PIWECARD_ADMIN, |
---|
[19737] | 54 | ) |
---|
| 55 | ); |
---|
| 56 | return $menu; |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | /* +-----------------------------------------------------------------------+ |
---|
| 60 | * | CSS/JS Style | |
---|
| 61 | * +-----------------------------------------------------------------------+ */ |
---|
[20079] | 62 | add_event_handler('loc_end_page_header', 'piwecard_css_js'); |
---|
[19737] | 63 | |
---|
[20079] | 64 | function piwecard_css_js() { |
---|
[19733] | 65 | global $template; |
---|
| 66 | |
---|
[19926] | 67 | if (defined('IN_ADMIN') and IN_ADMIN) |
---|
[20059] | 68 | $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.PIWECARD_PATH . 'css/admin.css">'); |
---|
[19926] | 69 | |
---|
[20059] | 70 | $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.PIWECARD_PATH . 'css/piwecard.css">'); |
---|
[20079] | 71 | } |
---|
[20320] | 72 | |
---|
| 73 | /* +-----------------------------------------------------------------------+ |
---|
| 74 | * | AJAX Methods | |
---|
| 75 | * +-----------------------------------------------------------------------+ */ |
---|
| 76 | add_event_handler('ws_add_methods', 'piwecard_ws_add_methods'); |
---|
| 77 | |
---|
| 78 | function piwecard_ws_add_methods($arr) { |
---|
[20341] | 79 | require_once('ws/ws_functions.inc.php'); |
---|
[20320] | 80 | } |
---|
[19956] | 81 | ?> |
---|