/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { $canDo = Jnt_HanhPhucHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title(JText::_('Hanhphuc.vn: Orders Manager'), 'banners.png'); if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_jnt_hanhphuc'); } }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/jnt_hanhphuc.php'; $canDo = Jnt_HanhPhucHelper::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', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('banner.edit', 'JTOOLBAR_EDIT'); } if ($canDo->get('core.edit.state')) { if ($this->state->get('filter.state') != 2) { JToolBarHelper::divider(); JToolBarHelper::custom('banners.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('banners.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } if ($this->state->get('filter.state') != -1) { JToolBarHelper::divider(); if ($this->state->get('filter.state') != 2) { JToolBarHelper::archiveList('banners.archive', 'JTOOLBAR_ARCHIVE'); } else { if ($this->state->get('filter.state') == 2) { JToolBarHelper::unarchiveList('banners.publish', 'JTOOLBAR_UNARCHIVE'); } } } } if ($canDo->get('core.edit.state')) { JToolBarHelper::custom('banners.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } if ($canDo->get('core.edit.state')) { JToolBarHelper::trash('banners.trash', 'JTOOLBAR_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. * * @since 1.6 */ protected function addToolbar() { $user = JFactory::getUser(); $userId = $user->get('id'); $isNew = $this->item->id == 0; $checkedOut = false; $canDo = Jnt_HanhPhucHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title($isNew ? 'Hanhphuc.vn: New Service' : 'Hanhphuc.vn: Service detail', 'banners.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('service.edit') || $canDo->get('core.create'))) { JToolBarHelper::apply('service.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('service.save', 'JTOOLBAR_SAVE'); JToolbarHelper::save2new('service.save2new'); } if (empty($this->item->id)) { JToolBarHelper::cancel('service.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('service.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->get('id'); $isNew = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); $canDo = Jnt_HanhPhucHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title($isNew ? 'New Services' : 'Service detail', 'banners.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('service.edit') || $canDo->get('core.create'))) { JToolBarHelper::apply('service.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('service.save', 'JTOOLBAR_SAVE'); } if (empty($this->item->id)) { JToolBarHelper::cancel('service.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('service.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS_EDIT'); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { $canDo = Jnt_HanhPhucHelper::getActions($this->state->get('filter.category_id')); $user = JFactory::getUser(); JToolBarHelper::title(JText::_('Hanhphuc.vn: Manager Services'), 'banners.png'); if (count($user->getAuthorisedCategories('com_jnt_hanhphuc', 'core.create')) > 0) { JToolBarHelper::addNew('service.add'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('service.edit'); } if ($canDo->get('core.edit.state')) { if ($this->state->get('filter.state') != 2) { JToolBarHelper::divider(); JToolBarHelper::publish('services.publish', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::unpublish('services.unpublish', 'JTOOLBAR_UNPUBLISH', true); } if ($this->state->get('filter.state') != -1) { JToolBarHelper::divider(); if ($this->state->get('filter.state') == 2) { JToolBarHelper::unarchiveList('banners.publish'); } } } if ($canDo->get('core.edit.state')) { JToolBarHelper::checkin('services.checkin'); } if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'services.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('services.trash'); JToolBarHelper::divider(); } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_jnt_hanhphuc'); } }