<?php

/**
* @package Admin
*/
class Admin_menu extends NE_MenuHook
{
    function Admin_menu(&$user, &$customer, &$tpl)
    {
                parent::NE_MenuHook($user, $customer, $tpl);

                if ($this->user->getGroupId() == ROLE_SUPERADMIN) {
                        //Staff / Clients
                        $menuItem = new NE_MenuItem($this->user->lang("Staff / Clients"),"index.php?fuse=admin&amp;view=ViewAdminList");
                        $menuItem->addViews(array('ShowCustomFields','ShowAddAdmin', 'ViewAdminList', 'EditAddAdminAccount', 'ViewGeneralGroups', 'AddEditGeneralGroup','ViewCustomerGroups','ViewCustomerGroupNotes','AddEditCustomerGroup'));
                        $this->addItem($menuItem);
                }

                //Billing
                $menuItem = new NE_MenuItem($this->user->lang("Billing"),"index.php?fuse=billing&amp;view=BillingTypes");
                $menuItem->addViews(array('BillingTypes','ShowAddTaxRules','ShowTaxOverview','ListCoupons', 'ArchivedCoupons','AddCoupon', 'EditCoupon','Currencies'));
                $menuItem->addPermissions("billing_show_billing_types");
                $this->addItem($menuItem);
                
                //Support menu item
                $menuItem = new NE_MenuItem($this->user->lang('Support'),"index.php?fuse=support&amp;view=ViewTicketTypes");
                $menuItem->addViews(array('ViewEmailRoutings','ViewDepartments','AddEditDepartment', 'AddEditEmailRouting','ViewEscalations', 'AddEditEscalation','ViewTicketTypes', 'AddEditTicketType'));
                $menuItem->addPermissions("support_show_tickettypes");
                $this->addItem($menuItem);
                //Settings menu item
                $menuItem = new NE_MenuItem($this->user->lang('Settings'),"index.php?fuse=admin&amp;view=ViewSettings&amp;group=general");
                $menuItem->addViews("ViewSettings");
                $menuItem->addPermissions("admin_edit_settings");
                $this->addItem($menuItem);

                //Product menu items
                $menuItem = new NE_MenuItem($this->user->lang("Products"),"index.php?fuse=admin&amp;view=Admin_ViewProducts");
                $menuItem->addViews(array('Admin_ViewProducts','Admin_ViewProductTypes','Admin_ViewAddons','ShowCustomFieldsForProduct'));
                $menuItem->addPermissions('admin_view_packagetypes');
                $this->addItem($menuItem);

               //Hosting Menu Item
               $menuItem = new NE_MenuItem($this->user->lang('Servers / Domains'),"index.php?fuse=admin&amp;view=ViewServers");
               $menuItem->addViews(array('ViewServers', 'ShowAddNewServer','ShowTldOverview'));
               $menuItem->addPermissions("admin_edit_servers");
               $this->addItem($menuItem);

                //Email Template Menu Item
                $menuItem = new NE_MenuItem($this->user->lang('E-mails'),"index.php?fuse=admin&amp;view=Admin_Emails");
                $menuItem->addViews(array("Admin_Emails"));
                $menuItem->addPermissions("admin_edit_settings");
                $this->addItem($menuItem);

                //plugin menu tab
                $menuItem = new NE_MenuItem($this->user->lang("Plugins"), "index.php?fuse=admin&amp;view=Services");
                $menuItem->addViews(array('Registrars','ThirdPartyBilling','Services','Fraud','PhoneVerification','Affiliates','CurrencyPlugins'));
                $menuItem->addPermissions("admin_manage_plugins");
                $this->addItem($menuItem);

    }

}

?>
