/** * Add the page title and toolbar. * * @return void * * @since 1.0.0 */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $isNew = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); $canDo = CMDonationHelper::getActions(); JToolbarHelper::title(JText::_('COM_CMDONATION_MANAGER_DONATIONS'), 'donation icon-heart-2'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolbarHelper::apply('donation.apply'); JToolbarHelper::save('donation.save'); } if (!$checkedOut && $canDo->get('core.create')) { JToolbarHelper::save2new('donation.save2new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolbarHelper::save2copy('donation.save2copy'); } if (empty($this->item->id)) { JToolbarHelper::cancel('donation.cancel'); } else { JToolbarHelper::cancel('donation.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Add the page title and toolbar. * * @return void * * @since 1.0.0 */ protected function addToolbar() { $canDo = CMDonationHelper::getActions(); JToolbarHelper::title(JText::_('COM_CMDONATION_MANAGER_DASHBOARD'), 'dashboard.png'); if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_cmdonation'); } }
/** * Add the page title and toolbar. * * @return void * * @since 1.0.0 */ protected function addToolbar() { $state = $this->get('State'); $canDo = CMDonationHelper::getActions(); JToolbarHelper::title(JText::_('COM_CMDONATION_MANAGER_DONATIONS'), 'donation icon-heart-2'); if ($canDo->get('core.create')) { JToolbarHelper::addNew('donation.add'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('donation.edit'); } if ($canDo->get('core.edit.state')) { JToolbarHelper::checkin('donations.checkin'); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList(JText::_('COM_CMDONATION_WARNING_DELETE_ITEMS'), 'donations.delete'); } }