Quick Search:

View

Revision:

Diff

Diff from 1200 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/branches/hpdl/oscommerce/admin/includes/applications/administrators/pages/batch_edit.php

Annotated File View

hpdl
1125
1 <?php
2 /*
3   $Id: $
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
8   Copyright (c) 2006 osCommerce
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
36 <h1><?php echo osc_link_object(osc_href_link(FILENAME_DEFAULT, $osC_Template->getModule()), $osC_Template->getPageTitle()); ?></h1>
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">
46   <form name="aEditBatch" action="<?php echo osc_href_link(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page'] . '&action=batchSave'); ?>" method="post">
47
48   <p><?php echo TEXT_EDIT_BATCH_INTRO; ?></p>
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
1200
68   echo '<p>' . osc_draw_radio_field('mode', array(array('id' => OSC_ADMINISTRATORS_ACCESS_MODE_ADD, 'text' => 'Add To'), array('id' => OSC_ADMINISTRATORS_ACCESS_MODE_REMOVE, 'text' => 'Remove From'), array('id' => OSC_ADMINISTRATORS_ACCESS_MODE_SET, 'text' => 'Set To')), OSC_ADMINISTRATORS_ACCESS_MODE_ADD) . '</p>';
hpdl
1125
69
70   echo '<ul style="list-style-type: none; padding-left: 0;">' .
71        '  <li>' . osc_draw_checkbox_field('modules[]', '*', null, 'id="access_globaladmin"') . '&nbsp;<label for="access_globaladmin"><b>' . TEXT_GLOBAL_ACCESS . '</b></label></li>' .
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'] . '"') . '&nbsp;<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>