source: extensions/regenerateThumbnails/main.inc.php @ 9950

Last change on this file since 9950 was 9937, checked in by patdenice, 14 years ago

Remove "all photos" language key.
Move prefilter to element_set_global_action.php file.

File size: 1.5 KB
Line 
1<?php
2/*
3Plugin Name: Thumbnails Regeneration
4Version: 2.2.0
5Description: Regenerate thumbnails
6Author: P@t
7*/
8
9if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
10define('REGENERATE_THUMBNAILS_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
11
12add_event_handler('loc_begin_admin', 'rg_add_thumbnails_tab');
13add_event_handler('loc_begin_element_set_global', 'rg_element_set_global_add_action');
14add_event_handler('ws_add_methods', 'add_regenerate_thumbnails_method');
15
16function 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
38function rg_element_set_global_add_action()
39{
40  include(REGENERATE_THUMBNAILS_PATH.'element_set_global_action.php');
41}
42
43function add_regenerate_thumbnails_method($arr)
44{
45  include_once(REGENERATE_THUMBNAILS_PATH.'ws_functions.inc.php');
46}
47
48?>
Note: See TracBrowser for help on using the repository browser.