1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: SmartAlbums |
---|
4 | Version: auto |
---|
5 | Description: Easily create dynamic albums with tags, date and other criteria |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=544 |
---|
7 | Author: Mistic |
---|
8 | Author URI: http://www.strangeplanet.fr |
---|
9 | */ |
---|
10 | |
---|
11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
12 | global $prefixeTable; |
---|
13 | |
---|
14 | define('SMART_DIR', basename(dirname(__FILE__))); |
---|
15 | define('SMART_PATH', PHPWG_PLUGINS_PATH.SMART_DIR.'/'); |
---|
16 | define('CATEGORY_FILTERS_TABLE', $prefixeTable.'category_filters'); |
---|
17 | define('SMART_ADMIN', get_root_url().'admin.php?page=plugin-' . SMART_DIR); |
---|
18 | |
---|
19 | add_event_handler('invalidate_user_cache', 'smart_make_all_associations'); |
---|
20 | include_once(SMART_PATH.'include/functions.inc.php'); |
---|
21 | |
---|
22 | if (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 | } |
---|
27 | else 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' => SMART_ADMIN, |
---|
43 | ) |
---|
44 | ); |
---|
45 | return $menu; |
---|
46 | } |
---|
47 | } |
---|
48 | |
---|
49 | ?> |
---|