<?php

/**
* Parent class for menu hooks (to generate the menu dropdowns at the top of the screen)
*
* @package Newedge_API
* @abstract
*/
class NE_MenuHook
{
    /**
    * Configuration array
    *
    * @access protected
    * @see NE_Model::configuration
    * @var array
    */
    var $configuration;

    /**
    * Settings object.
    *
    * @access protected
    * @var Settings
    */
    var $settings;

    /**
    * The action or view's class name
    *
    * @access protected
    * @var string
    */
    var $action;


    /**
    * Logger object.
    *
    * @access protected
    * @var NE_Observable
    */
    var $logger;

    /**
    * The user object
    *
    * @access protected
    * @var User
    */
    var $user;

    /**
    * Description that will appear under the menu item, when viewed from the customer's section
    *
    * @access public
    */
    var $menuDescription;

    /**
    * The customer object, or false if logged-in user is an admin that hasn't selected a customer.
    *
    * @access protected
    * @var User
    */
    var $customer;

    var $modulesViews = array();

    /**
    * This is "package private" rather.
    *
    * @access private
    */
    function NE_MenuHook($action, &$user, &$customer)
    {
        $this->action = $action;
        $this->user =& $user;
        $this->customer =& $customer;
        $this->settings =& NE_Registry::getSettings();
        $this->configuration = NE_Registry::getConfiguration();
        $this->logger = NE_Registry::getLogger();
    }

    /**
    * Returns an array describing the Menu Items and tabs for this module. You must override this method.
    *
    * @abstract
    * @return array Each array item is a subarray of the form:<br>
    *               Array(  'navlinks'  => array of links composing the location label (to of the screen, next to the arrow, below the menus)
    *                       'menus'     => 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() {}

    function getModulesViews()
    {
        return $this->modulesViews;
    }

    function getMenuDescription()
    {
        return $this->menuDescription;
    }

    function addModulesViews($modulesViews)
    {
        $this->modulesViews[] = $modulesViews;
    }
}

?>
