english/administrator/components/com_weblinks/views/weblink/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);
		$checkedOut	= !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
		$canDo		= WeblinksHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
		JToolBarHelper::title(JText::_('COM_WEBLINKS_MANAGER_WEBLINK'), 'weblinks.png');
		if (!$checkedOut && ($canDo->get('core.edit')||(count($user->getAuthorisedCategories('com_weblinks', 'core.create')))))
		{
			JToolBarHelper::apply('weblink.apply');
			JToolBarHelper::save('weblink.save');
		}
		if (!$checkedOut && (count($user->getAuthorisedCategories('com_weblinks', 'core.create')))){
			JToolBarHelper::save2new('weblink.save2new');
		}
		if (!$isNew && (count($user->getAuthorisedCategories('com_weblinks', 'core.create')) > 0)) {
			JToolBarHelper::save2copy('weblink.save2copy');
		}
		if (empty($this->item->id)) {
			JToolBarHelper::cancel('weblink.cancel');
		}
		else {
			JToolBarHelper::cancel('weblink.cancel', 'JTOOLBAR_CLOSE');
		}
		JToolBarHelper::divider();
		JToolBarHelper::help('JHELP_COMPONENTS_WEBLINKS_LINKS_EDIT');
	}
protected function addToolbar ( ) { JRequest :: setVar ( 'hidemainmenu' , true ) ; $ user = JFactory :: getUser ( ) ; $ isNew = ( $ this -> item -> id == 0 ) ; $ checkedOut = ! ( $ this -> item -> checked_out == 0 || $ this -> item -> checked_out == $ user -> get ( 'id' ) ) ; $ canDo = WeblinksHelper :: getActions ( $ this -> state -> get ( 'filter.category_id' ) , $ this -> item -> id ) ; JToolBarHelper :: title ( JText :: _ ( 'COM_WEBLINKS_MANAGER_WEBLINK' ) , 'weblinks.png' ) ; if ( ! $ checkedOut && ( $ canDo -> get ( 'core.edit' ) || ( count ( $ user -> getAuthorisedCategories ( 'com_weblinks' , 'core.create' ) ) ) ) ) { JToolBarHelper :: apply ( 'weblink.apply' ) ; JToolBarHelper :: save ( 'weblink.save' ) ; } if ( ! $ checkedOut && ( count ( $ user -> getAuthorisedCategories ( 'com_weblinks' , 'core.create' ) ) ) ) { JToolBarHelper :: save2new ( 'weblink.save2new' ) ; } if ( ! $ isNew && ( count ( $ user -> getAuthorisedCategories ( 'com_weblinks' , 'core.create' ) ) > 0 ) ) { JToolBarHelper :: save2copy ( 'weblink.save2copy' ) ; } if ( empty ( $ this -> item -> id ) ) { JToolBarHelper :: cancel ( 'weblink.cancel' ) ; } else { JToolBarHelper :: cancel ( 'weblink.cancel' , 'JTOOLBAR_CLOSE' ) ; } JToolBarHelper :: divider ( ) ; JToolBarHelper :: help ( 'JHELP_COMPONENTS_WEBLINKS_LINKS_EDIT' ) ; }
Add the page title and toolbar.
Add the page title and toolbar .
// If not checked out, can save the item. // If an existing item, can save to a copy.