[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/admin/modules/config/ -> 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 5620 2011-09-26 18:23:52Z ralgith $
  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 config_meta()
  19  {
  20      global $page, $lang, $plugins;
  21      
  22      $sub_menu = array();
  23      $sub_menu['10'] = array("id" => "settings", "title" => $lang->bbsettings, "link" => "index.php?module=config-settings");
  24      $sub_menu['20'] = array("id" => "banning", "title" => $lang->banning, "link" => "index.php?module=config-banning");
  25      $sub_menu['30'] = array("id" => "profile_fields", "title" => $lang->custom_profile_fields, "link" => "index.php?module=config-profile_fields");
  26      $sub_menu['40'] = array("id" => "smilies", "title" => $lang->smilies, "link" => "index.php?module=config-smilies");
  27      $sub_menu['50'] = array("id" => "badwords", "title" => $lang->word_filters, "link" => "index.php?module=config-badwords");
  28      $sub_menu['60'] = array("id" => "mycode", "title" => $lang->mycode, "link" => "index.php?module=config-mycode");
  29      $sub_menu['70'] = array("id" => "languages", "title" => $lang->languages, "link" => "index.php?module=config-languages");
  30      $sub_menu['80'] = array("id" => "post_icons", "title" => $lang->post_icons, "link" => "index.php?module=config-post_icons");
  31      $sub_menu['90'] = array("id" => "help_documents", "title" => $lang->help_documents, "link" => "index.php?module=config-help_documents");
  32      $sub_menu['100'] = array("id" => "plugins", "title" => $lang->plugins, "link" => "index.php?module=config-plugins");
  33      $sub_menu['110'] = array("id" => "attachment_types", "title" => $lang->attachment_types, "link" => "index.php?module=config-attachment_types");
  34      $sub_menu['120'] = array("id" => "mod_tools", "title" => $lang->moderator_tools, "link" => "index.php?module=config-mod_tools");
  35      $sub_menu['130'] = array("id" => "spiders", "title" => $lang->spiders_bots, "link" => "index.php?module=config-spiders");
  36      $sub_menu['140'] = array("id" => "calendars", "title" => $lang->calendars, "link" => "index.php?module=config-calendars");
  37      $sub_menu['150'] = array("id" => "warning", "title" => $lang->warning_system, "link" => "index.php?module=config-warning");
  38      $sub_menu['160'] = array("id" => "thread_prefixes", "title" => $lang->thread_prefixes, "link" => "index.php?module=config-thread_prefixes");
  39      
  40      $sub_menu = $plugins->run_hooks("admin_config_menu", $sub_menu);
  41      
  42      $page->add_menu_item($lang->configuration, "config", "index.php?module=config", 10, $sub_menu);
  43      
  44      return true;
  45  }
  46  
  47  function config_action_handler($action)
  48  {
  49      global $page, $lang, $plugins;
  50      
  51      $page->active_module = "config";
  52  
  53      $actions = array(
  54          'plugins' => array('active' => 'plugins', 'file' => 'plugins.php'),
  55          'smilies' => array('active' => 'smilies', 'file' => 'smilies.php'),
  56          'banning' => array('active' => 'banning', 'file' => 'banning.php'),
  57          'badwords' => array('active' => 'badwords', 'file' => 'badwords.php'),
  58          'profile_fields' => array('active' => 'profile_fields', 'file' => 'profile_fields.php'),
  59          'spiders' => array('active' => 'spiders', 'file' => 'spiders.php'),
  60          'attachment_types' => array('active' => 'attachment_types', 'file' => 'attachment_types.php'),
  61          'languages' => array('active' => 'languages', 'file' => 'languages.php'),
  62          'post_icons' => array('active' => 'post_icons', 'file' => 'post_icons.php'),
  63          'help_documents' => array('active' => 'help_documents', 'file' => 'help_documents.php'),
  64          'calendars' => array('active' => 'calendars', 'file' => 'calendars.php'),
  65          'warning' => array('active' => 'warning', 'file' => 'warning.php'),
  66          'mod_tools' => array('active' => 'mod_tools', 'file' => 'mod_tools.php'),
  67          'mycode' => array('active' => 'mycode', 'file' => 'mycode.php'),
  68          'settings' => array('active' => 'settings', 'file' => 'settings.php'),
  69          'thread_prefixes' => array('active' => 'thread_prefixes', 'file' => 'thread_prefixes.php')
  70      );
  71      
  72      $actions = $plugins->run_hooks("admin_config_action_handler", $actions);
  73  
  74      if(isset($actions[$action]))
  75      {
  76          $page->active_action = $actions[$action]['active'];
  77          return $actions[$action]['file'];
  78      }
  79      else
  80      {
  81          $page->active_action = "settings";
  82          return "settings.php";
  83      }
  84  }
  85  
  86  function config_admin_permissions()
  87  {
  88      global $lang, $plugins;
  89      
  90      $admin_permissions = array(
  91          "settings" => $lang->can_manage_settings,
  92          "banning" => $lang->can_manage_banned_accounts,
  93          "profile_fields" => $lang->can_manage_custom_profile_fields,
  94          "smilies" => $lang->can_manage_smilies,
  95          "badwords" => $lang->can_manage_bad_words,
  96          "mycode" => $lang->can_manage_custom_mycode,
  97          "languages" => $lang->can_manage_language_packs,
  98          "post_icons" => $lang->can_manage_post_icons,
  99          "help_documents" => $lang->can_manage_help_documents,
 100          "plugins" => $lang->can_manage_plugins,
 101          "attachment_types" => $lang->can_manage_attachment_types,
 102          "spiders" => $lang->can_manage_spiders_bots,
 103          "calendars" => $lang->can_manage_calendars,
 104          "warning" => $lang->can_manage_warning_system,
 105          "mod_tools" => $lang->can_manage_mod_tools,
 106          "thread_prefixes" => $lang->can_manage_thread_prefixes
 107      );
 108      
 109      $admin_permissions = $plugins->run_hooks("admin_config_permissions", $admin_permissions);
 110      
 111      return array("name" => $lang->configuration, "permissions" => $admin_permissions, "disporder" => 10);
 112  }
 113  ?>


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