english/administrator/components/com_menus/views/menu/view.html.php
/**
	 * Add the page title and toolbar.
	 *
	 * @since	1.6
	 */
Add the page title and toolbar.
Add the page title and toolbar .
protected function addToolbar()
	{
		JRequest::setVar('hidemainmenu', true);
		$user		= JFactory::getUser();
		$isNew		= ($this->item->id == 0);
		$canDo		= MenusHelper::getActions($this->state->get('filter.parent_id'));
		JToolBarHelper::title(JText::_($isNew ? 'COM_MENUS_VIEW_NEW_MENU_TITLE' : 'COM_MENUS_VIEW_EDIT_MENU_TITLE'), 'menu.png');
		if ($isNew && $canDo->get('core.create')) {
			if ($canDo->get('core.edit')) {
				JToolBarHelper::apply('menu.apply');
			}
			JToolBarHelper::save('menu.save');
		}
		if (!$isNew && $canDo->get('core.edit')) {
			JToolBarHelper::apply('menu.apply');
			JToolBarHelper::save('menu.save');
		}
		if ($canDo->get('core.create')) {
			JToolBarHelper::save2new('menu.save2new');
		}
		if ($isNew) {
			JToolBarHelper::cancel('menu.cancel');
		} else {
			JToolBarHelper::cancel('menu.cancel', 'JTOOLBAR_CLOSE');
		}
		JToolBarHelper::divider();
		JToolBarHelper::help('JHELP_MENUS_MENU_MANAGER_EDIT');
	}
protected function addToolbar ( ) { JRequest :: setVar ( 'hidemainmenu' , true ) ; $ user = JFactory :: getUser ( ) ; $ isNew = ( $ this -> item -> id == 0 ) ; $ canDo = MenusHelper :: getActions ( $ this -> state -> get ( 'filter.parent_id' ) ) ; JToolBarHelper :: title ( JText :: _ ( $ isNew ? 'COM_MENUS_VIEW_NEW_MENU_TITLE' : 'COM_MENUS_VIEW_EDIT_MENU_TITLE' ) , 'menu.png' ) ; if ( $ isNew && $ canDo -> get ( 'core.create' ) ) { if ( $ canDo -> get ( 'core.edit' ) ) { JToolBarHelper :: apply ( 'menu.apply' ) ; } JToolBarHelper :: save ( 'menu.save' ) ; } if ( ! $ isNew && $ canDo -> get ( 'core.edit' ) ) { JToolBarHelper :: apply ( 'menu.apply' ) ; JToolBarHelper :: save ( 'menu.save' ) ; } if ( $ canDo -> get ( 'core.create' ) ) { JToolBarHelper :: save2new ( 'menu.save2new' ) ; } if ( $ isNew ) { JToolBarHelper :: cancel ( 'menu.cancel' ) ; } else { JToolBarHelper :: cancel ( 'menu.cancel' , 'JTOOLBAR_CLOSE' ) ; } JToolBarHelper :: divider ( ) ; JToolBarHelper :: help ( 'JHELP_MENUS_MENU_MANAGER_EDIT' ) ; }
Add the page title and toolbar.
Add the page title and toolbar .
// If a new item, can save the item.  Allow users with edit permissions to apply changes to prevent returning to grid. // If user can edit, can save the item. // If the user can create new items, allow them to see Save & New