hpdl
|
1125
|
1
|
<?php
|
|
2
|
/*
|
|
3
|
$Id: $
|
|
4
|
|
|
5
|
osCommerce, Open Source E-Commerce Solutions
|
|
6
|
http://www.oscommerce.com
|
|
7
|
|
hpdl
|
1446
|
8
|
Copyright (c) 2007 osCommerce
|
hpdl
|
1125
|
9
|
|
|
10
|
Released under the GNU General Public License
|
|
11
|
*/
|
|
12
|
|
|
13
|
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/access');
|
|
14
|
$osC_DirectoryListing->setIncludeDirectories(false);
|
|
15
|
|
|
16
|
$access_modules_array = array();
|
|
17
|
|
|
18
|
foreach ($osC_DirectoryListing->getFiles() as $file) {
|
|
19
|
$module = substr($file['name'], 0, strrpos($file['name'], '.'));
|
|
20
|
|
|
21
|
if (!class_exists('osC_Access_' . ucfirst($module))) {
|
|
22
|
$osC_Language->loadConstants('modules/access/' . $file['name']);
|
|
23
|
include($osC_DirectoryListing->getDirectory() . '/' . $file['name']);
|
|
24
|
}
|
|
25
|
|
|
26
|
$module = 'osC_Access_' . ucfirst($module);
|
|
27
|
$module = new $module();
|
|
28
|
|
|
29
|
$access_modules_array[osC_Access::getGroupTitle( $module->getGroup() )][] = array('id' => $module->getModule(),
|
|
30
|
'text' => $module->getTitle());
|
|
31
|
}
|
|
32
|
|
|
33
|
ksort($access_modules_array);
|
|
34
|
?>
|
|
35
|
|
hpdl
|
1405
|
36
|
<h1><?php echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule()), $osC_Template->getPageTitle()); ?></h1>
|
hpdl
|
1125
|
37
|
|
|
38
|
<?php
|
|
39
|
if ($osC_MessageStack->size($osC_Template->getModule()) > 0) {
|
|
40
|
echo $osC_MessageStack->output($osC_Template->getModule());
|
|
41
|
}
|
|
42
|
?>
|
|
43
|
|
|
44
|
<div class="infoBoxHeading"><?php echo osc_icon('configure.png', IMAGE_EDIT) . ' Batch Edit'; ?></div>
|
|
45
|
<div class="infoBoxContent">
|
hpdl
|
1405
|
46
|
<form name="aEditBatch" action="<?php echo osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page'] . '&action=batchSave'); ?>" method="post">
|
hpdl
|
1125
|
47
|
|
hpdl
|
1446
|
48
|
<p><?php echo $osC_Language->get('introduction_batch_edit_administrators'); ?></p>
|
hpdl
|
1125
|
49
|
|
|
50
|
<?php
|
|
51
|
$Qadmins = $osC_Database->query('select id, user_name from :table_administrators where id in (":id") order by user_name');
|
|
52
|
$Qadmins->bindTable(':table_administrators', TABLE_ADMINISTRATORS);
|
|
53
|
$Qadmins->bindRaw(':id', implode('", "', array_unique(array_filter(array_slice($_POST['batch'], 0, MAX_DISPLAY_SEARCH_RESULTS), 'is_numeric'))));
|
|
54
|
$Qadmins->execute();
|
|
55
|
|
|
56
|
$names_string = '';
|
|
57
|
|
|
58
|
while ($Qadmins->next()) {
|
|
59
|
$names_string .= osc_draw_hidden_field('batch[]', $Qadmins->valueInt('id')) . '<b>' . $Qadmins->value('user_name') . '</b>, ';
|
|
60
|
}
|
|
61
|
|
|
62
|
if ( !empty($names_string) ) {
|
hpdl
|
1200
|
63
|
$names_string = substr($names_string, 0, -2);
|
hpdl
|
1125
|
64
|
}
|
|
65
|
|
|
66
|
echo '<p>' . $names_string . '</p>';
|
|
67
|
|
hpdl
|
1446
|
68
|
echo '<p>' . osc_draw_radio_field('mode', array(array('id' => OSC_ADMINISTRATORS_ACCESS_MODE_ADD, 'text' => $osC_Language->get('add_to')), array('id' => OSC_ADMINISTRATORS_ACCESS_MODE_REMOVE, 'text' => $osC_Language->get('remove_from')), array('id' => OSC_ADMINISTRATORS_ACCESS_MODE_SET, 'text' => $osC_Language->get('set_to'))), OSC_ADMINISTRATORS_ACCESS_MODE_ADD) . '</p>';
|
hpdl
|
1125
|
69
|
|
|
70
|
echo '<ul style="list-style-type: none; padding-left: 0;">' .
|
hpdl
|
1446
|
71
|
' <li>' . osc_draw_checkbox_field('modules[]', '*', null, 'id="access_globaladmin"') . ' <label for="access_globaladmin"><b>' . $osC_Language->get('global_access') . '</b></label></li>' .
|
hpdl
|
1125
|
72
|
'</ul>' .
|
|
73
|
'<ul style="list-style-type: none; padding-left: 0;">';
|
|
74
|
|
|
75
|
foreach ( $access_modules_array as $group => $modules ) {
|
|
76
|
echo ' <li><b>' . $group . '</b>' .
|
|
77
|
' <ul style="list-style-type: none; padding-left: 15px;">';
|
|
78
|
|
|
79
|
foreach ($modules as $module) {
|
|
80
|
echo ' <li>' . osc_draw_checkbox_field('modules[]', $module['id'], null, 'id="access_' . $module['id'] . '"') . ' <label for="access_' . $module['id'] . '" class="fieldLabel">' . $module['text'] . '</label></li>';
|
|
81
|
}
|
|
82
|
|
|
83
|
echo ' </ul>' .
|
|
84
|
' </li>';
|
|
85
|
}
|
|
86
|
|
|
87
|
echo '</ul>';
|
|
88
|
?>
|
|
89
|
|
hpdl
|
1200
|
90
|
<p align="center"><?php echo osc_draw_hidden_field('subaction', 'confirm') . '<input type="submit" value="' . IMAGE_SAVE . '" class="operationButton" /> <input type="button" value="' . IMAGE_CANCEL . '" onclick="document.location.href=\'' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page']) . '\';" class="operationButton" />'; ?></p>
|
hpdl
|
1125
|
91
|
|
|
92
|
</form>
|
|
93
|
</div>
|