[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/admin/modules/tools/ -> module_meta.php (source)

   1  <?php
   2  /**
   3   * MyBB 1.6
   4   * Copyright 2010 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://mybb.com
   7   * License: http://mybb.com/about/license
   8   *
   9   * $Id: module_meta.php 5817 2012-04-23 15:54:10Z Tomm $
  10   */
  11  
  12  // Disallow direct access to this file for security reasons
  13  if(!defined("IN_MYBB"))
  14  {
  15      die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
  16  }
  17  
  18  function tools_meta()
  19  {
  20      global $page, $lang, $plugins;
  21  
  22      $sub_menu = array();
  23      $sub_menu['10'] = array("id" => "system_health", "title" => $lang->system_health, "link" => "index.php?module=tools-system_health");
  24      $sub_menu['20'] = array("id" => "cache", "title" => $lang->cache_manager, "link" => "index.php?module=tools-cache");
  25      $sub_menu['30'] = array("id" => "tasks", "title" => $lang->task_manager, "link" => "index.php?module=tools-tasks");
  26      $sub_menu['40'] = array("id" => "recount_rebuild", "title" => $lang->recount_and_rebuild, "link" => "index.php?module=tools-recount_rebuild");
  27      $sub_menu['50'] = array("id" => "php_info", "title" => $lang->view_php_info, "link" => "index.php?module=tools-php_info");
  28      $sub_menu['60'] = array("id" => "backupdb", "title" => $lang->database_backups, "link" => "index.php?module=tools-backupdb");
  29      $sub_menu['70'] = array("id" => "optimizedb", "title" => $lang->optimize_database, "link" => "index.php?module=tools-optimizedb");
  30      $sub_menu['80'] = array("id" => "file_verification", "title" => $lang->file_verification, "link" => "index.php?module=tools-file_verification");
  31      
  32      $sub_menu = $plugins->run_hooks("admin_tools_menu", $sub_menu);
  33      
  34      $page->add_menu_item($lang->tools_and_maintenance, "tools", "index.php?module=tools", 50, $sub_menu);
  35      
  36      return true;
  37  }
  38  
  39  function tools_action_handler($action)
  40  {
  41      global $page, $lang, $plugins;
  42      
  43      $page->active_module = "tools";
  44      
  45      $actions = array(
  46          'php_info' => array('active' => 'php_info', 'file' => 'php_info.php'),
  47          'tasks' => array('active' => 'tasks', 'file' => 'tasks.php'),
  48          'backupdb' => array('active' => 'backupdb', 'file' => 'backupdb.php'),
  49          'optimizedb' => array('active' => 'optimizedb', 'file' => 'optimizedb.php'),
  50          'cache' => array('active' => 'cache', 'file' => 'cache.php'),
  51          'recount_rebuild' => array('active' => 'recount_rebuild', 'file' => 'recount_rebuild.php'),
  52          'maillogs' => array('active' => 'maillogs', 'file' => 'maillogs.php'),
  53          'mailerrors' => array('active' => 'mailerrors', 'file' => 'mailerrors.php'),
  54          'adminlog' => array('active' => 'adminlog', 'file' => 'adminlog.php'),
  55          'modlog' => array('active' => 'modlog', 'file' => 'modlog.php'),
  56          'warninglog' => array('active' => 'warninglog', 'file' => 'warninglog.php'),
  57          'system_health' => array('active' => 'system_health', 'file' => 'system_health.php'),
  58          'file_verification' => array('active' => 'file_verification', 'file' => 'file_verification.php'),
  59          'statistics' => array('active' => 'statistics', 'file' => 'statistics.php'),
  60      );
  61      
  62      $actions = $plugins->run_hooks("admin_tools_action_handler", $actions);
  63  
  64      $sub_menu = array();
  65      $sub_menu['10'] = array("id" => "adminlog", "title" => $lang->administrator_log, "link" => "index.php?module=tools-adminlog");
  66      $sub_menu['20'] = array("id" => "modlog", "title" => $lang->moderator_log, "link" => "index.php?module=tools-modlog");
  67      $sub_menu['30'] = array("id" => "maillogs", "title" => $lang->user_email_log, "link" => "index.php?module=tools-maillogs");
  68      $sub_menu['40'] = array("id" => "mailerrors", "title" => $lang->system_mail_log, "link" => "index.php?module=tools-mailerrors");
  69      $sub_menu['50'] = array("id" => "warninglog", "title" => $lang->user_warning_log, "link" => "index.php?module=tools-warninglog");
  70      $sub_menu['60'] = array("id" => "statistics", "title" => $lang->statistics, "link" => "index.php?module=tools-statistics");
  71      
  72      $sub_menu = $plugins->run_hooks("admin_tools_menu_logs", $sub_menu);
  73      
  74      if(!isset($actions[$action]))
  75      {
  76          $page->active_action = "system_health";
  77      }
  78      
  79      $sidebar = new SidebarItem($lang->logs);
  80      $sidebar->add_menu_items($sub_menu, $actions[$action]['active']);
  81      
  82      $page->sidebar .= $sidebar->get_markup();
  83      
  84      if(isset($actions[$action]))
  85      {
  86          $page->active_action = $actions[$action]['active'];
  87          return $actions[$action]['file'];
  88      }
  89      else
  90      {
  91          return "system_health.php";
  92      }
  93  }
  94  
  95  function tools_admin_permissions()
  96  {
  97      global $lang, $plugins;
  98      
  99      $admin_permissions = array(
 100          "system_health" => $lang->can_access_system_health,
 101          "cache" => $lang->can_manage_cache,
 102          "tasks" => $lang->can_manage_tasks,
 103          "backupdb" => $lang->can_manage_db_backup,
 104          "optimizedb" => $lang->can_optimize_db,
 105          "recount_rebuild" => $lang->can_recount_and_rebuild,
 106          "adminlog" => $lang->can_manage_admin_logs,
 107          "modlog" => $lang->can_manage_mod_logs,
 108          "maillogs" => $lang->can_manage_user_mail_log,
 109          "mailerrors" => $lang->can_manage_system_mail_log,
 110          "warninglog" => $lang->can_manage_user_warning_log,
 111          "php_info" => $lang->can_view_php_info,
 112          "file_verification" => $lang->can_manage_file_verification,
 113          "statistics" => $lang->can_view_statistics,
 114      );
 115      
 116      $admin_permissions = $plugins->run_hooks("admin_tools_permissions", $admin_permissions);
 117      
 118      return array("name" => $lang->tools_and_maintenance, "permissions" => $admin_permissions, "disporder" => 50);
 119  }
 120  ?>


Generated: Tue Oct 8 19:19:50 2013 Cross-referenced by PHPXref 0.7.1