source: extensions/see_photos_by_user/admin.php @ 27391

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

[extensions] - see_photos_by_user - new options

File size: 1.9 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    )
21  );
22 
23$SPBU3T = array(
24    l10n('users in alphabetical order'),
25    l10n('users by reverse alphabetical order'),
26    l10n('by increasing number of photos'),
27        l10n('by decreasing number of photos'),
28  );
29 
30$SPBU3 = array(
31    'username ASC',
32    'username DESC',
33    'PBU ASC',
34        'PBU DSC',
35  );
36
37$template->assign('spbu', $SPBU3);
38$template->assign('spbuT', $SPBU3T); 
39 
40
41if (isset($_POST['submitspbu']))
42{
43if (is_numeric($_POST['insspbu1'])) 
44{conf_update_param('see_photos_by_user_nbphotos', $_POST['insspbu1']);}
45else
46{array_push( $page['errors'], l10n('numerique'));}
47if (is_numeric($_POST['insspbu2'])) 
48conf_update_param('see_photos_by_user_limit', $_POST['insspbu2']);
49else
50{array_push( $page['errors'], l10n('numerique'));}
51conf_update_param('see_photos_by_user_order', $_POST['insspbu3']);
52
53
54array_push( $page['infos'], l10n('ok') );
55 
56$template->assign(
57    array(
58      'SPBU1' => stripslashes($_POST['insspbu1']),
59          'SPBU2' => stripslashes($_POST['insspbu2']),
60          'SPBU3' => stripslashes($_POST['insspbu3']),
61      )
62    );
63
64}
65
66$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
67$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
68?>
Note: See TracBrowser for help on using the repository browser.