[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/admin/modules/forum/ -> 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 forum_meta()
  19  {
  20      global $page, $lang, $plugins;
  21      
  22      $sub_menu = array();
  23      $sub_menu['10'] = array("id" => "management", "title" => $lang->forum_management, "link" => "index.php?module=forum-management");
  24      $sub_menu['20'] = array("id" => "announcements", "title" => $lang->forum_announcements, "link" => "index.php?module=forum-announcements");
  25      $sub_menu['30'] = array("id" => "moderation_queue", "title" => $lang->moderation_queue, "link" => "index.php?module=forum-moderation_queue");
  26      $sub_menu['40'] = array("id" => "attachments", "title" => $lang->attachments, "link" => "index.php?module=forum-attachments");
  27      
  28      $sub_menu = $plugins->run_hooks("admin_forum_menu", $sub_menu);
  29  
  30      $page->add_menu_item($lang->forums_and_posts, "forum", "index.php?module=forum", 20, $sub_menu);
  31  
  32      return true;
  33  }
  34  
  35  function forum_action_handler($action)
  36  {
  37      global $page, $lang, $plugins;
  38      
  39      $page->active_module = "forum";
  40      
  41      $actions = array(
  42          'moderation_queue' => array('active' => 'moderation_queue', 'file' => 'moderation_queue.php'),
  43          'announcements' => array('active' => 'announcements', 'file' => 'announcements.php'),
  44          'attachments' => array('active' => 'attachments', 'file' => 'attachments.php'),
  45          'management' => array('active' => 'management', 'file' => 'management.php')
  46      );
  47      
  48      $actions = $plugins->run_hooks("admin_forum_action_handler", $actions);
  49      
  50      if(isset($actions[$action]))
  51      {
  52          $page->active_action = $actions[$action]['active'];
  53          return $actions[$action]['file'];
  54      }
  55      else
  56      {
  57          $page->active_action = "management";
  58          return "management.php";
  59      }
  60  }
  61  
  62  function forum_admin_permissions()
  63  {
  64      global $lang, $plugins;
  65      
  66      $admin_permissions = array(
  67          "management" => $lang->can_manage_forums,
  68          "announcements" => $lang->can_manage_forum_announcements,
  69          "moderation_queue" => $lang->can_moderate,
  70          "attachments" => $lang->can_manage_attachments,
  71      );
  72      
  73      $admin_permissions = $plugins->run_hooks("admin_forum_permissions", $admin_permissions);
  74      
  75      return array("name" => $lang->forums_and_posts, "permissions" => $admin_permissions, "disporder" => 20);
  76  }
  77  
  78  ?>


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