[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/admin/modules/user/ -> 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 user_meta()
  19  {
  20      global $page, $lang, $plugins;
  21      
  22      $sub_menu = array();
  23      $sub_menu['10'] = array("id" => "users", "title" => $lang->users, "link" => "index.php?module=user-users");
  24      $sub_menu['20'] = array("id" => "groups", "title" => $lang->groups, "link" => "index.php?module=user-groups");
  25      $sub_menu['30'] = array("id" => "titles", "title" => $lang->user_titles, "link" => "index.php?module=user-titles");
  26      $sub_menu['40'] = array("id" => "banning", "title" => $lang->banning, "link" => "index.php?module=user-banning");
  27      $sub_menu['50'] = array("id" => "admin_permissions", "title" => $lang->admin_permissions, "link" => "index.php?module=user-admin_permissions");
  28      $sub_menu['60'] = array("id" => "mass_mail", "title" => $lang->mass_mail, "link" => "index.php?module=user-mass_mail");
  29      $sub_menu['70'] = array("id" => "group_promotions", "title" => $lang->group_promotions, "link" => "index.php?module=user-group_promotions");
  30      
  31      $sub_menu = $plugins->run_hooks("admin_user_menu", $sub_menu);
  32  
  33      $page->add_menu_item($lang->users_and_groups, "user", "index.php?module=user", 30, $sub_menu);
  34      return true;
  35  }
  36  
  37  function user_action_handler($action)
  38  {
  39      global $page, $lang, $plugins;
  40      
  41      $page->active_module = "user";
  42  
  43      $actions = array(
  44          'group_promotions' => array('active' => 'group_promotions', 'file' => 'group_promotions.php'),
  45          'admin_permissions' => array('active' => 'admin_permissions', 'file' => 'admin_permissions.php'),
  46          'titles' => array('active' => 'titles', 'file' => 'titles.php'),
  47          'banning' => array('active' => 'banning', 'file' => 'banning.php'),
  48          'groups' => array('active' => 'groups', 'file' => 'groups.php'),
  49          'mass_mail' => array('active' => 'mass_mail', 'file' => 'mass_mail.php'),
  50          'users' => array('active' => 'users', 'file' => 'users.php')
  51      );
  52      
  53      $actions = $plugins->run_hooks("admin_user_action_handler", $actions);
  54      
  55      if(isset($actions[$action]))
  56      {
  57          $page->active_action = $actions[$action]['active'];
  58          return $actions[$action]['file'];
  59      }
  60      else
  61      {
  62          $page->active_action = "users";
  63          return "users.php";
  64      }
  65  }
  66  
  67  function user_admin_permissions()
  68  {
  69      global $lang, $plugins;
  70      
  71      $admin_permissions = array(
  72          "users" => $lang->can_manage_users,
  73          "groups" => $lang->can_manage_user_groups,
  74          "titles" => $lang->can_manage_user_titles,
  75          "banning" => $lang->can_manage_user_bans,
  76          "admin_permissions" => $lang->can_manage_admin_permissions,
  77          "mass_mail" => $lang->can_send_mass_mail,
  78          "group_promotions" => $lang->can_manage_group_promotions
  79      );
  80      
  81      $admin_permissions = $plugins->run_hooks("admin_user_permissions", $admin_permissions);
  82      
  83      return array("name" => $lang->users_and_groups, "permissions" => $admin_permissions, "disporder" => 30);
  84  }
  85  ?>


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