Vergleich admin/modules/config/report_reasons.php - 1.8.8 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 107Zeile 107
	}

$form_container = new FormContainer($lang->add_new_reason);

	}

$form_container = new FormContainer($lang->add_new_reason);

	$form_container->output_row($lang->reason_title." <em>*</em>", $lang->reason_title_desc, $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->applies_to." <em>*</em>", $lang->applies_to_desc, generate_content_select());

	$form_container->output_row($lang->reason_title." <em>*</em>", $lang->reason_title_desc, $form->generate_text_box('title', $mybb->get_input('title'), array('id' => 'title')), 'title');
$form_container->output_row($lang->applies_to." <em>*</em>", '', generate_content_select());

	$form_container->output_row($lang->requires_extra." <em>*</em>", $lang->requires_extra_desc, $form->generate_yes_no_radio('extra', $mybb->input['extra']));
$form_container->end();

	$form_container->output_row($lang->requires_extra." <em>*</em>", $lang->requires_extra_desc, $form->generate_yes_no_radio('extra', $mybb->input['extra']));
$form_container->end();





	$buttons[] = $form->generate_submit_button($lang->save_reason);

	$buttons[] = $form->generate_submit_button($lang->save_reason);





	$form->output_submit_wrapper($buttons);
$form->end();

	$form->output_submit_wrapper($buttons);
$form->end();





	$page->output_footer();
}

	$page->output_footer();
}





if($mybb->input['action'] == "edit")

if($mybb->input['action'] == "edit")

{
$query = $db->simple_select("reportreasons", "*", "rid='".$mybb->get_input('rid', MyBB::INPUT_INT)."'");
$reason = $db->fetch_array($query);

if(!$reason['rid'])
{
flash_message($lang->error_invalid_reason, 'error');
admin_redirect("index.php?module=config-report_reasons");
}
elseif($reason['rid'] == 1)
{

{
$query = $db->simple_select("reportreasons", "*", "rid='".$mybb->get_input('rid', MyBB::INPUT_INT)."'");
$reason = $db->fetch_array($query);

if(!$reason)
{
flash_message($lang->error_invalid_reason, 'error');
admin_redirect("index.php?module=config-report_reasons");
}
elseif($reason['rid'] == 1)
{

		flash_message($lang->error_cannot_modify_reason, 'error');
admin_redirect("index.php?module=config-report_reasons");
}

		flash_message($lang->error_cannot_modify_reason, 'error');
admin_redirect("index.php?module=config-report_reasons");
}

Zeile 177Zeile 177
				"appliesto" => $db->escape_string($appliesto),
"extra" => $mybb->input['extra']
);

				"appliesto" => $db->escape_string($appliesto),
"extra" => $mybb->input['extra']
);





			$plugins->run_hooks("admin_config_report_reasons_edit_commit");

$db->update_query("reportreasons", $updated_reason, "rid='{$reason['rid']}'");

			$plugins->run_hooks("admin_config_report_reasons_edit_commit");

$db->update_query("reportreasons", $updated_reason, "rid='{$reason['rid']}'");

Zeile 219Zeile 219
		}
}


		}
}


	$form_container = new FormContainer($lang->add_new_reason);

	$form_container = new FormContainer($lang->edit_reason);

	$form_container->output_row($lang->reason_title." <em>*</em>", $lang->reason_title_desc, $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');

	$form_container->output_row($lang->reason_title." <em>*</em>", $lang->reason_title_desc, $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');

	$form_container->output_row($lang->applies_to." <em>*</em>", $lang->applies_to_desc, generate_content_select());

	$form_container->output_row($lang->applies_to." <em>*</em>", '', generate_content_select());

	$form_container->output_row($lang->requires_extra." <em>*</em>", $lang->requires_extra_desc, $form->generate_yes_no_radio('extra', $mybb->input['extra']));
$form_container->end();

	$form_container->output_row($lang->requires_extra." <em>*</em>", $lang->requires_extra_desc, $form->generate_yes_no_radio('extra', $mybb->input['extra']));
$form_container->end();





	$buttons[] = $form->generate_submit_button($lang->save_reason);

$form->output_submit_wrapper($buttons);

	$buttons[] = $form->generate_submit_button($lang->save_reason);

$form->output_submit_wrapper($buttons);

Zeile 235Zeile 235

if($mybb->input['action'] == "delete")
{


if($mybb->input['action'] == "delete")
{

	if($mybb->input['no'])
{
admin_redirect("index.php?module=config-report_reasons");

	if($mybb->get_input('no'))
{
admin_redirect("index.php?module=config-report_reasons");

	}

$query = $db->simple_select("reportreasons", "*", "rid='".$mybb->get_input('rid', MyBB::INPUT_INT)."'");
$reason = $db->fetch_array($query);


	}

$query = $db->simple_select("reportreasons", "*", "rid='".$mybb->get_input('rid', MyBB::INPUT_INT)."'");
$reason = $db->fetch_array($query);


	if(!$reason['rid'])

	if(!$reason)

	{
flash_message($lang->error_invalid_reason, 'error');
admin_redirect("index.php?module=config-report_reasons");
}
elseif($reason['rid'] == 1)

	{
flash_message($lang->error_invalid_reason, 'error');
admin_redirect("index.php?module=config-report_reasons");
}
elseif($reason['rid'] == 1)

	{

	{

		flash_message($lang->error_cannot_delete_reason, 'error');
admin_redirect("index.php?module=config-report_reasons");
}

		flash_message($lang->error_cannot_delete_reason, 'error');
admin_redirect("index.php?module=config-report_reasons");
}

Zeile 258Zeile 258

if($mybb->request_method == "post")
{


if($mybb->request_method == "post")
{





		// Change the reason of associated reports to Other and carry over the title
$updated_report = array(
'reasonid' => 1,
'reason' => $db->escape_string($reason['title'])
);

		// Change the reason of associated reports to Other and carry over the title
$updated_report = array(
'reasonid' => 1,
'reason' => $db->escape_string($reason['title'])
);

		$db->update_query("reports", $updated_report, "reasonid='{$reason['rid']}'");

		$db->update_query("reportedcontent", $updated_report, "reasonid='{$reason['rid']}'");


$db->delete_query("reportreasons", "rid='{$reason['rid']}'");

$plugins->run_hooks("admin_config_report_reasons_delete_commit");


$db->delete_query("reportreasons", "rid='{$reason['rid']}'");

$plugins->run_hooks("admin_config_report_reasons_delete_commit");

 

$cache->update_reportreasons();


// Log admin action
log_admin_action($reason['rid'], $reason['title']);


// Log admin action
log_admin_action($reason['rid'], $reason['title']);

Zeile 278Zeile 280
	}
else
{

	}
else
{

		$page->output_confirm_action("index.php?module=config-report_reasons&amp;action=delete&amp;qid={$question['qid']}", $lang->confirm_reason_deletion);

		$page->output_confirm_action("index.php?module=config-report_reasons&amp;action=delete&amp;rid={$reason['rid']}", $lang->confirm_reason_deletion);

	}
}


	}
}


Zeile 297Zeile 299

$plugins->run_hooks("admin_config_report_reasons_start_commit");



$plugins->run_hooks("admin_config_report_reasons_start_commit");


			//$cache->update_reportreasons();

			$cache->update_reportreasons();


flash_message($lang->success_reasons_disporder_updated, 'success');
admin_redirect("index.php?module=config-report_reasons");


flash_message($lang->success_reasons_disporder_updated, 'success');
admin_redirect("index.php?module=config-report_reasons");

Zeile 364Zeile 366

if($form_container->num_rows() == 0)
{


if($form_container->num_rows() == 0)
{

		$form_container->construct_cell($lang->no_report_reasons, array('colspan' => 5));

		$form_container->output_cell($lang->no_report_reasons, array('colspan' => 5));

		$form_container->construct_row();
}


		$form_container->construct_row();
}


Zeile 384Zeile 386
	global $mybb, $lang;

$checked = array('all' => '', 'custom' => '', 'none' => '');

	global $mybb, $lang;

$checked = array('all' => '', 'custom' => '', 'none' => '');

	if($mybb->input['appliesto'] == 'all')

	if($mybb->get_input('appliesto') == 'all')

	{
$checked['all'] = 'checked="checked"';
}

	{
$checked['all'] = 'checked="checked"';
}

	elseif($mybb->input['appliesto'] == '')

	elseif($mybb->get_input('appliesto') == '')

	{
$checked['none'] = 'checked="checked"';
}

	{
$checked['none'] = 'checked="checked"';
}

Zeile 427Zeile 429
	foreach($content_types as $content)
{
$key = "report_content_{$content}";

	foreach($content_types as $content)
{
$key = "report_content_{$content}";

		$content_choices[] = $form->generate_check_box("appliesto_{$content}", 1, $lang->$key, array('id' => "appliesto_{$content}", 'checked' => $mybb->input["appliesto_{$content}"]));

		$content_choices[] = $form->generate_check_box("appliesto_{$content}", 1, $lang->$key, array('id' => "appliesto_{$content}", 'checked' => $mybb->get_input("appliesto_{$content}")));

	}

return $content_choices;

	}

return $content_choices;