[ Index ]

MailPress 544

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/ -> MP_Admin_Menu.class.php (source)

   1  <?php
   2  class MP_Admin_Menu
   3  {
   4  	function __construct()
   5      {
   6          $menus = array();
   7  
   8          foreach (MailPress::capabilities() as $capability => $datas)
   9          {
  10              if (isset($datas['menu']) && $datas['menu'] && current_user_can($capability))
  11              {
  12                  $datas['capability']     = $capability;
  13                  $menus[]            = $datas;
  14              }
  15          }
  16          if (empty($menus)) return;
  17  
  18          uasort($menus, create_function('$a, $b', 'return strcmp($a["menu"], $b["menu"]);'));
  19  
  20          $first = true;
  21          foreach ($menus as $menu)
  22          {
  23              if (!$menu['parent'])
  24              {
  25                  if ($first)
  26                  {
  27                      $toplevel = $menu['page'];
  28                      add_menu_page('', __('Mails', MP_TXTDOM), $menu['capability'], $menu['page'], $menu['func'], 'div');
  29                  }
  30                  $first = false;
  31              }
  32  
  33              $parent = ($menu['parent']) ? $menu['parent'] : $toplevel;
  34              add_submenu_page( $parent, $menu['page_title'], $menu['menu_title'], $menu['capability'], $menu['page'], $menu['func']);
  35  
  36              if ($menu['page'] == MailPress_page_mails)
  37              {
  38                  add_submenu_page($toplevel, __('Add New Mail', MP_TXTDOM), '&#160;' . __('Add New'), 'MailPress_edit_mails', MailPress_page_write, array('MP_AdminPage', 'body'));
  39              }
  40          }
  41      }
  42  }


Generated: Thu Apr 28 18:38:52 2016 Cross-referenced by PHPXref 0.7.1