mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Select boxes rather than several submit buttons ... must standardise these approaches across admin forms
git-svn-id: file:///svn/phpbb/trunk@4618 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
411683ffd4
commit
da7feb37a8
1 changed files with 136 additions and 133 deletions
|
@ -23,10 +23,8 @@ if (!$auth->acl_get('a_'))
|
|||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
|
||||
// Define some vars
|
||||
$pane = (!empty($_GET['pane'])) ? htmlspecialchars($_GET['pane']) : '';
|
||||
|
||||
$pane = request_var('pane', '');
|
||||
|
||||
// Generate relevant output
|
||||
if ($pane == 'top')
|
||||
|
@ -56,14 +54,13 @@ else if ($pane == 'left')
|
|||
$dir = @opendir('.');
|
||||
|
||||
$setmodules = 1;
|
||||
while ($file = @readdir($dir))
|
||||
while ($file = readdir($dir))
|
||||
{
|
||||
if (preg_match('#^admin_(.*?)\.' . $phpEx . '$#', $file))
|
||||
{
|
||||
include($file);
|
||||
}
|
||||
}
|
||||
|
||||
@closedir($dir);
|
||||
|
||||
unset($setmodules);
|
||||
|
@ -104,7 +101,7 @@ else if ($pane == 'left')
|
|||
{
|
||||
if (!empty($file))
|
||||
{
|
||||
$action = (!empty($user->lang[$action])) ? $user->lang[$action] : preg_replace('/_/', ' ', $action);
|
||||
$action = (!empty($user->lang[$action])) ? $user->lang[$action] : preg_replace('#_#', ' ', $action);
|
||||
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
?>
|
||||
|
@ -132,20 +129,21 @@ else if ($pane == 'left')
|
|||
}
|
||||
elseif ($pane == 'right')
|
||||
{
|
||||
$activate = (isset($_POST['activate'])) ? true : false;
|
||||
$delete = (isset($_POST['delete'])) ? true : false;
|
||||
$remind = (isset($_POST['remind'])) ? true : false;
|
||||
|
||||
$action = request_var('action', '');
|
||||
$mark = implode(', ', request_var('mark', 0));
|
||||
|
||||
if (($activate || $delete) && $mark)
|
||||
if ($mark)
|
||||
{
|
||||
switch ($action)
|
||||
{
|
||||
case 'activate':
|
||||
case 'delete':
|
||||
if (!$auth->acl_get('a_user'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
$sql = ($activate) ? 'UPDATE ' . USERS_TABLE . ' SET user_type = ' . USER_NORMAL . " WHERE user_id IN ($mark)" : 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)";
|
||||
$sql = ($action == 'activate') ? 'UPDATE ' . USERS_TABLE . ' SET user_type = ' . USER_NORMAL . " WHERE user_id IN ($mark)" : 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)";
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (!$delete)
|
||||
|
@ -155,9 +153,9 @@ elseif ($pane == 'right')
|
|||
|
||||
$log_action = ($activate) ? 'log_index_activate' : 'log_index_delete';
|
||||
add_log('admin', $log_action, $db->affected_rows());
|
||||
}
|
||||
else if ($remind && $mark)
|
||||
{
|
||||
break;
|
||||
|
||||
case 'remind':
|
||||
if (!$auth->acl_get('a_user'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
|
@ -214,9 +212,13 @@ elseif ($pane == 'right')
|
|||
unset($usernames);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
break;
|
||||
}
|
||||
else if (isset($_POST['online']))
|
||||
}
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
case 'online':
|
||||
if (!$auth->acl_get('a_defaults'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
|
@ -225,9 +227,9 @@ elseif ($pane == 'right')
|
|||
set_config('record_online_users', 1);
|
||||
set_config('record_online_date', time());
|
||||
add_log('admin', 'LOG_RESET_ONLINE');
|
||||
}
|
||||
else if (isset($_POST['stats']))
|
||||
{
|
||||
break;
|
||||
|
||||
case 'stats':
|
||||
if (!$auth->acl_get('a_defaults'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
|
@ -261,9 +263,9 @@ elseif ($pane == 'right')
|
|||
set_config('num_users', $row['stat']);
|
||||
|
||||
add_log('admin', 'LOG_RESYNC_STATS');
|
||||
}
|
||||
else if (isset($_POST['date']))
|
||||
{
|
||||
break;
|
||||
|
||||
case 'date':
|
||||
if (!$auth->acl_get('a_defaults'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
|
@ -271,6 +273,7 @@ elseif ($pane == 'right')
|
|||
|
||||
set_config('board_startdate', time() - 1);
|
||||
add_log('admin', 'LOG_RESET_DATE');
|
||||
break;
|
||||
}
|
||||
|
||||
// Get forum statistics
|
||||
|
@ -290,11 +293,11 @@ elseif ($pane == 'right')
|
|||
|
||||
if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path']))
|
||||
{
|
||||
while ($file = @readdir($avatar_dir))
|
||||
while ($file = readdir($avatar_dir))
|
||||
{
|
||||
if ($file != '.' && $file != '..')
|
||||
if ($file{0} != '.')
|
||||
{
|
||||
$avatar_dir_size += @filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
|
||||
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
|
||||
}
|
||||
}
|
||||
@closedir($avatar_dir);
|
||||
|
@ -319,7 +322,7 @@ elseif ($pane == 'right')
|
|||
else
|
||||
{
|
||||
// Couldn't open Avatar dir.
|
||||
$avatar_dir_size = $user->lang['Not_available'];
|
||||
$avatar_dir_size = $user->lang['NOT_AVAILABLE'];
|
||||
}
|
||||
|
||||
if ($posts_per_day > $total_posts)
|
||||
|
@ -463,7 +466,7 @@ elseif ($pane == 'right')
|
|||
<td class="row2"><b><?php echo ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF']; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="4" align="right"><input class="btnlite" type="submit" name="online" value="<?php echo $user->lang['RESET_ONLINE']; ?>" /> <input class="btnlite" type="submit" name="date" value="<?php echo $user->lang['RESET_DATE']; ?>" /> <input class="btnlite" type="submit" name="stats" value="<?php echo $user->lang['RESYNC_STATS']; ?>" /> </td>
|
||||
<td class="cat" colspan="4" align="right"><select name="action"><option value="online"><?php echo $user->lang['RESET_ONLINE']; ?></option><option value="date"><?php echo $user->lang['RESET_DATE']; ?></option><option value="stats"><?php echo $user->lang['RESYNC_STATS']; ?></option></select> <input class="btnlite" type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" /> </td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
|
@ -540,16 +543,16 @@ elseif ($pane == 'right')
|
|||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="3" height="28" align="right"><input class="btnlite" type="submit" name="activate" value="<?php echo $user->lang['ACTIVATE']; ?>" /> <?php
|
||||
<td class="cat" colspan="3" height="28" align="right"><select name="action"><option value="activate"><?php echo $user->lang['ACTIVATE']; ?></option><?php
|
||||
|
||||
if (!empty($config['email_enable']))
|
||||
{
|
||||
|
||||
?><input class="btnlite" type="submit" name="remind" value="<?php echo $user->lang['REMIND']; ?>" /> <?php
|
||||
?><option value="remind"><?php echo $user->lang['REMIND']; ?></option><?php
|
||||
|
||||
}
|
||||
|
||||
?><input class="btnlite" type="submit" name="delete" value="<?php echo $user->lang['DELETE']; ?>" /> </td>
|
||||
?><option value="delete"><?php echo $user->lang['DELETE']; ?></option> <input class="btnlite" type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" /> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue