Zeile 590 | Zeile 590 |
---|
<script src=\"jscripts/tabs.js\" type=\"text/javascript\"></script>\n <script type=\"text/javascript\"> <!--
|
<script src=\"jscripts/tabs.js\" type=\"text/javascript\"></script>\n <script type=\"text/javascript\"> <!--
|
$(document).ready(function() {
| $(function() {
|
$(\"#modal_form\").on(\"click\", \"#savePermissions\", function(e) { e.preventDefault();
| $(\"#modal_form\").on(\"click\", \"#savePermissions\", function(e) { e.preventDefault();
|
Zeile 719 | Zeile 719 |
---|
'candeleteposts' => 'editing', 'candeletethreads' => 'editing', 'caneditattachments' => 'editing',
|
'candeleteposts' => 'editing', 'candeletethreads' => 'editing', 'caneditattachments' => 'editing',
|
| 'canviewdeletionnotice' => 'editing',
|
'modposts' => 'moderate', 'modthreads' => 'moderate',
| 'modposts' => 'moderate', 'modthreads' => 'moderate',
|
Zeile 1950 | Zeile 1951 |
---|
$fid = $mybb->get_input('fid', MyBB::INPUT_INT); $forum_info = get_forum($fid);
|
$fid = $mybb->get_input('fid', MyBB::INPUT_INT); $forum_info = get_forum($fid);
|
$query = $db->simple_select("forums", "posts,unapprovedposts,threads,unapprovedthreads", "fid='{$fid}'"); $stats = $db->fetch_array($query);
// Delete the forum $db->delete_query("forums", "fid='$fid'");
switch($db->type) { case "pgsql": case "sqlite":
| $delquery = ""; switch($db->type) { case "pgsql": case "sqlite":
|
$query = $db->simple_select("forums", "*", "','|| parentlist|| ',' LIKE '%,$fid,%'"); break; default:
| $query = $db->simple_select("forums", "*", "','|| parentlist|| ',' LIKE '%,$fid,%'"); break; default:
|
Zeile 1969 | Zeile 1965 |
---|
{ $fids[$forum['fid']] = $fid; $delquery .= " OR fid='{$forum['fid']}'";
|
{ $fids[$forum['fid']] = $fid; $delquery .= " OR fid='{$forum['fid']}'";
|
$stats['posts'] += $forum['posts']; $stats['unapprovedposts'] += $forum['unapprovedposts']; $stats['threads'] += $forum['threads']; $stats['unapprovedthreads'] += $forum['unapprovedthreads'];
| |
}
|
}
|
| require_once MYBB_ROOT.'inc/class_moderation.php'; $moderation = new Moderation();
// Start pagination. Limit results to 50 $query = $db->simple_select("threads", "tid", "fid='{$fid}' {$delquery}", array("limit" => 50));
while($tid = $db->fetch_field($query, 'tid')) { $moderation->delete_thread($tid); }
// Check whether all threads have been deleted $query = $db->simple_select("threads", "tid", "fid='{$fid}' {$delquery}");
if($db->num_rows($query) > 0) { $page->output_header();
$form = new Form("index.php?module=forum-management", 'post');
echo $form->generate_hidden_field("fid", $fid); echo $form->generate_hidden_field("action", "delete"); echo "<div class=\"confirm_action\">\n"; echo "<p>{$lang->confirm_proceed_deletion}</p>\n"; echo "<br />\n"; echo "<script type=\"text/javascript\">$(function() { var button = $(\"#proceed_button\"); if(button.length > 0) { button.val(\"{$lang->automatically_redirecting}\"); button.attr(\"disabled\", true); button.css(\"color\", \"#aaa\"); button.css(\"borderColor\", \"#aaa\"); document.forms[0].submit(); }})</script>"; echo "<p class=\"buttons\">\n"; echo $form->generate_submit_button($lang->proceed, array('class' => 'button_yes', 'id' => 'proceed_button')); echo "</p>\n"; echo "</div>\n";
$form->end();
$page->output_footer(); exit; }
// End pagination
// Delete the forum $db->delete_query("forums", "fid='$fid'");
// Delete subforums
|
switch($db->type) { case "pgsql":
| switch($db->type) { case "pgsql":
|
Zeile 1986 | Zeile 2020 |
---|
$db->delete_query("forums", "CONCAT(',',parentlist,',') LIKE '%,$fid,%'"); }
|
$db->delete_query("forums", "CONCAT(',',parentlist,',') LIKE '%,$fid,%'"); }
|
$db->delete_query("threads", "fid='{$fid}' {$delquery}"); $db->delete_query("posts", "fid='{$fid}' {$delquery}"); $db->delete_query("moderators", "fid='{$fid}' {$delquery}"); $db->delete_query("forumsubscriptions", "fid='{$fid}' {$delquery}"); $db->delete_query("forumpermissions", "fid='{$fid}' {$delquery}");
$update_stats = array( 'numthreads' => "-".$stats['threads'], 'numunapprovedthreads' => "-".$stats['unapprovedthreads'], 'numposts' => "-".$stats['posts'], 'numunapprovedposts' => "-".$stats['unapprovedposts'] ); update_stats($update_stats);
| $db->delete_query('moderators', "fid='{$fid}' {$delquery}"); $db->delete_query('forumsubscriptions', "fid='{$fid}' {$delquery}"); $db->delete_query('forumpermissions', "fid='{$fid}' {$delquery}"); $db->delete_query('announcements', "fid='{$fid}' {$delquery}"); $db->delete_query('forumsread', "fid='{$fid}' {$delquery}");
|
$plugins->run_hooks("admin_forum_management_delete_commit");
$cache->update_forums(); $cache->update_moderators(); $cache->update_forumpermissions();
|
$plugins->run_hooks("admin_forum_management_delete_commit");
$cache->update_forums(); $cache->update_moderators(); $cache->update_forumpermissions();
|
| $cache->update_forumsdisplay();
|
// Log admin action log_admin_action($forum_info['fid'], $forum_info['name']);
| // Log admin action log_admin_action($forum_info['fid'], $forum_info['name']);
|
Zeile 2269 | Zeile 2296 |
---|
$form_container->output_row_header($lang->order, array("class" => "align_center", 'width' => '5%')); $form_container->output_row_header($lang->controls, array("class" => "align_center", 'style' => 'width: 200px'));
|
$form_container->output_row_header($lang->order, array("class" => "align_center", 'width' => '5%')); $form_container->output_row_header($lang->controls, array("class" => "align_center", 'style' => 'width: 200px'));
|
build_admincp_forums_list($form_container, $fid);
| build_admincp_forums_list($form_container, $fid);
|
$submit_options = array();
|
$submit_options = array();
|
|
|
if($form_container->num_rows() == 0) { $form_container->output_cell($lang->no_forums, array('colspan' => 3)); $form_container->construct_row(); $submit_options = array('disabled' => true);
|
if($form_container->num_rows() == 0) { $form_container->output_cell($lang->no_forums, array('colspan' => 3)); $form_container->construct_row(); $submit_options = array('disabled' => true);
|
}
| }
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->update_forum_orders, $submit_options);
| $form_container->end();
$buttons[] = $form->generate_submit_button($lang->update_forum_orders, $submit_options);
|
Zeile 2301 | Zeile 2328 |
---|
while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
|
while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
|
}
| }
|
$query = $db->simple_select("forumpermissions", "*", "fid='{$fid}'"); while($existing = $db->fetch_array($query))
| $query = $db->simple_select("forumpermissions", "*", "fid='{$fid}'"); while($existing = $db->fetch_array($query))
|
Zeile 2358 | Zeile 2385 |
---|
{ $perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']]; $default_checked = true;
|
{ $perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']]; $default_checked = true;
|
} }
if(!$perms) { $perms = $usergroup; $default_checked = true; } } else {
| } }
if(!$perms) { $perms = $usergroup; $default_checked = true; } } else {
|
if(isset($existing_permissions) && is_array($existing_permissions) && $existing_permissions[$usergroup['gid']]) { $perms = $existing_permissions[$usergroup['gid']];
| if(isset($existing_permissions) && is_array($existing_permissions) && $existing_permissions[$usergroup['gid']]) { $perms = $existing_permissions[$usergroup['gid']];
|
Zeile 2405 | Zeile 2432 |
---|
} } else
|
} } else
|
{ if($perms[$forum_permission] == 1)
| { if($perms[$forum_permission] == 1)
|
{ $perms_checked[$forum_permission] = 1; }
| { $perms_checked[$forum_permission] = 1; }
|
Zeile 2431 | Zeile 2458 |
---|
$field_select = "<div class=\"quick_perm_fields\">\n"; $field_select .= "<div class=\"enabled\"><ul id=\"fields_enabled_{$usergroup['gid']}\">\n";
|
$field_select = "<div class=\"quick_perm_fields\">\n"; $field_select .= "<div class=\"enabled\"><ul id=\"fields_enabled_{$usergroup['gid']}\">\n";
|
foreach($perms_checked as $perm => $value)
| foreach($perms_checked as $perm => $value)
|
{ if($value == 1) {
| { if($value == 1) {
|
Zeile 2443 | Zeile 2470 |
---|
foreach($perms_checked as $perm => $value) { if($value == 0)
|
foreach($perms_checked as $perm => $value) { if($value == 0)
|
{
| {
|
$field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>"; } }
| $field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>"; } }
|
Zeile 2467 | Zeile 2494 |
---|
if($perms_checked[$forum_permission]) { $field_selected[] = $forum_permission;
|
if($perms_checked[$forum_permission]) { $field_selected[] = $forum_permission;
|
} }
| } }
|
$field_select .= "<noscript>".$form->generate_select_box('fields_'.$usergroup['gid'].'[]', $field_options, $field_selected, array('id' => 'fields_'.$usergroup['gid'].'[]', 'multiple' => true))."</noscript>\n"; $form_container->output_cell($field_select, array('colspan' => 2));
| $field_select .= "<noscript>".$form->generate_select_box('fields_'.$usergroup['gid'].'[]', $field_options, $field_selected, array('id' => 'fields_'.$usergroup['gid'].'[]', 'multiple' => true))."</noscript>\n"; $form_container->output_cell($field_select, array('colspan' => 2));
|
Zeile 2582 | Zeile 2609 |
---|
echo $form->generate_hidden_field("fid", $mybb->input['fid']); echo $form->generate_hidden_field("add", "moderators"); $form_container = new FormContainer($lang->add_user_as_moderator);
|
echo $form->generate_hidden_field("fid", $mybb->input['fid']); echo $form->generate_hidden_field("add", "moderators"); $form_container = new FormContainer($lang->add_user_as_moderator);
|
$form_container->output_row($lang->username." <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');
| $form_container->output_row($lang->username." <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', htmlspecialchars_uni($mybb->get_input('username')), array('id' => 'username')), 'username');
|
$form_container->end();
// Autocompletion for usernames
| $form_container->end();
// Autocompletion for usernames
|
Zeile 2593 | Zeile 2620 |
---|
<!-- $("#username").select2({ placeholder: "'.$lang->search_for_a_user.'",
|
<!-- $("#username").select2({ placeholder: "'.$lang->search_for_a_user.'",
|
minimumInputLength: 3, maximumSelectionSize: 3,
| minimumInputLength: 2,
|
multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users",
| multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users",
|
Zeile 2642 | Zeile 2668 |
---|
}
/**
|
}
/**
|
*
| * @param DefaultFormContainer $form_container * @param int $pid * @param int $depth
|
*/ function build_admincp_forums_list(&$form_container, $pid=0, $depth=1) {
| */ function build_admincp_forums_list(&$form_container, $pid=0, $depth=1) {
|
Zeile 2773 | Zeile 2801 |
---|
} }
|
} }
|
| /** * @param int $gid * @param int $fid * * @return string */
|
function retrieve_single_permissions_row($gid, $fid) { global $mybb, $lang, $cache, $db;
| function retrieve_single_permissions_row($gid, $fid) { global $mybb, $lang, $cache, $db;
|