Last change
on this file since 19811 was
19811,
checked in by julien1311, 11 years ago
|
add an admin page to choose the extension to handle
|
-
Property svn:eol-style set to
LF
|
File size:
1.6 KB
|
Rev | Line | |
---|
[19673] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: pdf2tab |
---|
[19811] | 4 | Version: 2.4.e |
---|
[19673] | 5 | Description: open pdf files in new tab instead of downloading it |
---|
[19811] | 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=655 |
---|
[19673] | 7 | Author: Julien1311 |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | //Check whether we are indeed included by Piwigo. |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 12 | |
---|
| 13 | define('PDF2TAB_ABSOLUTE_PATH' , dirname(__FILE__).'/'); |
---|
| 14 | define('PDF2TAB_DIR' , basename(dirname(__FILE__))); |
---|
| 15 | define('PDF2TAB_PATH' , PHPWG_PLUGINS_PATH.PDF2TAB_DIR.'/'); |
---|
[19811] | 16 | define('PDF2TAB_ADMIN' , get_root_url() . 'admin.php?page=plugin-'.PDF2TAB_DIR); |
---|
[19673] | 17 | |
---|
[19811] | 18 | /* +-----------------------------------------------------------------------+ |
---|
| 19 | * | Plugin admin | |
---|
| 20 | * +-----------------------------------------------------------------------+ */ |
---|
[19673] | 21 | |
---|
[19811] | 22 | // Add an entry to the plugins menu |
---|
| 23 | add_event_handler('get_admin_plugin_menu_links', 'pdf2tab_admin_menu'); |
---|
| 24 | |
---|
| 25 | function pdf2tab_admin_menu($menu) { |
---|
| 26 | array_push($menu, array( |
---|
| 27 | 'NAME' => 'PDF2Tab', |
---|
| 28 | 'URL' => PDF2TAB_ADMIN, |
---|
| 29 | ) |
---|
| 30 | ); |
---|
| 31 | return $menu; |
---|
| 32 | } |
---|
| 33 | |
---|
[19673] | 34 | /* +-----------------------------------------------------------------------+ |
---|
| 35 | * | Plugin code | |
---|
| 36 | * +-----------------------------------------------------------------------+ */ |
---|
[19811] | 37 | |
---|
[19673] | 38 | include_once(PDF2TAB_PATH.'include/thumbnails.inc.php'); |
---|
| 39 | include_once(PDF2TAB_PATH.'include/picture.inc.php'); |
---|
[19811] | 40 | |
---|
| 41 | add_event_handler('loc_begin_admin_page', 'pdf2tab_css'); |
---|
| 42 | |
---|
| 43 | function pdf2tab_css() { |
---|
| 44 | global $template, $conf; |
---|
| 45 | |
---|
| 46 | //add a stylesheet |
---|
| 47 | $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.PDF2TAB_PATH.'css/admin.css">'); |
---|
| 48 | } |
---|
[19673] | 49 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.