<?php

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

            if($this->user->isAdmin()){

                //Settings menu item
                $menuItem = new NE_MenuItem($this->user->lang('Settings'),"index.php?fuse=admin&amp;view=AccountGeneral&amp;group=general");
                $menuItem->addViews(array(
                    "ViewModuleSettings",
                    "ViewBillingTypes",
                    "ViewTaxOverview",
                    "ViewAddTaxRules",
                    "ViewListCoupons",
                    "ViewCurrencies",
                    "ViewAdmin_Emails",
                    "ViewEmailRoutings",
                    "ViewMailGeneral",
                    "ViewKBGeneral",
                    "ViewAccountGeneral",
                    "ViewLocalizationSettings",
                    "ViewSignupGeneral",
                    "ViewSecurityGeneral",
                    "ViewPasswordSettings",
                    "ViewAPIKey",
                    "ViewDisplayPassphraseInfo",
                    "ViewDisplayEncryptDomainPasswords",
                    "ViewSupportGeneral",
                    "ViewBillingGeneral",
                    "ViewSupportWidget",
                    "ViewDepartments",
                    "ViewEscalations",
                    "ViewTicketTypes",
                    'ViewDomainGeneral'
                ));
                $menuItem->addPermissions("admin_edit_settings");
                $this->addItem($menuItem);

                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);
                }

                //Product menu items
                $menuItem = new NE_MenuItem($this->user->lang("Products / Addons"),"index.php?fuse=admin&amp;view=viewProducts");
                $menuItem->addViews(array('ViewviewProducts','ViewviewAddons','ViewviewCustomFieldsForProduct'));
                $menuItem->addPermissions('admin_view_packagetypes');
                $this->addItem($menuItem);

                //Files
                if($this->user->hasPermission("files_view")){
                    $menuItem = new NE_MenuItem($this->user->lang('Files'),"index.php?fuse=files&amp;view=FileOverview");
                    $menuItem->addViews(array('FileEdit','FileOverview'));
                    $this->addItem($menuItem);
                }

               //Hosting Menu Item
               $menuItem = new NE_MenuItem($this->user->lang('Servers'),"index.php?fuse=admin&amp;view=ViewServers");
               $menuItem->addViews(array('ViewServers'));
               $menuItem->addPermissions("admin_edit_servers");
               $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','LiveSupport'));
                $menuItem->addPermissions("admin_manage_plugins");
                $this->addItem($menuItem);

                //Import / Export
                if ( $this->user->hasPermission('admin_view_import_export') ) {
                    $menuItem = new NE_MenuItem($this->user->lang('Import / Export'),"index.php?fuse=admin&amp;view=ViewImportPlugins");
                    $menuItem->addViews(array('ViewImportPlugins', 'ViewExport','ViewExportPlugins'));
                    $this->addItem($menuItem);
                }

           }

    }

}

?>
