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

Last change on this file since 16938 was 16938, checked in by mistic100, 8 years ago

use Piwigo 2.4.2 tabsheets

File size: 1.7 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_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
15define('CATEGORY_FILTERS_TABLE', $prefixeTable . 'category_filters');
16define('SMART_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
17
18add_event_handler('invalidate_user_cache', 'smart_make_all_associations');
19
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/page_items.php');
26}
27else if (script_basename() == 'admin')
28{
29  add_event_handler('init', 'smart_init');
30}
31
32function smart_init()
33{
34  global $conf;
35 
36  load_language('plugin.lang', SMART_PATH);
37  $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']);
38   
39  include_once(SMART_PATH.'include/cat_list.php');
40 
41 
42  add_event_handler('loc_begin_cat_list', 'smart_cat_list');
43  add_event_handler('tabsheet_before_select','smart_tab', 50, 2); 
44  add_event_handler('get_admin_plugin_menu_links', 'smart_admin_menu');
45}
46
47function smart_tab($sheets, $id)
48{
49  if ($id == 'album')
50  {
51    $sheets['smartalbum'] = array(
52      'caption' => 'SmartAlbum',
53      'url' => SMART_ADMIN.'-album&amp;cat_id='.$_GET['cat_id'],
54      );
55  }
56 
57  return $sheets;
58}
59
60function smart_admin_menu($menu) 
61{
62  array_push($menu, array(
63      'NAME' => 'SmartAlbums',
64      'URL' => SMART_ADMIN,
65    ));
66  return $menu;
67}
68
69?>
Note: See TracBrowser for help on using the repository browser.