Zeile 110 | Zeile 110 |
---|
echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
$form_container = new FormContainer($lang->add_new_section);
|
echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
$form_container = new FormContainer($lang->add_new_section);
|
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder'); $form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio('enabled', $mybb->input['enabled']));
| $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->get_input('name'), array('id' => 'name')), 'name'); $form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->get_input('description'), array('id' => 'description')), 'description'); $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $mybb->get_input('disporder'), array('id' => 'disporder', 'min' => 0)), 'disporder'); $form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio('enabled', $mybb->get_input('enabled')));
|
$form_container->end();
|
$form_container->end();
|
|
|
$buttons[] = $form->generate_submit_button($lang->save_section);
$form->output_submit_wrapper($buttons); $form->end(); }
|
$buttons[] = $form->generate_submit_button($lang->save_section);
$form->output_submit_wrapper($buttons); $form->end(); }
|
|
|
// Add page else {
| // Add page else {
|
Zeile 133 | Zeile 133 |
---|
if(empty($mybb->input['sid'])) { $errors[] = $lang->error_missing_sid;
|
if(empty($mybb->input['sid'])) { $errors[] = $lang->error_missing_sid;
|
}
if(empty($mybb->input['name'])) { $errors[] = $lang->error_document_missing_name; }
if(empty($mybb->input['description'])) { $errors[] = $lang->error_document_missing_description; }
if(empty($mybb->input['document'])) { $errors[] = $lang->error_document_missing_document; }
if(!isset($mybb->input['enabled'])) { $errors[] = $lang->error_document_missing_enabled; }
| }
if(empty($mybb->input['name'])) { $errors[] = $lang->error_document_missing_name; }
if(empty($mybb->input['description'])) { $errors[] = $lang->error_document_missing_description; }
if(empty($mybb->input['document'])) { $errors[] = $lang->error_document_missing_document; }
if(!isset($mybb->input['enabled'])) { $errors[] = $lang->error_document_missing_enabled; }
|
if($mybb->input['enabled'] != 1) {
| if($mybb->input['enabled'] != 1) {
|
Zeile 229 | Zeile 229 |
---|
{ $sections[$section['sid']] = $section['name']; }
|
{ $sections[$section['sid']] = $section['name']; }
|
$form_container->output_row($lang->section." <em>*</em>", "", $form->generate_select_box("sid", $sections, $mybb->input['sid'], array('id' => 'sid')), 'sid'); $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->document." <em>*</em>", "", $form->generate_text_area('document', $mybb->input['document'], array('id' => 'document')), 'document'); $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder'); $form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio('enabled', $mybb->input['enabled']));
| $form_container->output_row($lang->section." <em>*</em>", "", $form->generate_select_box("sid", $sections, $mybb->get_input('sid'), array('id' => 'sid')), 'sid'); $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->get_input('name'), array('id' => 'name')), 'name'); $form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->get_input('description'), array('id' => 'description')), 'description'); $form_container->output_row($lang->document." <em>*</em>", "", $form->generate_text_area('document', $mybb->get_input('document'), array('id' => 'document')), 'document'); $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $mybb->get_input('disporder'), array('id' => 'disporder', 'min' => 0)), 'disporder'); $form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio('enabled', $mybb->get_input('enabled')));
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->save_document);
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->save_document);
|
$form->output_submit_wrapper($buttons);
| $form->output_submit_wrapper($buttons);
|
$form->end(); }
|
$form->end(); }
|
|
|
$page->output_footer(); }
| $page->output_footer(); }
|
Zeile 250 | Zeile 250 |
---|
if($mybb->input['action'] == "edit") { $plugins->run_hooks("admin_config_help_documents_edit");
|
if($mybb->input['action'] == "edit") { $plugins->run_hooks("admin_config_help_documents_edit");
|
|
|
// Edit a section
|
// Edit a section
|
if($mybb->input['sid'] && !$mybb->input['hid'])
| if(isset($mybb->input['sid']) && !$mybb->get_input('hid'))
|
{ $query = $db->simple_select("helpsections", "*", "sid = '".$mybb->get_input('sid', MyBB::INPUT_INT)."'"); $section = $db->fetch_array($query);
|
{ $query = $db->simple_select("helpsections", "*", "sid = '".$mybb->get_input('sid', MyBB::INPUT_INT)."'"); $section = $db->fetch_array($query);
|
| if(!$section) { flash_message($lang->error_missing_section_id, 'error'); admin_redirect("index.php?module=config-help_documents"); }
|
$plugins->run_hooks("admin_config_help_documents_edit_section");
| $plugins->run_hooks("admin_config_help_documents_edit_section");
|
Zeile 317 | Zeile 323 |
---|
$sub_tabs['edit_help_section'] = array( 'title' => $lang->edit_section,
|
$sub_tabs['edit_help_section'] = array( 'title' => $lang->edit_section,
|
'link' => "index.php?module=config-help_documents&action=edit&sid=".$mybb->get_input('sid', MyBB::INPUT_INT),
| 'link' => "index.php?module=config-help_documents&action=edit&sid=".$section['sid'],
|
'description' => $lang->edit_section_desc );
| 'description' => $lang->edit_section_desc );
|
Zeile 339 | Zeile 345 |
---|
$form = new Form("index.php?module=config-help_documents&action=edit", "post", "edit");
|
$form = new Form("index.php?module=config-help_documents&action=edit", "post", "edit");
|
echo $form->generate_hidden_field("sid", $mybb->input['sid']);
| echo $form->generate_hidden_field("sid", $section['sid']);
|
echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
|
echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
|
$form_container = new FormContainer($lang->edit_section." ({$lang->id} ".$mybb->get_input('sid', MyBB::INPUT_INT).")");
| $form_container = new FormContainer($lang->edit_section." ({$lang->id} ".$section['sid'].")");
|
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder');
| $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder');
|
Zeile 358 | Zeile 364 |
---|
// Edit document else {
|
// Edit document else {
|
| $query = $db->simple_select("helpdocs", "*", "hid = '".$mybb->get_input('hid', MyBB::INPUT_INT)."'"); $doc = $db->fetch_array($query);
// Invalid document? if(!$doc) { flash_message($lang->error_missing_hid, 'error'); admin_redirect("index.php?module=config-help_documents"); }
|
$plugins->run_hooks("admin_config_help_documents_edit_page");
|
$plugins->run_hooks("admin_config_help_documents_edit_page");
|
|
|
// Do edit?
|
// Do edit?
|
| $hid = $mybb->get_input('hid', MyBB::INPUT_INT);
|
if($mybb->request_method == "post") {
|
if($mybb->request_method == "post") {
|
$hid = $mybb->get_input('hid', MyBB::INPUT_INT);
| |
if(empty($hid)) { $errors[] = $lang->error_invalid_sid;
| if(empty($hid)) { $errors[] = $lang->error_invalid_sid;
|
Zeile 425 | Zeile 441 |
---|
$sub_tabs['edit_help_document'] = array( 'title' => $lang->edit_document,
|
$sub_tabs['edit_help_document'] = array( 'title' => $lang->edit_document,
|
'link' => "index.php?module=config-help_documents&action=edit&hid=".$mybb->get_input('hid', MyBB::INPUT_INT),
| 'link' => "index.php?module=config-help_documents&action=edit&hid=".$doc['hid'],
|
'description' => $lang->edit_document_desc );
| 'description' => $lang->edit_document_desc );
|
Zeile 437 | Zeile 453 |
---|
} else {
|
} else {
|
$query = $db->simple_select("helpdocs", "*", "hid = '".$mybb->get_input('hid', MyBB::INPUT_INT)."'"); $doc = $db->fetch_array($query);
| |
$mybb->input['hid'] = $doc['hid']; $mybb->input['sid'] = $doc['sid']; $mybb->input['name'] = $doc['name'];
| $mybb->input['hid'] = $doc['hid']; $mybb->input['sid'] = $doc['sid']; $mybb->input['name'] = $doc['name'];
|
Zeile 451 | Zeile 465 |
---|
$form = new Form("index.php?module=config-help_documents&action=edit", "post", "edit");
|
$form = new Form("index.php?module=config-help_documents&action=edit", "post", "edit");
|
echo $form->generate_hidden_field("hid", $mybb->input['hid']);
| echo $form->generate_hidden_field("hid", $doc['hid']);
|
echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
|
echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
|
$form_container = new FormContainer($lang->edit_document." ({$lang->id} ".$mybb->get_input('hid', MyBB::INPUT_INT).")");
| $form_container = new FormContainer($lang->edit_document." ({$lang->id} ".$doc['hid'].")");
|
$sections = array(); $query = $db->simple_select("helpsections", "sid, name");
| $sections = array(); $query = $db->simple_select("helpsections", "sid, name");
|
Zeile 483 | Zeile 497 |
---|
if($mybb->input['action'] == "delete") { // User clicked no
|
if($mybb->input['action'] == "delete") { // User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=config-help_documents"); }
| { admin_redirect("index.php?module=config-help_documents"); }
|
Zeile 502 | Zeile 516 |
---|
$section = $db->fetch_array($query);
// Invalid section?
|
$section = $db->fetch_array($query);
// Invalid section?
|
if(!$section['sid'])
| if(!$section)
|
{ flash_message($lang->error_missing_section_id, 'error'); admin_redirect("index.php?module=config-help_documents"); }
// Delete section and its documents
|
{ flash_message($lang->error_missing_section_id, 'error'); admin_redirect("index.php?module=config-help_documents"); }
// Delete section and its documents
|
$db->delete_query("helpsections", "sid = '{$sid}'", 1); $db->delete_query("helpdocs", "sid = '{$sid}'");
| $db->delete_query("helpsections", "sid = '{$section['sid']}'", 1); $db->delete_query("helpdocs", "sid = '{$section['sid']}'");
|
$plugins->run_hooks("admin_config_help_documents_delete_section_commit");
| $plugins->run_hooks("admin_config_help_documents_delete_section_commit");
|
Zeile 530 | Zeile 544 |
---|
$doc = $db->fetch_array($query);
// Invalid document?
|
$doc = $db->fetch_array($query);
// Invalid document?
|
if(!$doc['hid'])
| if(!$doc)
|
{ flash_message($lang->error_missing_hid, 'error'); admin_redirect("index.php?module=config-help_documents"); }
|
{ flash_message($lang->error_missing_hid, 'error'); admin_redirect("index.php?module=config-help_documents"); }
|
$db->delete_query("helpdocs", "hid = '{$hid}'", 1);
| $db->delete_query("helpdocs", "hid = '{$doc['hid']}'", 1);
|
$plugins->run_hooks("admin_config_help_documents_delete_page_commit");
| $plugins->run_hooks("admin_config_help_documents_delete_page_commit");
|