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

  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['rid'])
{
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 139Zeile 139
	cast_content_inputs();

$plugins->run_hooks("admin_config_report_reasons_edit");

	cast_content_inputs();

$plugins->run_hooks("admin_config_report_reasons_edit");





	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;

	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_title;

		}

		}


if($mybb->input['extra'] != 0 && $mybb->input['extra'] != 1)
{


if($mybb->input['extra'] != 0 && $mybb->input['extra'] != 1)
{

Zeile 153Zeile 153
		}

if(!$errors)

		}

if(!$errors)

		{

		{

			if($mybb->input['appliesto'] != 'all')
{
$appliesto = array();

			if($mybb->input['appliesto'] != 'all')
{
$appliesto = array();

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'])

	if($mybb->get_input('no'))

	{
admin_redirect("index.php?module=config-report_reasons");
}

	{
admin_redirect("index.php?module=config-report_reasons");
}

Zeile 264Zeile 264
			'reasonid' => 1,
'reason' => $db->escape_string($reason['title'])
);

			'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']);





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

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

	}

	}

	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);

	}
}

if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_config_report_reasons_start");

	}
}

if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_config_report_reasons_start");





	if($mybb->request_method == "post")
{
if(!empty($mybb->input['disporder']))

	if($mybb->request_method == "post")
{
if(!empty($mybb->input['disporder']))

Zeile 294Zeile 296
			{
$db->update_query("reportreasons", array('disporder' => (int)$order), "rid='".(int)$rid."'");
}

			{
$db->update_query("reportreasons", array('disporder' => (int)$order), "rid='".(int)$rid."'");
}





			$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;