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