Zeile 107 | Zeile 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");
| { $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) {
| } elseif($reason['rid'] == 1) {
|
Zeile 186 | Zeile 186 |
---|
// Log admin action log_admin_action($reason['rid'], $mybb->input['title']);
|
// Log admin action log_admin_action($reason['rid'], $mybb->input['title']);
|
|
|
flash_message($lang->success_reason_updated, 'success'); admin_redirect("index.php?module=config-report_reasons"); } }
|
flash_message($lang->success_reason_updated, 'success'); admin_redirect("index.php?module=config-report_reasons"); } }
|
|
|
$page->add_breadcrumb_item($lang->edit_reason); $page->output_header($lang->report_reasons." - ".$lang->edit_reason);
|
$page->add_breadcrumb_item($lang->edit_reason); $page->output_header($lang->report_reasons." - ".$lang->edit_reason);
|
|
|
$sub_tabs['edit_reason'] = array( 'title' => $lang->edit_reason, 'link' => "index.php?module=config-report_reasons&action=edit&rid={$reason['rid']}",
| $sub_tabs['edit_reason'] = array( 'title' => $lang->edit_reason, 'link' => "index.php?module=config-report_reasons&action=edit&rid={$reason['rid']}",
|
Zeile 206 | Zeile 206 |
---|
$form = new Form("index.php?module=config-report_reasons&action=edit&rid={$reason['rid']}", "post", "add");
if($errors)
|
$form = new Form("index.php?module=config-report_reasons&action=edit&rid={$reason['rid']}", "post", "add");
if($errors)
|
{
| {
|
$page->output_inline_error($errors); } else
| $page->output_inline_error($errors); } else
|
Zeile 219 | Zeile 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();
|
Zeile 235 | Zeile 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 243 | Zeile 243 |
---|
$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 269 | Zeile 269 |
---|
$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 364 | Zeile 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 384 | Zeile 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 427 | Zeile 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;
|