source: extensions/BatchDownloader/main.inc.php @ 16392

Last change on this file since 16392 was 16379, checked in by mistic100, 12 years ago

first commit, not complete
TODO : use multisize, download history, localization, compatibility with User Selection (and create User Selection !!)

File size: 1.8 KB
Line 
1<?php 
2/*
3Plugin Name: Batch Downloader
4Version: auto
5Description: Allows users to download pictures sets in ZIP. Compatible with User Selection.
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
12
13global $conf, $prefixeTable;
14
15define('BATCH_DOWNLOAD_PATH',    PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
16define('BATCH_DOWNLOAD_TSETS',   $prefixeTable . 'download_sets');
17define('BATCH_DOWNLOAD_TIMAGES', $prefixeTable . 'download_sets_images');
18define('BATCH_DOWNLOAD_LOCAL',   PHPWG_ROOT_PATH . $conf['data_location'] . 'download_archives/');
19define('BATCH_DOWNLOAD_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
20define('BATCH_DOWNLOAD_PUBLIC',  make_index_url(array('section' => 'download')) . '/');
21
22if (class_exists('ZipArchive'))
23{
24  add_event_handler('init', 'batch_download_init');
25
26  add_event_handler('loc_end_section_init', 'batch_download_section_init');
27  add_event_handler('loc_end_index', 'batch_download_page');
28 
29  add_event_handler('loc_end_index', 'batch_download_clean');
30
31  add_event_handler('loc_begin_index', 'batch_download_index_button');
32
33  add_event_handler('blockmanager_register_blocks', 'batch_download_add_menublock');
34  add_event_handler('blockmanager_apply', 'batch_download_applymenu');
35 
36  require(BATCH_DOWNLOAD_PATH . 'include/functions.inc.php');
37  require(BATCH_DOWNLOAD_PATH . 'include/BatchDownloader.class.php');
38  require(BATCH_DOWNLOAD_PATH . 'include/events.inc.php');
39}
40
41add_event_handler('get_admin_plugin_menu_links', 'batch_download_admin_menu');
42
43/* admin plugins menu */
44function batch_download_admin_menu($menu) 
45{
46  array_push($menu, array(
47    'NAME' => 'Batch Downloader',
48    'URL' => BATCH_DOWNLOAD_ADMIN,
49  ));
50  return $menu;
51}
52
53?>
Note: See TracBrowser for help on using the repository browser.