Last change
on this file since 14838 was
14838,
checked in by Eric, 12 years ago
|
Initial commit
|
-
Property svn:eol-style set to
LF
|
File size:
1.3 KB
|
Line | |
---|
1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Prune History |
---|
4 | Version: 1.0.0-beta1 |
---|
5 | Description: Based on original History_cleanup plugin from VDigital, this plugin allows to manually or automatically prune history table according to configurable criteria |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid= |
---|
7 | Author: Eric |
---|
8 | Author URI: http://www.infernoweb.net |
---|
9 | */ |
---|
10 | |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | |
---|
13 | if(!defined('PH_PATH')) |
---|
14 | { |
---|
15 | define('PH_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
16 | } |
---|
17 | |
---|
18 | global $conf; |
---|
19 | |
---|
20 | include_once (PH_PATH.'include/functions.inc.php'); |
---|
21 | |
---|
22 | load_language('plugin.lang', PH_PATH); |
---|
23 | $conf_PH = unserialize($conf['PruneHistory']); |
---|
24 | |
---|
25 | /* Plugin admin */ |
---|
26 | add_event_handler('get_admin_plugin_menu_links', 'PH_admin_menu'); |
---|
27 | |
---|
28 | function PH_admin_menu($menu) |
---|
29 | { |
---|
30 | // +-----------------------------------------------------------------------+ |
---|
31 | // | Getting plugin name | |
---|
32 | // +-----------------------------------------------------------------------+ |
---|
33 | $plugin = PHInfos(PH_PATH); |
---|
34 | $name = $plugin['name']; |
---|
35 | |
---|
36 | array_push($menu, |
---|
37 | array( |
---|
38 | 'NAME' => $name, |
---|
39 | 'URL' => get_root_url().'admin.php?page=plugin-'.basename(PH_PATH) |
---|
40 | ) |
---|
41 | ); |
---|
42 | |
---|
43 | return $menu; |
---|
44 | } |
---|
45 | |
---|
46 | // Prune automation on user login |
---|
47 | if (isset($conf_PH[1]) and $conf_PH[1] == 'true') |
---|
48 | { |
---|
49 | add_event_handler('login_success', 'history_autoprune' ); |
---|
50 | } |
---|
51 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.