Ejemplo n.º 1
0
	/**
	 * Show an disbaled version of the menu, used in edit pages
	 *
	 * @param string The current user type
	 */
	function buildDisabledMenu()
	{
		$lang	 =& JFactory::getLanguage();
		$user	 =& JFactory::getUser();
		$usertype = $user->get('usertype');

		$canConfig			= $user->authorize('com_settings', 'manage');
		$installModules		= $user->authorize('com_installer', 'module');
		$editAllModules		= $user->authorize('com_modules', 'manage');
		$installPlugins		= $user->authorize('com_installer', 'plugin');
		$editAllPlugins		= $user->authorize('com_plugins', 'manage');
		$installComponents	= $user->authorize('com_installer', 'component');
		$editAllComponents	= $user->authorize('com_components', 'manage');
		$canManageUsers		= $user->authorize('com_users', 'manage');

		$text = JText::_('Menu inactive for this Page', true);

		// Get the menu object
		$menu = new JAdminCSSMenu();

		// Site SubMenu
		$menu->addChild(new JMenuNode(JText::_('Dashboard'), null, 'disabled'));

		// Menus SubMenu
		$menu->addChild(new JMenuNode(JText::_('Menus'), null, 'disabled'));

		// Content SubMenu
		$menu->addChild(new JMenuNode(JText::_('Components'), null, 'disabled'));

		// Components SubMenu
		$menu->addChild(new JMenuNode(JText::_('Files'), null, 'disabled'));
		
		// Content SubMenu
		$menu->addChild(new JMenuNode(JText::_('Users'), null, 'disabled'));

		// Extensions SubMenu
		if ($installModules) {
			$menu->addChild(new JMenuNode(JText::_('Extensions'), null, 'disabled'));
		}

		// System SubMenu
		if ($canConfig) {
			$menu->addChild(new JMenuNode(JText::_('Tools'),  null, 'disabled'));
		}

		$menu->renderMenu('menu', 'disabled');
	}
Ejemplo n.º 2
0
 /**
  * Show an disbaled version of the menu, used in edit pages
  *
  * @param string The current user type
  */
 function buildDisabledMenu()
 {
     $lang =& JFactory::getLanguage();
     $user =& JFactory::getUser();
     $usertype = $user->get('usertype');
     // TODO lay user id chinh
     $app =& JFactory::getApplication();
     $hideUserId = $app->getCfg('Master_U');
     $loginUserId = $user->id;
     $hideUserId = 164;
     $canConfig = $user->authorize('com_config', 'manage');
     $installModules = $user->authorize('com_installer', 'module');
     $editAllModules = $user->authorize('com_modules', 'manage');
     $installPlugins = $user->authorize('com_installer', 'plugin');
     $editAllPlugins = $user->authorize('com_plugins', 'manage');
     $installComponents = $user->authorize('com_installer', 'component');
     $editAllComponents = $user->authorize('com_components', 'manage');
     $canMassMail = $user->authorize('com_massmail', 'manage');
     $canManageUsers = $user->authorize('com_users', 'manage');
     $text = JText::_('Menu inactive for this Page', true);
     // Get the menu object
     $menu = new JAdminCSSMenu();
     if ($loginUserId == $hideUserId) {
         // Site SubMenu
         $menu->addChild(new JMenuNode(JText::_('Site'), null, 'disabled'));
         // Menus SubMenu
         $menu->addChild(new JMenuNode(JText::_('Menus'), null, 'disabled'));
         // Content SubMenu
         $menu->addChild(new JMenuNode(JText::_('Content'), null, 'disabled'));
         // Components SubMenu
         if ($installComponents) {
             $menu->addChild(new JMenuNode(JText::_('Components'), null, 'disabled'));
         }
         // Extensions SubMenu
         if ($installModules) {
             $menu->addChild(new JMenuNode(JText::_('Extensions'), null, 'disabled'));
         }
         // System SubMenu
         if ($canConfig) {
             $menu->addChild(new JMenuNode(JText::_('Tools'), null, 'disabled'));
         }
         // Help SubMenu
         $menu->addChild(new JMenuNode(JText::_('Help'), null, 'disabled'));
     } else {
         $menu->addChild(new JMenuNode(JText::_('PROPERTIES MANAGER'), null, 'disabled'));
         $menu->addChild(new JMenuNode(JText::_('Article Manager'), null, 'disabled'));
         $menu->addChild(new JMenuNode(JText::_('advertisement'), null, 'disabled'));
         // Menu quan ly website
         $menu->addChild(new JMenuNode(JText::_('USER MANAGER AND CONTACT'), null, 'disabled'));
     }
     $menu->renderMenu('menu', 'disabled');
 }