source: extensions/see_photos_by_user/admin.php @ 27428

Last change on this file since 27428 was 27428, checked in by ddtddt, 10 years ago

[extensions] - see_photos_by_user - new function menu / show

File size: 2.5 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3global $template, $conf, $user;
4include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
5load_language('plugin.lang', SPBA_PATH);
6$my_base_url = get_admin_plugin_menu_link(__FILE__);
7
8// +-----------------------------------------------------------------------+
9// | Check Access and exit when user status is not ok                      |
10// +-----------------------------------------------------------------------+
11check_status(ACCESS_ADMINISTRATOR);
12
13global $conf, $page;
14
15$template->assign(
16  array(
17    'SPBU1' => $conf['see_photos_by_user_nbphotos'],
18        'SPBU2' => $conf['see_photos_by_user_limit'],
19        'SPBU3' => $conf['see_photos_by_user_order'],
20        'SPBU4' => $conf['see_photos_by_user_show'],
21    )
22  );
23 
24$SPBU3T = array(
25    l10n('users in alphabetical order'),
26    l10n('users by reverse alphabetical order'),
27    l10n('by increasing number of photos'),
28        l10n('by decreasing number of photos'),
29  );
30 
31$SPBU3 = array(
32    'username ASC',
33    'username DESC',
34    'PBU ASC',
35        'PBU DSC',
36  );
37
38$template->assign('spbu', $SPBU3);
39$template->assign('spbuT', $SPBU3T); 
40
41$SPBU3T2 = array(
42    l10n('link Specials menu')." - ".l10n('select users box'),
43    l10n('bloc menu users')." - ".l10n('select users box'),
44    l10n('link Specials menu')." - ".l10n('select users box')." - ".l10n('bloc menu users'),
45        l10n('bloc menu users'),
46  );
47 
48$SPBU32 = array(
49    '1',
50    '2',
51    '3',
52        '4',
53  );
54
55$template->assign('spbu2', $SPBU32);
56$template->assign('spbuT2', $SPBU3T2); 
57
58if (isset($_POST['submitspbu']))
59{
60if (is_numeric($_POST['insspbu1'])) 
61{conf_update_param('see_photos_by_user_nbphotos', $_POST['insspbu1']);}
62else
63{array_push( $page['errors'], l10n('Maximal number users is incorrect !'));}
64if (is_numeric($_POST['insspbu2'])) 
65conf_update_param('see_photos_by_user_limit', $_POST['insspbu2']);
66else
67{array_push( $page['errors'], l10n('Minimal number photos for show users is incorrect !'));}
68conf_update_param('see_photos_by_user_order', $_POST['insspbu3']);
69conf_update_param('see_photos_by_user_show', $_POST['insspbu4']);
70
71if (!$page['errors'])
72{array_push( $page['infos'], l10n('Update Complete') );}
73 
74$template->assign(
75    array(
76      'SPBU1' => stripslashes($_POST['insspbu1']),
77          'SPBU2' => stripslashes($_POST['insspbu2']),
78          'SPBU3' => stripslashes($_POST['insspbu3']),
79          'SPBU4' => stripslashes($_POST['insspbu4']),
80      )
81    );
82
83}
84
85$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
86$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
87?>
Note: See TracBrowser for help on using the repository browser.