source: extensions/User_Info_Tracking/include/admin_events.inc.php @ 25973

Last change on this file since 25973 was 19701, checked in by Charles2012, 11 years ago

Upload to SVN.

File size: 2.1 KB
Line 
1<?php
2defined('USER_INFO_TRACKING_PATH') or die('Hacking attempt!');
3
4/**
5 * admin plugins menu link
6 */
7function user_info_tracking_admin_plugin_menu_links($menu) 
8{
9  array_push($menu, array(
10    'NAME' => l10n('User Info Tracking'),
11    'URL' => USER_INFO_TRACKING_ADMIN,
12  ));
13  return $menu;
14}
15
16/**
17 * add a tab on photo properties page
18 */
19function user_info_tracking_tabsheet_before_select($sheets, $id)
20{
21  if ($id == 'photo')
22  {
23    $sheets['user_info_tracking'] = array(
24      'caption' => l10n('User Info Tracking'),
25      'url' => USER_INFO_TRACKING_ADMIN.'-photo&amp;image_id='.$_GET['image_id'],
26      );
27  }
28 
29  return $sheets;
30}
31
32/**
33 * add a prefilter to the Batch Downloader
34 */
35function user_info_tracking_add_batch_manager_prefilters($prefilters)
36{
37        array_push($prefilters, array(
38    'ID' => 'user_info_tracking',
39    'NAME' => l10n('User Info Tracking'),
40  ));
41        return $prefilters;
42}
43
44/**
45 * perform added prefilter
46 */
47function user_info_tracking_perform_batch_manager_prefilters($filter_sets, $prefilter)
48{
49  if ($prefilter == 'user_info_tracking')
50  {
51    $query = '
52SELECT id
53  FROM '.IMAGES_TABLE.'
54  ORDER BY RAND()
55  LIMIT 20
56;';
57    $filter_sets[] = array_from_query($query, 'id');
58  }
59 
60        return $filter_sets;
61}
62
63/**
64 * add an action to the Batch Manager
65 */
66function user_info_tracking_loc_end_element_set_global()
67{
68        global $template;
69 
70        $template->append('element_set_global_plugins_actions', array(
71    'ID' => 'user_info_tracking', 
72    'NAME' => l10n('User Info Tracking'), 
73    'CONTENT' => '<label><input type="checkbox" name="check_user_info_tracking"> '.l10n('Check me!').'</label>', // this is optional
74    ));
75}
76
77/**
78 * perform added action
79 */
80function user_info_tracking_element_set_global_action($action, $collection)
81{
82        if ($action == 'user_info_tracking')
83  {
84    global $page;
85   
86    if (empty($_POST['check_user_info_tracking']))
87    {
88      array_push($page['warnings'], l10n('Nothing appened, but you didn\'t check the box!'));
89    }
90    else
91    {
92      array_push($page['infos'], l10n('Nothing appened, but you checked the box!'));
93    }
94  }
95}
96
97?>
Note: See TracBrowser for help on using the repository browser.