source: extensions/File_Uploader/main.inc.php @ 19675

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

add pdf2tab plugin

  • Property svn:eol-style set to LF
File size: 2.2 KB
Line 
1<?php
2/*
3Plugin Name: File Uploader
4Version: auto
5Description: Upload files to the galleries folder and synchronise them with database
6Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=661
7Author: Julien1311
8*/
9
10//Check whether we are indeed included by Piwigo.
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13global $conf;
14
15define('FILE_UPLOADER_DIR' , basename(dirname(__FILE__)));
16define('FILE_UPLOADER_PATH' , PHPWG_PLUGINS_PATH.FILE_UPLOADER_DIR.'/');
17define('FILE_UPLOADER_ADMIN',   get_root_url() . 'admin.php?page=plugin-'.FILE_UPLOADER_DIR);
18define('FILE_UPLOADER_PDF2TAB_ABSOLUTE_PATH' , dirname(__FILE__).'/plugin_pdf2tab/');
19
20/* +-----------------------------------------------------------------------+
21 * | Plugin admin                                                          |
22 * +-----------------------------------------------------------------------+ */
23
24// Add an entry to the plugins menu
25add_event_handler('get_admin_plugin_menu_links', 'file_uploader_admin_menu');
26
27function file_uploader_admin_menu($menu) {
28        array_push(
29                $menu, array(
30                        'NAME'  => 'File Uploader',
31                        'URL'   => FILE_UPLOADER_ADMIN,
32                )
33        );     
34        return $menu;
35}
36
37/* +-----------------------------------------------------------------------+
38 * | Plugin code                                                           |
39 * +-----------------------------------------------------------------------+ */
40$conf_file_uploader = unserialize($conf['file_uploader']);
41if ($conf_file_uploader['new_tab'] == 1) {
42        load_language('plugin.lang', FILE_UPLOADER_PATH);
43        include_once(FILE_UPLOADER_PDF2TAB_ABSOLUTE_PATH.'include/thumbnails.inc.php');
44        include_once(FILE_UPLOADER_PDF2TAB_ABSOLUTE_PATH.'include/picture.inc.php');
45}
46
47       
48/* +-----------------------------------------------------------------------+
49 * | CSS Style                                                             |
50 * +-----------------------------------------------------------------------+ */
51
52add_event_handler('loc_end_page_header', 'file_uploader_css');
53
54function file_uploader_css() {
55        global $template;
56
57        //add a stylesheet
58        $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.FILE_UPLOADER_PATH.'admin/admin.css">');
59}
60?>
Note: See TracBrowser for help on using the repository browser.