source: extensions/SmartAlbums/main.inc.php @ 11376

Last change on this file since 11376 was 11376, checked in by mistic100, 13 years ago

Add event_handler on 'login_success' and 'invalidate_user_cache' to regenerate SmartAlbums content

File size: 1.4 KB
Line 
1<?php
2/*
3Plugin Name: SmartAlbums
4Version: auto
5Description: Easily create dynamic albums with tags, date and other criteria
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=544
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12global $prefixeTable;
13
14define('SMART_DIR', basename(dirname(__FILE__)));
15define('SMART_PATH', PHPWG_PLUGINS_PATH.SMART_DIR.'/');
16define('CATEGORY_FILTERS_TABLE', $prefixeTable.'category_filters');
17
18add_event_handler('invalidate_user_cache', 'smart_make_all_associations');
19add_event_handler('login_success', 'smart_make_all_associations');
20include_once(SMART_PATH.'include/functions.inc.php');
21
22if (script_basename() == 'index')
23{
24  add_event_handler('loc_end_section_init', 'smart_init_page_items');
25  include_once(SMART_PATH.'include/init_page_items.php');
26}
27else if (script_basename() == 'admin')
28{
29  load_language('plugin.lang', SMART_PATH);
30 
31  add_event_handler('loc_begin_cat_modify', 'smart_cat_modify'); 
32  include_once(SMART_PATH.'include/init_cat_modify.php');
33 
34  add_event_handler('loc_begin_cat_list', 'smart_cat_list');
35  include_once(SMART_PATH.'include/init_cat_list.php');
36 
37  add_event_handler('get_admin_plugin_menu_links', 'smart_admin_menu');
38        function smart_admin_menu($menu) 
39        {
40                array_push($menu, array(
41                        'NAME' => 'SmartAlbums',
42                        'URL' => get_root_url().'admin.php?page=plugin-' . SMART_DIR));
43                return $menu;
44        }
45}
46
47?>
Note: See TracBrowser for help on using the repository browser.