[ Index ]

PHP Cross Reference of MyBB 1.8.38

title

Body

[close]

/admin/modules/tools/ -> module_meta.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  /**
  18   * @return bool true
  19   */
  20  function tools_meta()
  21  {
  22      global $page, $lang, $plugins;
  23  
  24      $sub_menu = array();
  25      $sub_menu['10'] = array("id" => "system_health", "title" => $lang->system_health, "link" => "index.php?module=tools-system_health");
  26      $sub_menu['20'] = array("id" => "cache", "title" => $lang->cache_manager, "link" => "index.php?module=tools-cache");
  27      $sub_menu['30'] = array("id" => "tasks", "title" => $lang->task_manager, "link" => "index.php?module=tools-tasks");
  28      $sub_menu['40'] = array("id" => "recount_rebuild", "title" => $lang->recount_and_rebuild, "link" => "index.php?module=tools-recount_rebuild");
  29      $sub_menu['50'] = array("id" => "php_info", "title" => $lang->view_php_info, "link" => "index.php?module=tools-php_info");
  30      $sub_menu['60'] = array("id" => "backupdb", "title" => $lang->database_backups, "link" => "index.php?module=tools-backupdb");
  31      $sub_menu['70'] = array("id" => "optimizedb", "title" => $lang->optimize_database, "link" => "index.php?module=tools-optimizedb");
  32      $sub_menu['80'] = array("id" => "file_verification", "title" => $lang->file_verification, "link" => "index.php?module=tools-file_verification");
  33  
  34      $sub_menu = $plugins->run_hooks("admin_tools_menu", $sub_menu);
  35  
  36      $page->add_menu_item($lang->tools_and_maintenance, "tools", "index.php?module=tools", 50, $sub_menu);
  37  
  38      return true;
  39  }
  40  
  41  /**
  42   * @param string $action
  43   *
  44   * @return string
  45   */
  46  function tools_action_handler($action)
  47  {
  48      global $page, $lang, $plugins;
  49  
  50      $page->active_module = "tools";
  51  
  52      $actions = array(
  53          'php_info' => array('active' => 'php_info', 'file' => 'php_info.php'),
  54          'tasks' => array('active' => 'tasks', 'file' => 'tasks.php'),
  55          'backupdb' => array('active' => 'backupdb', 'file' => 'backupdb.php'),
  56          'optimizedb' => array('active' => 'optimizedb', 'file' => 'optimizedb.php'),
  57          'cache' => array('active' => 'cache', 'file' => 'cache.php'),
  58          'recount_rebuild' => array('active' => 'recount_rebuild', 'file' => 'recount_rebuild.php'),
  59          'maillogs' => array('active' => 'maillogs', 'file' => 'maillogs.php'),
  60          'mailerrors' => array('active' => 'mailerrors', 'file' => 'mailerrors.php'),
  61          'adminlog' => array('active' => 'adminlog', 'file' => 'adminlog.php'),
  62          'modlog' => array('active' => 'modlog', 'file' => 'modlog.php'),
  63          'warninglog' => array('active' => 'warninglog', 'file' => 'warninglog.php'),
  64          'spamlog' => array('active' => 'spamlog', 'file' => 'spamlog.php'),
  65          'system_health' => array('active' => 'system_health', 'file' => 'system_health.php'),
  66          'file_verification' => array('active' => 'file_verification', 'file' => 'file_verification.php'),
  67          'statistics' => array('active' => 'statistics', 'file' => 'statistics.php'),
  68      );
  69  
  70      $actions = $plugins->run_hooks("admin_tools_action_handler", $actions);
  71  
  72      $sub_menu = array();
  73      $sub_menu['10'] = array("id" => "adminlog", "title" => $lang->administrator_log, "link" => "index.php?module=tools-adminlog");
  74      $sub_menu['20'] = array("id" => "modlog", "title" => $lang->moderator_log, "link" => "index.php?module=tools-modlog");
  75      $sub_menu['30'] = array("id" => "maillogs", "title" => $lang->user_email_log, "link" => "index.php?module=tools-maillogs");
  76      $sub_menu['40'] = array("id" => "mailerrors", "title" => $lang->system_mail_log, "link" => "index.php?module=tools-mailerrors");
  77      $sub_menu['50'] = array("id" => "warninglog", "title" => $lang->user_warning_log, "link" => "index.php?module=tools-warninglog");
  78      $sub_menu['60'] = array("id" => "spamlog", "title" => $lang->spam_log, "link" => "index.php?module=tools-spamlog");
  79      $sub_menu['70'] = array("id" => "statistics", "title" => $lang->statistics, "link" => "index.php?module=tools-statistics");
  80  
  81      $sub_menu = $plugins->run_hooks("admin_tools_menu_logs", $sub_menu);
  82  
  83      if(!isset($actions[$action]))
  84      {
  85          $page->active_action = $action = "system_health";
  86      }
  87  
  88      $sidebar = new SidebarItem($lang->logs);
  89      $sidebar->add_menu_items($sub_menu, $actions[$action]['active']);
  90  
  91      $page->sidebar .= $sidebar->get_markup();
  92  
  93      if(isset($actions[$action]))
  94      {
  95          $page->active_action = $actions[$action]['active'];
  96          return $actions[$action]['file'];
  97      }
  98      else
  99      {
 100          return "system_health.php";
 101      }
 102  }
 103  
 104  /**
 105   * @return array
 106   */
 107  function tools_admin_permissions()
 108  {
 109      global $lang, $plugins;
 110  
 111      $admin_permissions = array(
 112          "system_health" => $lang->can_access_system_health,
 113          "cache" => $lang->can_manage_cache,
 114          "tasks" => $lang->can_manage_tasks,
 115          "backupdb" => $lang->can_manage_db_backup,
 116          "optimizedb" => $lang->can_optimize_db,
 117          "recount_rebuild" => $lang->can_recount_and_rebuild,
 118          "adminlog" => $lang->can_manage_admin_logs,
 119          "modlog" => $lang->can_manage_mod_logs,
 120          "maillogs" => $lang->can_manage_user_mail_log,
 121          "mailerrors" => $lang->can_manage_system_mail_log,
 122          "warninglog" => $lang->can_manage_user_warning_log,
 123          "spamlog" => $lang->can_manage_spam_log,
 124          "php_info" => $lang->can_view_php_info,
 125          "file_verification" => $lang->can_manage_file_verification,
 126          "statistics" => $lang->can_view_statistics,
 127      );
 128  
 129      $admin_permissions = $plugins->run_hooks("admin_tools_permissions", $admin_permissions);
 130  
 131      return array("name" => $lang->tools_and_maintenance, "permissions" => $admin_permissions, "disporder" => 50);
 132  }
 133  


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