source: extensions/Prune_History/main.inc.php @ 14838

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/*
3Plugin Name: Prune History
4Version: 1.0.0-beta1
5Description: Based on original History_cleanup plugin from VDigital, this plugin allows to manually or automatically prune history table according to configurable criteria
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
7Author: Eric
8Author URI: http://www.infernoweb.net
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13if(!defined('PH_PATH'))
14{
15  define('PH_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
16}
17
18global $conf;
19
20include_once (PH_PATH.'include/functions.inc.php');
21
22load_language('plugin.lang', PH_PATH);
23$conf_PH = unserialize($conf['PruneHistory']);
24
25/* Plugin admin */
26add_event_handler('get_admin_plugin_menu_links', 'PH_admin_menu');
27
28function 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
47if (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.