/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/fabrik.php'; $canDo = FabrikAdminHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_CRONS'), 'crons.png'); JToolBarHelper::custom('crons.run', 'upload.png', 'upload_f2.png', 'Run'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('cron.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('cron.edit', 'JTOOLBAR_EDIT'); } if ($canDo->get('core.edit.state')) { if ($this->state->get('filter.state') != 2) { JToolBarHelper::divider(); JToolBarHelper::custom('crons.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('crons.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } } if (JFactory::getUser()->authorise('core.manage', 'com_checkin')) { JToolBarHelper::custom('crons.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'cron.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('crons.trash', 'JTOOLBAR_TRASH'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_fabrik'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_FABRIK_CRONS', false, JText::_('JHELP_COMPONENTS_FABRIK_CRONS')); }
/** * Add the page title and toolbar. * * @return void */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/fabrik.php'; $canDo = FabrikAdminHelper::getActions(); if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_fabrik'); } }
/** * Add the page title and toolbar. * * @since 1.6 * * @return void */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/fabrik.php'; $canDo = FabrikAdminHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title(FText::_('COM_FABRIK_MANAGER_PACKAGES'), 'box-add'); /* if ($canDo->get('core.create')) { JToolBarHelper::addNew('package.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('package.edit', 'JTOOLBAR_EDIT'); } JToolBarHelper::custom('package.export', 'export.png', 'export_f2.png', 'COM_FABRIK_MANAGER_PACKAGE_EXPORT', true); if ($canDo->get('core.edit.state')) { if ($this->state->get('filter.state') != 2) { JToolBarHelper::divider(); JToolBarHelper::custom('packages.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('packages.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } } if (JFactory::getUser()->authorise('core.manage', 'com_checkin')) { JToolBarHelper::custom('packages.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'packages.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('packages.trash', 'JTOOLBAR_TRASH'); } */ if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_fabrik'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_FABRIK_PACKAGES', false, FText::_('JHELP_COMPONENTS_FABRIK_PACKAGES')); /* if (FabrikWorker::j3()) { JHtmlSidebar::setAction('index.php?option=com_fabrik&view=packages'); $publishOpts = JHtml::_('jgrid.publishedOptions', array('archived' => false)); JHtmlSidebar::addFilter( FText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', $publishOpts, 'value', 'text', $this->state->get('filter.published'), true) ); } */ }
/** * Add the page title and toolbar. * * @return void */ protected function addToolbar() { $app = JFactory::getApplication(); $input = $app->input; $input->set('hidemainmenu', true); $user = JFactory::getUser(); $isNew = $this->item->id == 0; $userId = $user->get('id'); $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); $canDo = FabrikAdminHelper::getActions($this->state->get('filter.category_id')); $title = $isNew ? FText::_('COM_FABRIK_MANAGER_GROUP_NEW') : FText::_('COM_FABRIK_MANAGER_GROUP_EDIT') . ' "' . $this->item->name . '"'; JToolBarHelper::title($title, 'group.png'); if ($isNew) { // For new records, check the create permission. if ($canDo->get('core.create')) { JToolBarHelper::apply('group.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('group.save', 'JTOOLBAR_SAVE'); JToolBarHelper::addNew('group.save2new', 'JTOOLBAR_SAVE_AND_NEW'); } JToolBarHelper::cancel('group.cancel', 'JTOOLBAR_CANCEL'); } else { // Can't save the record if it's checked out. if (!$checkedOut) { // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. if ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->created_by == $userId) { JToolBarHelper::apply('group.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('group.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see if we can return to make a new one. if ($canDo->get('core.create')) { JToolBarHelper::addNew('group.save2new', 'JTOOLBAR_SAVE_AND_NEW'); } } } if ($canDo->get('core.create')) { JToolBarHelper::custom('group.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } JToolBarHelper::cancel('group.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_FABRIK_GROUPS_EDIT', false, FText::_('JHELP_COMPONENTS_FABRIK_GROUPS_EDIT')); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/fabrik.php'; $canDo = FabrikAdminHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_ELEMENTS'), 'elements.png'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('element.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('element.edit', 'JTOOLBAR_EDIT'); } JToolBarHelper::custom('elements.copySelectGroup', 'copy.png', 'copy_f2.png', 'COM_FABRIK_COPY'); if ($canDo->get('core.edit.state')) { if ($this->state->get('filter.state') != 2) { JToolBarHelper::divider(); JToolBarHelper::custom('elements.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('elements.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } JToolBarHelper::divider(); JToolBarHelper::custom('elements.showInListView', 'publish.png', 'publish_f2.png', 'COM_FABRIK_SHOW_IN_LIST_VIEW', true); JToolBarHelper::custom('elements.hideFromListView', 'unpublish.png', 'unpublish_f2.png', 'COM_FABRIK_REMOVE_FROM_LIST_VIEW', true); } if (JFactory::getUser()->authorise('core.manage', 'com_checkin')) { JToolBarHelper::custom('elements.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'elements.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('elements.trash', 'JTOOLBAR_TRASH'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_fabrik'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_FABRIK_ELEMENTS', false, JText::_('JHELP_COMPONENTS_FABRIK_ELEMENTS')); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/fabrik.php'; $canDo = FabrikAdminHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_LISTS'), 'lists.png'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('list.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('list.edit', 'JTOOLBAR_EDIT'); } JToolBarHelper::custom('list.copy', 'copy.png', 'copy_f2.png', 'COM_FABRIK_COPY'); if ($canDo->get('core.edit.state')) { if ($this->state->get('filter.state') != 2) { JToolBarHelper::divider(); JToolBarHelper::custom('lists.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('lists.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } } JToolBarHelper::divider(); if ($canDo->get('core.create')) { JToolBarHelper::custom('import.display', 'upload.png', 'upload_f2.png', 'COM_FABRIK_IMPORT', false); } JToolBarHelper::divider(); if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'lists.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('lists.trash', 'JTOOLBAR_TRASH'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_fabrik'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_FABRIK_LISTS', false, JText::_('JHELP_COMPONENTS_FABRIK_LISTS')); }
/** * Add the page title and toolbar. * * @return void */ 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 == $user->get('id')); $canDo = FabrikAdminHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title($isNew ? JText::_('COM_FABRIK_MANAGER_FORM_NEW') : JText::_('COM_FABRIK_MANAGER_FORM_EDIT'), 'form.png'); if ($isNew) { // For new records, check the create permission. if ($canDo->get('core.create')) { JToolBarHelper::apply('form.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('form.save', 'JTOOLBAR_SAVE'); JToolBarHelper::addNew('form.save2new', 'JTOOLBAR_SAVE_AND_NEW'); } JToolBarHelper::cancel('form.cancel', 'JTOOLBAR_CANCEL'); } else { // Can't save the record if it's checked out. if (!$checkedOut) { // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. if ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->created_by == $userId) { JToolBarHelper::apply('form.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('form.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see if we can return to make a new one. if ($canDo->get('core.create')) { JToolBarHelper::addNew('form.save2new', 'JTOOLBAR_SAVE_AND_NEW'); } } } // $$$ rob no save as copy as this gets complicated due to renaming lists, groups etc. Users should copy from list view. JToolBarHelper::cancel('form.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_FABRIK_FORMS_EDIT', false, JText::_('JHELP_COMPONENTS_FABRIK_FORMS_EDIT')); }
/** * Add the page title and toolbar. * * @return void */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/fabrik.php'; $canDo = FabrikAdminHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_ELEMENTS'), 'elements.png'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('element.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('element.edit', 'JTOOLBAR_EDIT'); } JToolBarHelper::custom('elements.copySelectGroup', 'copy.png', 'copy_f2.png', 'COM_FABRIK_COPY'); if ($canDo->get('core.edit.state')) { if ($this->state->get('filter.state') != 2) { JToolBarHelper::divider(); JToolBarHelper::custom('elements.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('elements.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } JToolBarHelper::divider(); JToolBarHelper::custom('elements.showInListView', 'publish.png', 'publish_f2.png', 'COM_FABRIK_SHOW_IN_LIST_VIEW', true); JToolBarHelper::custom('elements.hideFromListView', 'unpublish.png', 'unpublish_f2.png', 'COM_FABRIK_REMOVE_FROM_LIST_VIEW', true); } if (JFactory::getUser()->authorise('core.manage', 'com_checkin')) { JToolBarHelper::custom('elements.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'elements.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('elements.trash', 'JTOOLBAR_TRASH'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_fabrik'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_FABRIK_ELEMENTS', false, JText::_('JHELP_COMPONENTS_FABRIK_ELEMENTS')); if (FabrikWorker::j3()) { JHtmlSidebar::setAction('index.php?option=com_fabrik&view=elements'); if (!empty($this->packageOptions)) { array_unshift($this->packageOptions, JHtml::_('select.option', 'fabrik', JText::_('COM_FABRIK_SELECT_PACKAGE'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'package', JHtml::_('select.options', $this->packageOptions, 'value', 'text', $this->state->get('com_fabrik.package'), true)); } JHtmlSidebar::addFilter(JText::_('COM_FABRIK_SELECT_PLUGIN'), 'filter_plugin', JHtml::_('select.options', $this->pluginOptions, 'value', 'text', $this->state->get('filter.plugin'), true)); JHtmlSidebar::addFilter(JText::_('COM_FABRIK_SELECT_FORM'), 'filter_form', JHtml::_('select.options', $this->formOptions, 'value', 'text', $this->state->get('filter.form'), true)); JHtmlSidebar::addFilter(JText::_('COM_FABRIK_SELECT_GROUP'), 'filter_group', JHtml::_('select.options', $this->groupOptions, 'value', 'text', $this->state->get('filter.group'), true)); $publishOpts = JHtml::_('jgrid.publishedOptions', array('archived' => false)); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', $publishOpts, 'value', 'text', $this->state->get('filter.published'), true)); JHtmlSidebar::addFilter(JText::_('COM_FABRIK_SELECT_SHOW_IN_LIST'), 'filter_showinlist', JHtml::_('select.options', $this->showInListOptions, 'value', 'text', $this->state->get('filter.showinlist'), true)); } }
/** * Add the page title and toolbar. * * @return void */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/fabrik.php'; $canDo = FabrikAdminHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_FABRIK_MANAGER_LISTS'), 'lists.png'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('list.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('list.edit', 'JTOOLBAR_EDIT'); } JToolBarHelper::custom('list.copy', 'copy.png', 'copy_f2.png', 'COM_FABRIK_COPY'); if ($canDo->get('core.edit.state')) { if ($this->state->get('filter.state') != 2) { JToolBarHelper::divider(); JToolBarHelper::custom('lists.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('lists.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } } JToolBarHelper::divider(); if ($canDo->get('core.create')) { JToolBarHelper::custom('import.display', 'upload.png', 'upload_f2.png', 'COM_FABRIK_IMPORT', false); } JToolBarHelper::divider(); if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'lists.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('lists.trash', 'JTOOLBAR_TRASH'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_fabrik'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_FABRIK_LISTS', false, JText::_('JHELP_COMPONENTS_FABRIK_LISTS')); if (FabrikWorker::j3()) { JHtmlSidebar::setAction('index.php?option=com_fabrik&view=lists'); $publishOpts = JHtml::_('jgrid.publishedOptions', array('archived' => false)); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', $publishOpts, 'value', 'text', $this->state->get('filter.published'), true)); if (!empty($this->packageOptions)) { array_unshift($this->packageOptions, JHtml::_('select.option', 'fabrik', JText::_('COM_FABRIK_SELECT_PACKAGE'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'package', JHtml::_('select.options', $this->packageOptions, 'value', 'text', $this->state->get('com_fabrik.package'), true)); } } }
/** * Add select content type tool bar * * @throws Exception * * @return void */ protected function addSelectSaveToolBar() { $app = JFactory::getApplication(); $this->state = $this->get('State'); $input = $app->input; $input->set('hidemainmenu', true); $canDo = FabrikAdminHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title(FText::_('COM_FABRIK_MANAGER_SELECT_CONTENT_TYPE'), 'puzzle'); // For new records, check the create permission. if ($canDo->get('core.create')) { JToolBarHelper::apply('form.doSave', 'JTOOLBAR_SAVE'); JToolBarHelper::cancel('form.cancel', 'JTOOLBAR_CANCEL'); } }