<?php


/**
* @package Skeleton
*/
class Domains_menu extends NE_MenuHook
{
    var $modulesViews = array(
        array('domains', 'ShowDomainOverview'),
        array('domains', 'ManageDomain'),
        array('domains', 'FetchDomains'),
    );
    
    /**
    * Returns an array describing the Menu Items and tabs for this module
    *
    * @access public
    * @param boolean $addLocation Currently unused
    * @return array Each array item is a subarray of the form:<br>
    *               Array(  0 => label (optionally wrapped in a link tag),
    *                       1 => 0 for a menu item or 1 for a tab item,
    *                       2 => 0 for an unselected tab item or 1 for a selected tab item)
    */
    function getMenuArr($addLocation = false)
    {
        $menuArr = array();
        $navlinks = array();

        if ($this->action == 'ShowDomainOverview') {
            $selectedTab = 1;
            $linkClass = 'sel';
            $navlinks[] = $this->user->lang('Show Domain Overview');
        } else {
            $selectedTab = 0;
            $linkClass = '';
        }
        $menuArr[0][0] = "<a href=\"index.php?fuse=domains&view=ShowDomainOverview\" $linkClass >".$this->user->lang('domain overview')."</a>";
        $menuArr[0][1] = 0;
        $menuArr[1][0] = '<a href="index.php?fuse=domains&view=ShowDomainOverview">'.$this->user->lang('overview').'</a>';
        $menuArr[1][1] = 1;
        $menuArr[1][2] = $selectedTab;
        
        if ($this->action == 'ManageDomain') {
            $selectedTab = 1;
            $linkClass = 'sel';
            $navlinks[] = $this->user->lang('Manage Domain');
            $menuArr[4][0] = "<a href=\"index.php?fuse=domains&view=ManageDomain&domainid=".$_GET['domainid']."\" $linkClass >".$this->user->lang('manage domain')."</a>";
            $menuArr[4][1] = 0;
            $menuArr[5][0] = '<a href="index.php?fuse=domains&view=ManageDomain&domainid='.$_GET['domainid'].'">'.$this->user->lang('manage domain').'</a>';
            $menuArr[5][1] = 1;
            $menuArr[5][2] = $selectedTab;
        }
        
        if ($this->user->hasPermission('domains_fetch')) {
            if ($this->action == 'FetchDomains') {
                $selectedTab = 1;
                $linkClass = 'sel';
                $navlinks[] = $this->user->lang('Fetch Domain');
            } else {
                $selectedTab = 0;
                $linkClass = '';
            }
            $menuArr[6][0] = "<a href=\"index.php?fuse=domains&view=FetchDomains\" $linkClass >".$this->user->lang('fetch domains')."</a>";
            $menuArr[6][1] = 0;
            $menuArr[7][0] = '<a href="index.php?fuse=domains&view=FetchDomains">'.$this->user->lang('fetch domains').'</a>';
            $menuArr[7][1] = 1;
            $menuArr[7][2] = $selectedTab;
        }

        return array('navlinks' => $navlinks, 'menus' => $menuArr);
    }

}

?>
