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].trigger('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 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']]) {
| { if(isset($existing_permissions) && is_array($existing_permissions) && $existing_permissions[$usergroup['gid']]) {
|
Zeile 2380 | Zeile 2407 |
---|
$default_checked = true; } else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum['pid']][$usergroup['gid']])
|
$default_checked = true; } else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum['pid']][$usergroup['gid']])
|
{
| {
|
$perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']]; $default_checked = true; }
| $perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']]; $default_checked = true; }
|
Zeile 2405 | Zeile 2432 |
---|
} } else
|
} } else
|
{
| {
|
if($perms[$forum_permission] == 1) { $perms_checked[$forum_permission] = 1;
| if($perms[$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 2481 | Zeile 2508 |
---|
else { $form_container->output_cell("<a href=\"index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}\" onclick=\"MyBB.popupWindow('index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1', null, true); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2));
|
else { $form_container->output_cell("<a href=\"index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}\" onclick=\"MyBB.popupWindow('index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1', null, true); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2));
|
}
| }
|
$form_container->construct_row(array('id' => 'row_'.$usergroup['gid']));
|
$form_container->construct_row(array('id' => 'row_'.$usergroup['gid']));
|
|
|
$ids[] = $usergroup['gid']; } $form_container->end();
|
$ids[] = $usergroup['gid']; } $form_container->end();
|
|
|
$buttons = array(); $buttons[] = $form->generate_submit_button($lang->update_forum_permissions); $buttons[] = $form->generate_reset_button($lang->reset);
$form->output_submit_wrapper($buttons);
|
$buttons = array(); $buttons[] = $form->generate_submit_button($lang->update_forum_permissions); $buttons[] = $form->generate_reset_button($lang->reset);
$form->output_submit_wrapper($buttons);
|
|
|
// Write in our JS based field selector echo "<script type=\"text/javascript\">\n<!--\n"; foreach($ids as $id)
| // Write in our JS based field selector echo "<script type=\"text/javascript\">\n<!--\n"; foreach($ids as $id)
|
Zeile 2567 | Zeile 2594 |
---|
if(!isset($mybb->input['username'])) { $mybb->input['username'] = '';
|
if(!isset($mybb->input['username'])) { $mybb->input['username'] = '';
|
}
| }
|
$form_container = new FormContainer($lang->add_usergroup_as_moderator); $form_container->output_row($lang->usergroup." <em>*</em>", $lang->moderator_usergroup_desc, $form->generate_select_box('usergroup', $modgroups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); $form_container->end();
| $form_container = new FormContainer($lang->add_usergroup_as_moderator); $form_container->output_row($lang->usergroup." <em>*</em>", $lang->moderator_usergroup_desc, $form->generate_select_box('usergroup', $modgroups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); $form_container->end();
|
Zeile 2577 | Zeile 2604 |
---|
$form->output_submit_wrapper($buttons); $form->end(); echo "<br />";
|
$form->output_submit_wrapper($buttons); $form->end(); echo "<br />";
|
|
|
$form = new Form("index.php?module=forum-management", "post", "management"); 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 = new Form("index.php?module=forum-management", "post", "management"); 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 2622 | Zeile 2648 |
---|
}, });
|
}, });
|
$(\'[for=username]\').click(function(){
| $(\'[for=username]\').on(\'click\', function(){
|
$("#username").select2(\'open\'); return false; });
| $("#username").select2(\'open\'); return false; });
|
Zeile 2634 | Zeile 2660 |
---|
$form->end();
echo "</div>\n";
|
$form->end();
echo "</div>\n";
|
|
|
$plugins->run_hooks("admin_forum_management_start_graph"); }
|
$plugins->run_hooks("admin_forum_management_start_graph"); }
|
|
|
$page->output_footer(); }
/**
|
$page->output_footer(); }
/**
|
*
| * @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;
|