<?php
namespace App\Menu\Structure;

class CurrentUserMenu extends \App\Menu\Structure\Menu
{
	/**
	 * Stores the singleton instantiation of the current class.
	 * @var \App\Menu\Structure\Menu
	 */
	static protected $instance;

	/**
	* Singleton instantiation of the current class.
	* Needed because plugins should be able to inject sections in the global menu
	* @return \App\Menu\Structure\Menu
	*/
	static public function getInstance()
	{
		if (!static::$instance) {
			static::$instance=new self();
			static::$instance->loadFromXml(APP_REAL_PATH.'_config/application/menuXML2-simple.cfg.php');
		}
		return static::$instance;
	}


	/**
	 * The class constructor - called only from singleton instantiation.
	 */
	protected function __construct()
	{
		$this->setUserAccess(\App\UserAccess\CurrentUserAccessFast::getInstance());
	}

}