english/administrator/components/com_banners/views/banners/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()
	{
		require_once JPATH_COMPONENT.'/helpers/banners.php';
		$canDo	= BannersHelper::getActions($this->state->get('filter.category_id'));
		$user	= JFactory::getUser();
		JToolBarHelper::title(JText::_('COM_BANNERS_MANAGER_BANNERS'), 'banners.png');
		if (count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0) {
			JToolBarHelper::addNew('banner.add');
		}
		if (($canDo->get('core.edit'))) {
			JToolBarHelper::editList('banner.edit');
		}
		if ($canDo->get('core.edit.state')) {
			if ($this->state->get('filter.state') != 2){
				JToolBarHelper::divider();
				JToolBarHelper::publish('banners.publish', 'JTOOLBAR_PUBLISH', true);
				JToolBarHelper::unpublish('banners.unpublish', 'JTOOLBAR_UNPUBLISH', true);
			}
			if ($this->state->get('filter.state') != -1 ) {
				JToolBarHelper::divider();
				if ($this->state->get('filter.state') != 2) {
					JToolBarHelper::archiveList('banners.archive');
				}
				else if ($this->state->get('filter.state') == 2) {
					JToolBarHelper::unarchiveList('banners.publish');
				}
			}
		}
		if ($canDo->get('core.edit.state')) {
			JToolBarHelper::checkin('banners.checkin');
		}
		if ($canDo->get('core.edit.state')) {
			JToolBarHelper::trash('banners.trash');
		}
		if ( $canDo->get('core.delete')) {
			JToolBarHelper::deleteList('', 'banners.delete', 'JTOOLBAR_EMPTY_TRASH');
			JToolBarHelper::divider();
		}
		if ($canDo->get('core.admin')) {
			JToolBarHelper::preferences('com_banners');
			JToolBarHelper::divider();
		}
		JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS');
	}
protected function addToolbar ( ) { require_once JPATH_COMPONENT . '/helpers/banners.php' ; $ canDo = BannersHelper :: getActions ( $ this -> state -> get ( 'filter.category_id' ) ) ; $ user = JFactory :: getUser ( ) ; JToolBarHelper :: title ( JText :: _ ( 'COM_BANNERS_MANAGER_BANNERS' ) , 'banners.png' ) ; if ( count ( $ user -> getAuthorisedCategories ( 'com_banners' , 'core.create' ) ) > 0 ) { JToolBarHelper :: addNew ( 'banner.add' ) ; } if ( ( $ canDo -> get ( 'core.edit' ) ) ) { JToolBarHelper :: editList ( 'banner.edit' ) ; } if ( $ canDo -> get ( 'core.edit.state' ) ) { if ( $ this -> state -> get ( 'filter.state' ) != 2 ) { JToolBarHelper :: divider ( ) ; JToolBarHelper :: publish ( 'banners.publish' , 'JTOOLBAR_PUBLISH' , true ) ; JToolBarHelper :: unpublish ( 'banners.unpublish' , 'JTOOLBAR_UNPUBLISH' , true ) ; } if ( $ this -> state -> get ( 'filter.state' ) != - 1 ) { JToolBarHelper :: divider ( ) ; if ( $ this -> state -> get ( 'filter.state' ) != 2 ) { JToolBarHelper :: archiveList ( 'banners.archive' ) ; } else if ( $ this -> state -> get ( 'filter.state' ) == 2 ) { JToolBarHelper :: unarchiveList ( 'banners.publish' ) ; } } } if ( $ canDo -> get ( 'core.edit.state' ) ) { JToolBarHelper :: checkin ( 'banners.checkin' ) ; } if ( $ canDo -> get ( 'core.edit.state' ) ) { JToolBarHelper :: trash ( 'banners.trash' ) ; } if ( $ canDo -> get ( 'core.delete' ) ) { JToolBarHelper :: deleteList ( '' , 'banners.delete' , 'JTOOLBAR_EMPTY_TRASH' ) ; JToolBarHelper :: divider ( ) ; } if ( $ canDo -> get ( 'core.admin' ) ) { JToolBarHelper :: preferences ( 'com_banners' ) ; JToolBarHelper :: divider ( ) ; } JToolBarHelper :: help ( 'JHELP_COMPONENTS_BANNERS_BANNERS' ) ; }
Add the page title and toolbar.
Add the page title and toolbar .