<?php

/*
    menu array
    [0] = link including text to show for the given menu item
    [1] = type of item (depracted) - this was used to determine if it was a menu dropdownlist item or a subitem from old views (keep at zero)
    [2] = Determine if this is the active item
*/

/**
* @package Home
*/
class Home_menu extends NE_MenuHook
{

    function Home_menu(&$user, &$customer, &$tpl)
    {
        parent::NE_MenuHook($user, $customer, $tpl);

        if (NE_Lib::isPublicDir() && $this->user->isAdmin()) {
            return;
        }
        if ($this->user->isAdmin()) {
            //Dashboard
            $menuItem = new NE_MenuItem($this->user->lang("Dashboard"),"index.php?fuse=home&amp;view=Admin_ShowSummary");
            $menuItem->addViews("ViewAdmin_ShowSummary");
            $this->addItem($menuItem);

            //Dashboard
            $menuItem = new NE_MenuItem($this->user->lang("Team Calendar"),"index.php?fuse=home&amp;view=TeamCalendar");
            $menuItem->addViews("ViewTeamCalendar");
            $this->addItem($menuItem);

            if($this->user->hasPermission("admin_edit_announcements")){
                $menuItem = new NE_MenuItem($this->user->lang('Announcements'),"index.php?fuse=admin&amp;view=AdminViewAnnouncements");
                $menuItem->addViews(array('ViewAdminViewAnnouncements'));
                $menuItem->addPermissions("admin_edit_announcements");
                $this->addItem($menuItem);
            }

            //Events
            $menuItem = new NE_MenuItem($this->user->lang("Events"),"index.php?fuse=home&amp;view=ViewEvents");
            $menuItem->addViews("ViewViewEvents");
            $this->addItem($menuItem);
        }
    }
}