[ Index ]

PHP Cross Reference of MyBB 1.8.21

title

Body

[close]

/admin/modules/config/ -> help_documents.php (source)

   1  <?php
   2  /**
   3   * MyBB 1.8
   4   * Copyright 2014 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://www.mybb.com
   7   * License: http://www.mybb.com/about/license
   8   *
   9   */
  10  
  11  // Disallow direct access to this file for security reasons
  12  if(!defined("IN_MYBB"))
  13  {
  14      die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
  15  }
  16  
  17  $page->add_breadcrumb_item($lang->help_documents, "index.php?module=config-help_documents");
  18  
  19  $plugins->run_hooks("admin_config_help_documents_begin");
  20  
  21  // Add something
  22  if($mybb->input['action'] == "add")
  23  {
  24      $plugins->run_hooks("admin_config_help_documents_add");
  25  
  26      // Add section
  27      if($mybb->input['type'] == "section")
  28      {
  29          $plugins->run_hooks("admin_config_help_documents_add_section");
  30  
  31          // Do add?
  32          if($mybb->request_method == "post")
  33          {
  34              if(empty($mybb->input['name']))
  35              {
  36                  $errors[] = $lang->error_section_missing_name;
  37              }
  38  
  39              if(empty($mybb->input['description']))
  40              {
  41                  $errors[] = $lang->error_section_missing_description;
  42              }
  43  
  44              if(!isset($mybb->input['enabled']))
  45              {
  46                  $errors[] = $lang->error_section_missing_enabled;
  47              }
  48  
  49              if($mybb->input['enabled'] != 1)
  50              {
  51                  $mybb->input['enabled'] = 0;
  52              }
  53  
  54              if(!is_array($errors))
  55              {
  56                  $sql_array = array(
  57                      "name" => $db->escape_string($mybb->input['name']),
  58                      "description" => $db->escape_string($mybb->input['description']),
  59                      "usetranslation" => $mybb->get_input('usetranslation', MyBB::INPUT_INT),
  60                      "enabled" => $mybb->get_input('enabled', MyBB::INPUT_INT),
  61                      "disporder" => $mybb->get_input('disporder', MyBB::INPUT_INT)
  62                  );
  63  
  64                  $sid = $db->insert_query("helpsections", $sql_array);
  65  
  66                  $plugins->run_hooks("admin_config_help_documents_add_section_commit");
  67  
  68                  // Log admin action
  69                  log_admin_action($sid, $mybb->input['name'], 'section');
  70  
  71                  flash_message($lang->success_help_section_added, 'success');
  72                  admin_redirect('index.php?module=config-help_documents');
  73              }
  74          }
  75  
  76          $page->add_breadcrumb_item($lang->add_new_section);
  77          $page->output_header($lang->help_documents." - ".$lang->add_new_section);
  78  
  79          $sub_tabs['manage_help_documents'] = array(
  80              'title'    => $lang->manage_help_documents,
  81              'link'    => "index.php?module=config-help_documents"
  82          );
  83  
  84          $sub_tabs['add_help_document'] = array(
  85              'title'    => $lang->add_new_document,
  86              'link'    => "index.php?module=config-help_documents&amp;action=add&amp;type=document"
  87          );
  88  
  89          $sub_tabs['add_help_section'] = array(
  90              'title'    => $lang->add_new_section,
  91              'link'    => "index.php?module=config-help_documents&amp;action=add&amp;type=section",
  92              'description' => $lang->add_new_section_desc
  93          );
  94  
  95          $page->output_nav_tabs($sub_tabs, 'add_help_section');
  96  
  97          if($errors)
  98          {
  99              $page->output_inline_error($errors);
 100          }
 101          else
 102          {
 103              $query = $db->simple_select("helpsections", "MAX(disporder) as maxdisp");
 104              $mybb->input['disporder'] = $db->fetch_field($query, "maxdisp")+1;
 105              $mybb->input['enabled'] = 1;
 106              $mybb->input['usetranslation'] = 1;
 107          }
 108  
 109          $form = new Form("index.php?module=config-help_documents&amp;action=add&amp;type=section", "post", "add");
 110          echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
 111  
 112          $form_container = new FormContainer($lang->add_new_section);
 113          $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
 114          $form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');
 115          $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder');
 116          $form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio('enabled', $mybb->input['enabled']));
 117          $form_container->end();
 118  
 119          $buttons[] = $form->generate_submit_button($lang->save_section);
 120  
 121          $form->output_submit_wrapper($buttons);
 122          $form->end();
 123      }
 124  
 125      // Add page
 126      else
 127      {
 128          $plugins->run_hooks("admin_config_help_documents_add_page");
 129  
 130          // Do add?
 131          if($mybb->request_method == "post")
 132          {
 133              if(empty($mybb->input['sid']))
 134              {
 135                  $errors[] = $lang->error_missing_sid;
 136              }
 137  
 138              if(empty($mybb->input['name']))
 139              {
 140                  $errors[] = $lang->error_document_missing_name;
 141              }
 142  
 143              if(empty($mybb->input['description']))
 144              {
 145                  $errors[] = $lang->error_document_missing_description;
 146              }
 147  
 148              if(empty($mybb->input['document']))
 149              {
 150                  $errors[] = $lang->error_document_missing_document;
 151              }
 152  
 153              if(!isset($mybb->input['enabled']))
 154              {
 155                  $errors[] = $lang->error_document_missing_enabled;
 156              }
 157  
 158              if($mybb->input['enabled'] != 1)
 159              {
 160                  $mybb->input['enabled'] = 0;
 161              }
 162  
 163              if(!is_array($errors))
 164              {
 165                  $sql_array = array(
 166                      "sid" => $mybb->get_input('sid', MyBB::INPUT_INT),
 167                      "name" => $db->escape_string($mybb->input['name']),
 168                      "description" => $db->escape_string($mybb->input['description']),
 169                      "document" => $db->escape_string($mybb->input['document']),
 170                      "usetranslation" => $mybb->get_input('usetranslation', MyBB::INPUT_INT),
 171                      "enabled" => $mybb->get_input('enabled', MyBB::INPUT_INT),
 172                      "disporder" => $mybb->get_input('disporder', MyBB::INPUT_INT)
 173                  );
 174  
 175                  $hid = $db->insert_query("helpdocs", $sql_array);
 176  
 177                  $plugins->run_hooks("admin_config_help_documents_add_page_commit");
 178  
 179                  // Log admin action
 180                  log_admin_action($hid, $mybb->input['name'], 'document');
 181  
 182                  flash_message($lang->success_help_document_added, 'success');
 183                  admin_redirect('index.php?module=config-help_documents');
 184              }
 185          }
 186  
 187          $page->add_breadcrumb_item($lang->add_new_document);
 188          $page->output_header($lang->help_documents." - ".$lang->add_new_document);
 189  
 190          $sub_tabs['manage_help_documents'] = array(
 191              'title'    => $lang->manage_help_documents,
 192              'link'    => "index.php?module=config-help_documents"
 193          );
 194  
 195          $sub_tabs['add_help_document'] = array(
 196              'title'    => $lang->add_new_document,
 197              'link'    => "index.php?module=config-help_documents&amp;action=add&amp;type=document",
 198              'description' => $lang->add_new_document_desc
 199          );
 200  
 201          $sub_tabs['add_help_section'] = array(
 202              'title'    => $lang->add_new_section,
 203              'link'    => "index.php?module=config-help_documents&amp;action=add&amp;type=section"
 204          );
 205  
 206          $page->output_nav_tabs($sub_tabs, 'add_help_document');
 207  
 208          if($errors)
 209          {
 210              $page->output_inline_error($errors);
 211          }
 212          else
 213          {
 214              // Select the largest existing display order
 215              $query = $db->simple_select("helpdocs", "MAX(disporder) as maxdisp");
 216              $mybb->input['disporder'] = $db->fetch_field($query, "maxdisp")+1;
 217              $mybb->input['enabled'] = 1;
 218              $mybb->input['usetranslation'] = 1;
 219          }
 220  
 221          $form = new Form("index.php?module=config-help_documents&amp;action=add&amp;type=document", "post", "add");
 222          echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
 223  
 224          $form_container = new FormContainer($lang->add_new_document);
 225          $query = $db->simple_select("helpsections", "sid, name");
 226  
 227          $sections = array();
 228          while($section = $db->fetch_array($query))
 229          {
 230              $sections[$section['sid']] = $section['name'];
 231          }
 232          $form_container->output_row($lang->section." <em>*</em>", "", $form->generate_select_box("sid", $sections, $mybb->input['sid'], array('id' => 'sid')), 'sid');
 233          $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
 234          $form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');
 235          $form_container->output_row($lang->document." <em>*</em>", "", $form->generate_text_area('document', $mybb->input['document'], array('id' => 'document')), 'document');
 236          $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder');
 237          $form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio('enabled', $mybb->input['enabled']));
 238          $form_container->end();
 239  
 240          $buttons[] = $form->generate_submit_button($lang->save_document);
 241  
 242          $form->output_submit_wrapper($buttons);
 243          $form->end();
 244      }
 245  
 246      $page->output_footer();
 247  }
 248  
 249  // Edit something
 250  if($mybb->input['action'] == "edit")
 251  {
 252      $plugins->run_hooks("admin_config_help_documents_edit");
 253  
 254      // Edit a section
 255      if($mybb->input['sid'] && !$mybb->input['hid'])
 256      {
 257          $query = $db->simple_select("helpsections", "*", "sid = '".$mybb->get_input('sid', MyBB::INPUT_INT)."'");
 258          $section = $db->fetch_array($query);
 259  
 260          $plugins->run_hooks("admin_config_help_documents_edit_section");
 261  
 262          // Do edit?
 263          if($mybb->request_method == "post")
 264          {
 265              $sid = $mybb->get_input('sid', MyBB::INPUT_INT);
 266  
 267              if(empty($sid))
 268              {
 269                  $errors[] = $lang->error_invalid_sid;
 270              }
 271  
 272              if(empty($mybb->input['name']))
 273              {
 274                  $errors[] = $lang->error_section_missing_name;
 275              }
 276  
 277              if(empty($mybb->input['description']))
 278              {
 279                  $errors[] = $lang->error_section_missing_description;
 280              }
 281  
 282              if(!isset($mybb->input['enabled']))
 283              {
 284                  $errors[] = $lang->error_section_missing_enabled;
 285              }
 286  
 287              if($mybb->input['enabled'] != 1)
 288              {
 289                  $mybb->input['enabled'] = 0;
 290              }
 291  
 292              if(!is_array($errors))
 293              {
 294                  $sql_array = array(
 295                      "name" => $db->escape_string($mybb->input['name']),
 296                      "description" => $db->escape_string($mybb->input['description']),
 297                      "usetranslation" => $mybb->get_input('usetranslation', MyBB::INPUT_INT),
 298                      "enabled" => $mybb->get_input('enabled', MyBB::INPUT_INT),
 299                      "disporder" => $mybb->get_input('disporder', MyBB::INPUT_INT)
 300                  );
 301  
 302                  $plugins->run_hooks("admin_config_help_documents_edit_section_commit");
 303  
 304                  $db->update_query("helpsections", $sql_array, "sid = '{$sid}'");
 305  
 306                  // Log admin action
 307                  log_admin_action($sid, $mybb->input['name'], 'section');
 308  
 309                  flash_message($lang->success_help_section_updated, 'success');
 310                  admin_redirect('index.php?module=config-help_documents');
 311              }
 312          }
 313  
 314          $page->add_breadcrumb_item($lang->edit_section);
 315          $page->output_header($lang->help_documents." - ".$lang->edit_section);
 316  
 317  
 318          $sub_tabs['edit_help_section'] = array(
 319              'title'    => $lang->edit_section,
 320              'link'    => "index.php?module=config-help_documents&amp;action=edit&amp;sid=".$section['sid'],
 321              'description' => $lang->edit_section_desc
 322          );
 323  
 324          $page->output_nav_tabs($sub_tabs, 'edit_help_section');
 325  
 326          if($errors)
 327          {
 328              $page->output_inline_error($errors);
 329          }
 330          else
 331          {
 332              $mybb->input['sid'] = $section['sid'];
 333              $mybb->input['name'] = $section['name'];
 334              $mybb->input['description'] = $section['description'];
 335              $mybb->input['disporder'] = $section['disporder'];
 336              $mybb->input['enabled'] = $section['enabled'];
 337              $mybb->input['usetranslation'] = $section['usetranslation'];
 338          }
 339  
 340          $form = new Form("index.php?module=config-help_documents&amp;action=edit", "post", "edit");
 341  
 342          echo $form->generate_hidden_field("sid", $section['sid']);
 343          echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
 344  
 345          $form_container = new FormContainer($lang->edit_section." ({$lang->id} ".$section['sid'].")");
 346          $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
 347          $form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');
 348          $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder');
 349          $form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio('enabled', $mybb->input['enabled']));
 350          $form_container->end();
 351  
 352          $buttons[] = $form->generate_submit_button($lang->edit_section);
 353  
 354          $form->output_submit_wrapper($buttons);
 355          $form->end();
 356      }
 357  
 358      // Edit document
 359      else
 360      {
 361          $plugins->run_hooks("admin_config_help_documents_edit_page");
 362  
 363          // Do edit?
 364          if($mybb->request_method == "post")
 365          {
 366              $hid = $mybb->get_input('hid', MyBB::INPUT_INT);
 367  
 368              if(empty($hid))
 369              {
 370                  $errors[] = $lang->error_invalid_sid;
 371              }
 372  
 373              if(empty($mybb->input['name']))
 374              {
 375                  $errors[] = $lang->error_document_missing_name;
 376              }
 377  
 378              if(empty($mybb->input['description']))
 379              {
 380                  $errors[] = $lang->error_document_missing_description;
 381              }
 382  
 383              if(empty($mybb->input['document']))
 384              {
 385                  $errors[] = $lang->error_document_missing_document;
 386              }
 387  
 388              if(!isset($mybb->input['enabled']))
 389              {
 390                  $errors[] = $lang->error_document_missing_enabled;
 391              }
 392  
 393              if($mybb->input['enabled'] != 1)
 394              {
 395                  $mybb->input['enabled'] = 0;
 396              }
 397  
 398              if(!is_array($errors))
 399              {
 400                  $sql_array = array(
 401                      "sid" => $mybb->get_input('sid', MyBB::INPUT_INT),
 402                      "name" => $db->escape_string($mybb->input['name']),
 403                      "description" => $db->escape_string($mybb->input['description']),
 404                      "document" => $db->escape_string($mybb->input['document']),
 405                      "usetranslation" => $mybb->get_input('usetranslation', MyBB::INPUT_INT),
 406                      "enabled" => $mybb->get_input('enabled', MyBB::INPUT_INT),
 407                      "disporder" => $mybb->get_input('disporder', MyBB::INPUT_INT)
 408                  );
 409  
 410                  $plugins->run_hooks("admin_config_help_documents_edit_page_commit");
 411  
 412                  $db->update_query("helpdocs", $sql_array, "hid = '{$hid}'");
 413  
 414                  // Log admin action
 415                  log_admin_action($hid, $mybb->input['name'], 'document');
 416  
 417                  flash_message($lang->success_help_document_updated, 'success');
 418                  admin_redirect('index.php?module=config-help_documents');
 419              }
 420          }
 421  
 422          $page->add_breadcrumb_item($lang->edit_document);
 423          $page->output_header($lang->help_documents." - ".$lang->edit_document);
 424  
 425  
 426          $sub_tabs['edit_help_document'] = array(
 427              'title'    => $lang->edit_document,
 428              'link'    => "index.php?module=config-help_documents&amp;action=edit&amp;hid=".$hid,
 429              'description' => $lang->edit_document_desc
 430          );
 431  
 432          $page->output_nav_tabs($sub_tabs, 'edit_help_document');
 433  
 434          if($errors)
 435          {
 436              $page->output_inline_error($errors);
 437          }
 438          else
 439          {
 440              $query = $db->simple_select("helpdocs", "*", "hid = '".$mybb->get_input('hid', MyBB::INPUT_INT)."'");
 441              $doc = $db->fetch_array($query);
 442              $mybb->input['hid'] = $doc['hid'];
 443              $mybb->input['sid'] = $doc['sid'];
 444              $mybb->input['name'] = $doc['name'];
 445              $mybb->input['description'] = $doc['description'];
 446              $mybb->input['document'] = $doc['document'];
 447              $mybb->input['disporder'] = $doc['disporder'];
 448              $mybb->input['enabled'] = $doc['enabled'];
 449              $mybb->input['usetranslation'] = $doc['usetranslation'];
 450          }
 451  
 452          $form = new Form("index.php?module=config-help_documents&amp;action=edit", "post", "edit");
 453  
 454          echo $form->generate_hidden_field("hid", $doc['hid']);
 455          echo $form->generate_hidden_field("usetranslation", $mybb->input['usetranslation']);
 456  
 457          $form_container = new FormContainer($lang->edit_document." ({$lang->id} ".$doc['hid'].")");
 458  
 459          $sections = array();
 460          $query = $db->simple_select("helpsections", "sid, name");
 461          while($section = $db->fetch_array($query))
 462          {
 463              $sections[$section['sid']] = $section['name'];
 464          }
 465          $form_container->output_row($lang->section." <em>*</em>", "", $form->generate_select_box("sid", $sections, $mybb->input['sid']), 'sid');
 466          $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
 467          $form_container->output_row($lang->short_description." <em>*</em>", "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');
 468          $form_container->output_row($lang->document." <em>*</em>", "", $form->generate_text_area('document', $mybb->input['document'], array('id' => 'document')), 'document');
 469          $form_container->output_row($lang->display_order, "", $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder');
 470          $form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio('enabled', $mybb->input['enabled']));
 471          $form_container->end();
 472  
 473          $buttons[] = $form->generate_submit_button($lang->edit_document);
 474  
 475          $form->output_submit_wrapper($buttons);
 476          $form->end();
 477      }
 478  
 479      $page->output_footer();
 480  }
 481  
 482  // Delete something
 483  if($mybb->input['action'] == "delete")
 484  {
 485      // User clicked no
 486      if($mybb->input['no'])
 487      {
 488          admin_redirect("index.php?module=config-help_documents");
 489      }
 490  
 491      $plugins->run_hooks("admin_config_help_documents_delete");
 492  
 493      // Do delete something?
 494      if($mybb->request_method == "post")
 495      {
 496          // Delete section
 497          if(isset($mybb->input['sid']))
 498          {
 499              $sid = $mybb->get_input('sid', MyBB::INPUT_INT);
 500  
 501              $query = $db->simple_select("helpsections", "*", "sid='{$sid}'");
 502              $section = $db->fetch_array($query);
 503  
 504              // Invalid section?
 505              if(!$section['sid'])
 506              {
 507                  flash_message($lang->error_missing_section_id, 'error');
 508                  admin_redirect("index.php?module=config-help_documents");
 509              }
 510  
 511              // Delete section and its documents
 512              $db->delete_query("helpsections", "sid = '{$section['sid']}'", 1);
 513              $db->delete_query("helpdocs", "sid = '{$section['sid']}'");
 514  
 515              $plugins->run_hooks("admin_config_help_documents_delete_section_commit");
 516  
 517              // Log admin action
 518              log_admin_action($section['sid'], $section['name'], 'section');
 519  
 520              flash_message($lang->success_section_deleted, 'success');
 521              admin_redirect("index.php?module=config-help_documents");
 522          }
 523  
 524          // Delete document
 525          else
 526          {
 527              $hid = $mybb->get_input('hid', MyBB::INPUT_INT);
 528  
 529              $query = $db->simple_select("helpdocs", "*", "hid='{$hid}'");
 530              $doc = $db->fetch_array($query);
 531  
 532              // Invalid document?
 533              if(!$doc['hid'])
 534              {
 535                  flash_message($lang->error_missing_hid, 'error');
 536                  admin_redirect("index.php?module=config-help_documents");
 537              }
 538  
 539              $db->delete_query("helpdocs", "hid = '{$doc['hid']}'", 1);
 540  
 541              $plugins->run_hooks("admin_config_help_documents_delete_page_commit");
 542  
 543              // Log admin action
 544              log_admin_action($doc['hid'], $doc['name'], 'document');
 545  
 546              flash_message($lang->success_document_deleted, 'success');
 547              admin_redirect("index.php?module=config-help_documents");
 548          }
 549      }
 550      // Show form for deletion
 551      else
 552      {
 553          // Section
 554          if(isset($mybb->input['sid']))
 555          {
 556              $sid = $mybb->get_input('sid', MyBB::INPUT_INT);
 557              $page->output_confirm_action("index.php?module=config-help_documents&amp;action=delete&amp;sid={$sid}", $lang->confirm_section_deletion);
 558          }
 559          // Document
 560          else
 561          {
 562              $hid = $mybb->get_input('hid', MyBB::INPUT_INT);
 563              $page->output_confirm_action("index.php?module=config-help_documents&amp;action=delete&amp;hid={$hid}", $lang->confirm_document_deletion);
 564          }
 565      }
 566  }
 567  
 568  // List document and sections
 569  if(!$mybb->input['action'])
 570  {
 571      $page->output_header($lang->help_documents);
 572  
 573      $sub_tabs['manage_help_documents'] = array(
 574          'title'    => $lang->manage_help_documents,
 575          'link'    => "index.php?module=config-help_documents",
 576          'description'=> $lang->manage_help_documents_desc
 577      );
 578  
 579      $sub_tabs['add_help_document'] = array(
 580          'title'    => $lang->add_new_document,
 581          'link'    => "index.php?module=config-help_documents&amp;action=add&amp;type=document"
 582      );
 583  
 584      $sub_tabs['add_help_section'] = array(
 585          'title'    => $lang->add_new_section,
 586          'link'    => "index.php?module=config-help_documents&amp;action=add&amp;type=section"
 587      );
 588  
 589      $plugins->run_hooks("admin_config_help_documents_start");
 590  
 591      $page->output_nav_tabs($sub_tabs, 'manage_help_documents');
 592  
 593      $table = new Table;
 594      $table->construct_header($lang->section_document);
 595      $table->construct_header($lang->controls, array('class' => "align_center", 'colspan' => 2, "width" => "150"));
 596  
 597      $query = $db->simple_select("helpsections", "*", "", array('order_by' => "disporder"));
 598      while($section = $db->fetch_array($query))
 599      {
 600          $table->construct_cell("<div><strong><a href=\"index.php?module=config-help_documents&amp;action=edit&amp;sid={$section['sid']}\">{$section['name']}</a></strong><br /><small>{$section['description']}</small></div>");
 601          $table->construct_cell("<a href=\"index.php?module=config-help_documents&amp;action=edit&amp;sid={$section['sid']}\">{$lang->edit}</a>", array("class" => "align_center", "width" => '60'));
 602          $table->construct_cell("<a href=\"index.php?module=config-help_documents&amp;action=delete&amp;sid={$section['sid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_section_deletion}')\">{$lang->delete}</a>", array("class" => "align_center", "width" => '90'));
 603          $table->construct_row();
 604  
 605          $query2 = $db->simple_select("helpdocs", "*", "sid='{$section['sid']}'", array('order_by' => "disporder"));
 606          while($doc = $db->fetch_array($query2))
 607          {
 608              $table->construct_cell("<div style=\"padding-left: 40px;\"><div><strong><a href=\"index.php?module=config-help_documents&amp;action=edit&amp;hid={$doc['hid']}\">{$doc['name']}</a></strong><br /><small>{$doc['description']}</small></div></div>");
 609              $table->construct_cell("<a href=\"index.php?module=config-help_documents&amp;action=edit&amp;hid={$doc['hid']}\">{$lang->edit}</a>", array("class" => "align_center", "width" => '60'));
 610              $table->construct_cell("<a href=\"index.php?module=config-help_documents&amp;action=delete&amp;hid={$doc['hid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_document_deletion}')\">{$lang->delete}</a>", array("class" => "align_center", "width" => '90'));
 611              $table->construct_row();
 612          }
 613      }
 614  
 615      // No documents message
 616      if($table->num_rows()  == 0)
 617      {
 618          $table->construct_cell($lang->no_help_documents, array('colspan' => 3));
 619          $table->construct_row();
 620      }
 621  
 622      $table->output($lang->help_documents);
 623      $page->output_footer();
 624  }


2005 - 2019 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref 0.7.1