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

Last change on this file since 29541 was 28848, checked in by mistic100, 10 years ago

use new maintain class

File size: 1.7 KB
RevLine 
[10871]1<?php
2/*
3Plugin Name: SmartAlbums
4Version: auto
[10980]5Description: Easily create dynamic albums with tags, date and other criteria
[26442]6Plugin URI: auto
[10871]7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
[26442]11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
12
[10871]13global $prefixeTable;
14
[26442]15define('SMART_ID',      'SmartAlbums');
16define('SMART_PATH',    PHPWG_PLUGINS_PATH . SMART_ID . '/');
[16104]17define('CATEGORY_FILTERS_TABLE', $prefixeTable . 'category_filters');
[26442]18define('SMART_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . SMART_ID);
19// define('SMART_DEBUG',   true);
[10871]20
[17716]21
[19446]22add_event_handler('init', 'smart_init');
23add_event_handler('init', 'smart_periodic_update');
[26442]24add_event_handler('delete_categories', 'smart_delete_categories');
[16126]25
[17716]26if (defined('IN_ADMIN'))
27{
[26442]28  include_once(SMART_PATH.'include/events_admin.inc.php');
[17716]29  add_event_handler('loc_begin_cat_list', 'smart_cat_list');
[26442]30  add_event_handler('tabsheet_before_select','smart_tab', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
[17716]31  add_event_handler('get_admin_plugin_menu_links', 'smart_admin_menu');
32}
33
[26442]34include_once(SMART_PATH.'include/events.inc.php');
[11376]35include_once(SMART_PATH.'include/functions.inc.php');
36
[17716]37
38/**
39 * update plugin & unserialize conf & load language
40 */
[16126]41function smart_init()
42{
[26442]43  global $conf;
44
[17716]45  if (defined('IN_ADMIN'))
46  {
47    load_language('plugin.lang', SMART_PATH);
48  }
[28848]49  $conf['SmartAlbums'] = safe_unserialize($conf['SmartAlbums']);
[26442]50
51  if (script_basename() == 'index' and $conf['SmartAlbums']['smart_is_forbidden'])
[16939]52  {
53    add_event_handler('loc_end_section_init', 'smart_init_page_items');
54  }
[10871]55
[26442]56  if ($conf['SmartAlbums']['update_on_upload'])
[16938]57  {
[26442]58    add_event_handler('invalidate_user_cache', 'smart_make_all_associations');
[16938]59  }
60}
Note: See TracBrowser for help on using the repository browser.