<?php

/**
* @package Home
*/
class Home_menu extends NE_MenuHook
{
    var $modulesViews = array(
        array('home', 'ShowSummary'),
        array('home', 'ShowRecommendUs'),
    );

    function getMenuArr()
    {
        $tArray = array();
        $tSubArray = array();
        $navlinks = array();
        $options = false;
        
        if ($this->user->hasPermission('home_view') && !$this->user->isAnonymous()) {
            if ($this->action == 'ShowSummary'){
                $tSubArray[0] = "<a href=\"index.php?fuse=home&amp;view=ShowSummary\" class='sel'>".strtolower($this->user->lang("overview"))."</a>";
                $tSubArray[1] = 0;
                $tArray[] = $tSubArray;
            } else {
                $tSubArray[0] = "<a href=\"index.php?fuse=home&amp;view=ShowSummary\">".strtolower($this->user->lang("overview"))."</a>";
                $tSubArray[1] = 0;
                $tArray[] = $tSubArray;
            }
            $options = true;
        }
        if($this->user->getGroupID() != ROLE_SUPERADMIN && $this->user->hasPermission('home_view_recommend_us')){
            if ($this->action == 'ShowRecommendUs'){
                $tSubArray[0] = "<a href=\"index.php?fuse=home&amp;view=ShowRecommendUs\" class='sel'>".strtolower($this->user->lang("Recommend Us"));
                $tSubArray[1] = 0;
                $tArray[] = $tSubArray;
            } else {
                $tSubArray[0] = "<a href=\"index.php?fuse=home&amp;view=ShowRecommendUs\">".strtolower($this->user->lang("Recommend Us"))."</a>";
                $tSubArray[1] = 0;
                $tArray[] = $tSubArray;
            }
            $options = true;
        }
        
        if ($this->action == 'ShowRecommendUs' || ($this->action == 'ShowSummary')) {
            
            if ($this->action == 'ShowSummary') {
                $tSubArray[0] = strtolower($this->user->lang("viewing overview"));
                $tSubArray[1] = 1;
                $tSubArray[2] = 1;
                $tArray[] = $tSubArray;
                $navlinks[] = $tSubArray[0];
            } else {
                $tSubArray[0] = "<a href=\"index.php?fuse=home&amp;view=ShowSummary\">".strtolower($this->user->lang("overview"))."</a>";
                $tSubArray[1] = 1;
                $tSubArray[2] = 0;
                $tArray[] = $tSubArray;
            }
            if(!$this->user->isAdmin()){
                if ($this->action == 'ShowRecommendUs'){
                    $tSubArray[0] = strtolower($this->user->lang("Recommend Us"));
                    $tSubArray[1] = 1;
                    $tSubArray[2] = 1;
                    $tArray[] = $tSubArray;
                    $navlinks[] = $tSubArray[0];
                } elseif ($this->user->hasPermission('home_view_recommend_us')) {
                    $tSubArray[0] = "<a href=\"index.php?fuse=home&amp;view=ShowRecommendUs\">".strtolower($this->user->lang("Recommend Us"))."</a>";
                    $tSubArray[1] = 1;
                    $tSubArray[2] = 0;
                    $tArray[] = $tSubArray;
                }
            }
        }
        if($options){
            return array('navlinks' => $navlinks, 'menus' => $tArray);
        }else{
            return;
        }
    }
}

?>
