1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Thumbnails Regeneration |
---|
4 | Version: auto |
---|
5 | Description: Regenerate gallery's thumbnails. |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=525 |
---|
7 | Author: P@t |
---|
8 | Author URI: http://www.gauchon.com |
---|
9 | */ |
---|
10 | |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | define('REGENERATE_THUMBNAILS_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); |
---|
13 | |
---|
14 | add_event_handler('loc_begin_admin', 'rg_add_thumbnails_tab'); |
---|
15 | add_event_handler('loc_begin_element_set_global', 'rg_element_set_global_add_action'); |
---|
16 | add_event_handler('ws_add_methods', 'add_regenerate_thumbnails_method'); |
---|
17 | |
---|
18 | function rg_add_thumbnails_tab() |
---|
19 | { |
---|
20 | global $page; |
---|
21 | |
---|
22 | if (isset($_GET['page']) and in_array($_GET['page'], array('thumbnail', 'plugin-regenerateThumbnails'))) |
---|
23 | { |
---|
24 | load_language('plugin.lang', REGENERATE_THUMBNAILS_PATH); |
---|
25 | include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
26 | |
---|
27 | if ($_GET['page'] == 'plugin-regenerateThumbnails') |
---|
28 | $page['tab'] = 'regenerateThumbnails'; |
---|
29 | else |
---|
30 | $page['tab'] = 'thumbnail'; |
---|
31 | |
---|
32 | $tabsheet = new tabsheet(); |
---|
33 | $tabsheet->add('thumbnail', l10n('Thumbnail creation'), get_root_url().'admin.php?page=thumbnail'); |
---|
34 | $tabsheet->add('regenerateThumbnails', l10n('Regenerate Thumbnails'), get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))); |
---|
35 | $tabsheet->select($page['tab']); |
---|
36 | $tabsheet->assign(); |
---|
37 | } |
---|
38 | } |
---|
39 | |
---|
40 | function rg_element_set_global_add_action() |
---|
41 | { |
---|
42 | include(REGENERATE_THUMBNAILS_PATH.'element_set_global_action.php'); |
---|
43 | } |
---|
44 | |
---|
45 | function add_regenerate_thumbnails_method($arr) |
---|
46 | { |
---|
47 | include_once(REGENERATE_THUMBNAILS_PATH.'ws_functions.inc.php'); |
---|
48 | } |
---|
49 | |
---|
50 | ?> |
---|