/** * Setting the toolbar */ protected function addToolBar() { JToolBarHelper::title(JText::_('COM_COSTBENEFITPROJECTION_CURRENCIES'), 'credit'); JHtmlSidebar::setAction('index.php?option=com_costbenefitprojection&view=currencies'); JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { JToolBarHelper::addNew('currency.add'); } // Only load if there are items if (CostbenefitprojectionHelper::checkArray($this->items)) { if ($this->canEdit) { JToolBarHelper::editList('currency.edit'); } if ($this->canState) { JToolBarHelper::publishList('currencies.publish'); JToolBarHelper::unpublishList('currencies.unpublish'); JToolBarHelper::archiveList('currencies.archive'); if ($this->canDo->get('core.admin')) { JToolBarHelper::checkin('currencies.checkin'); } } // Add a batch button if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); // set the batch button name $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { JToolbarHelper::deleteList('', 'currencies.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { JToolbarHelper::trash('currencies.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('currency.export')) { JToolBarHelper::custom('currencies.exportData', 'download', '', 'COM_COSTBENEFITPROJECTION_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('currency.import')) { JToolBarHelper::custom('currencies.importData', 'upload', '', 'COM_COSTBENEFITPROJECTION_IMPORT_DATA', false); } // set help url for this view if found $help_url = CostbenefitprojectionHelper::getHelpUrl('currencies'); if (CostbenefitprojectionHelper::checkString($help_url)) { JToolbarHelper::help('COM_COSTBENEFITPROJECTION_HELP_MANAGER', false, $help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); } if ($this->canState) { JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)); // only load if batch allowed if ($this->canBatch) { JHtmlBatch_::addListSelection(JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), 'batch[published]', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)); } } JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection(JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), 'batch[access]', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')); } }
/** * Setting the toolbar */ protected function addToolBar() { JToolBarHelper::title(JText::_('COM_COSTBENEFITPROJECTION_INTERVENTIONS'), 'wand'); JHtmlSidebar::setAction('index.php?option=com_costbenefitprojection&view=interventions'); JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { JToolBarHelper::addNew('intervention.add'); } // Only load if there are items if (CostbenefitprojectionHelper::checkArray($this->items)) { if ($this->canEdit) { JToolBarHelper::editList('intervention.edit'); } if ($this->canState) { JToolBarHelper::publishList('interventions.publish'); JToolBarHelper::unpublishList('interventions.unpublish'); JToolBarHelper::archiveList('interventions.archive'); if ($this->canDo->get('core.admin')) { JToolBarHelper::checkin('interventions.checkin'); } } // Add a batch button if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); // set the batch button name $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { JToolbarHelper::deleteList('', 'interventions.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { JToolbarHelper::trash('interventions.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('intervention.export')) { JToolBarHelper::custom('interventions.exportData', 'download', '', 'COM_COSTBENEFITPROJECTION_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('intervention.import')) { JToolBarHelper::custom('interventions.importData', 'upload', '', 'COM_COSTBENEFITPROJECTION_IMPORT_DATA', false); } // set help url for this view if found $help_url = CostbenefitprojectionHelper::getHelpUrl('interventions'); if (CostbenefitprojectionHelper::checkString($help_url)) { JToolbarHelper::help('COM_COSTBENEFITPROJECTION_HELP_MANAGER', false, $help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); } if ($this->canState) { JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)); // only load if batch allowed if ($this->canBatch) { JHtmlBatch_::addListSelection(JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), 'batch[published]', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)); } } JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection(JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), 'batch[access]', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')); } // Set Company Name Selection $this->companyNameOptions = JFormHelper::loadFieldType('Company')->getOptions(); if ($this->companyNameOptions) { // Company Name Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COMPANY_LABEL') . ' -', 'filter_company', JHtml::_('select.options', $this->companyNameOptions, 'value', 'text', $this->state->get('filter.company'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Company Name Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COMPANY_LABEL') . ' -', 'batch[company]', JHtml::_('select.options', $this->companyNameOptions, 'value', 'text')); } } // Set Type Selection $this->typeOptions = $this->getTheTypeSelections(); if ($this->typeOptions) { // Type Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_TYPE_LABEL') . ' -', 'filter_type', JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Type Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_TYPE_LABEL') . ' -', 'batch[type]', JHtml::_('select.options', $this->typeOptions, 'value', 'text')); } } // Set Coverage Selection $this->coverageOptions = $this->getTheCoverageSelections(); if ($this->coverageOptions) { // Coverage Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COVERAGE_LABEL') . ' -', 'filter_coverage', JHtml::_('select.options', $this->coverageOptions, 'value', 'text', $this->state->get('filter.coverage'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Coverage Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COVERAGE_LABEL') . ' -', 'batch[coverage]', JHtml::_('select.options', $this->coverageOptions, 'value', 'text')); } } // Set Duration Selection $this->durationOptions = $this->getTheDurationSelections(); if ($this->durationOptions) { // Duration Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_DURATION_LABEL') . ' -', 'filter_duration', JHtml::_('select.options', $this->durationOptions, 'value', 'text', $this->state->get('filter.duration'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Duration Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_DURATION_LABEL') . ' -', 'batch[duration]', JHtml::_('select.options', $this->durationOptions, 'value', 'text')); } } }
/** * Setting the toolbar */ protected function addToolBar() { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS'), 'support'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=help_documents'); JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { JToolBarHelper::addNew('help_document.add'); } // Only load if there are items if (ComponentbuilderHelper::checkArray($this->items)) { if ($this->canEdit) { JToolBarHelper::editList('help_document.edit'); } if ($this->canState) { JToolBarHelper::publishList('help_documents.publish'); JToolBarHelper::unpublishList('help_documents.unpublish'); JToolBarHelper::archiveList('help_documents.archive'); if ($this->canDo->get('core.admin')) { JToolBarHelper::checkin('help_documents.checkin'); } } // Add a batch button if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); // set the batch button name $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { JToolbarHelper::deleteList('', 'help_documents.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { JToolbarHelper::trash('help_documents.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('help_document.export')) { JToolBarHelper::custom('help_documents.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('help_document.import')) { JToolBarHelper::custom('help_documents.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $help_url = ComponentbuilderHelper::getHelpUrl('help_documents'); if (ComponentbuilderHelper::checkString($help_url)) { JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); } if ($this->canState) { JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)); // only load if batch allowed if ($this->canBatch) { JHtmlBatch_::addListSelection(JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)); } } JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection(JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')); } // Set Type Selection $this->typeOptions = $this->getTheTypeSelections(); if ($this->typeOptions) { // Type Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL') . ' -', 'filter_type', JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Type Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL') . ' -', 'batch[type]', JHtml::_('select.options', $this->typeOptions, 'value', 'text')); } } // Set Location Selection $this->locationOptions = $this->getTheLocationSelections(); if ($this->locationOptions) { // Location Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL') . ' -', 'filter_location', JHtml::_('select.options', $this->locationOptions, 'value', 'text', $this->state->get('filter.location'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Location Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL') . ' -', 'batch[location]', JHtml::_('select.options', $this->locationOptions, 'value', 'text')); } } // Set Admin View Selection $this->admin_viewOptions = JFormHelper::loadFieldType('Adminviewfolderlist')->getOptions(); if ($this->admin_viewOptions) { // Admin View Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL') . ' -', 'filter_admin_view', JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text', $this->state->get('filter.admin_view'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Admin View Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL') . ' -', 'batch[admin_view]', JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text')); } } // Set Site View Selection $this->site_viewOptions = JFormHelper::loadFieldType('Siteviewfolderlist')->getOptions(); if ($this->site_viewOptions) { // Site View Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL') . ' -', 'filter_site_view', JHtml::_('select.options', $this->site_viewOptions, 'value', 'text', $this->state->get('filter.site_view'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Site View Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL') . ' -', 'batch[site_view]', JHtml::_('select.options', $this->site_viewOptions, 'value', 'text')); } } }
/** * Setting the toolbar */ protected function addToolBar() { JToolBarHelper::title(JText::_('COM_COSTBENEFITPROJECTION_COMPANIES'), 'vcard'); JHtmlSidebar::setAction('index.php?option=com_costbenefitprojection&view=companies'); JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { JToolBarHelper::addNew('company.add'); } // Only load if there are items if (CostbenefitprojectionHelper::checkArray($this->items)) { if ($this->canEdit) { JToolBarHelper::editList('company.edit'); } if ($this->canState) { JToolBarHelper::publishList('companies.publish'); JToolBarHelper::unpublishList('companies.unpublish'); JToolBarHelper::archiveList('companies.archive'); if ($this->canDo->get('core.admin')) { JToolBarHelper::checkin('companies.checkin'); } } // Add a batch button if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); // set the batch button name $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($this->canDo->get('combinedresults.access')) { // add Combined Results button. JToolBarHelper::custom('companies.redirectToCombinedresults', 'cogs', '', 'COM_COSTBENEFITPROJECTION_COMBINEDRESULTS', true); } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { JToolbarHelper::deleteList('', 'companies.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { JToolbarHelper::trash('companies.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('company.export')) { JToolBarHelper::custom('companies.exportData', 'download', '', 'COM_COSTBENEFITPROJECTION_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('company.import')) { JToolBarHelper::custom('companies.importData', 'upload', '', 'COM_COSTBENEFITPROJECTION_IMPORT_DATA', false); } // set help url for this view if found $help_url = CostbenefitprojectionHelper::getHelpUrl('companies'); if (CostbenefitprojectionHelper::checkString($help_url)) { JToolbarHelper::help('COM_COSTBENEFITPROJECTION_HELP_MANAGER', false, $help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); } if ($this->canState) { JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)); // only load if batch allowed if ($this->canBatch) { JHtmlBatch_::addListSelection(JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), 'batch[published]', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)); } } JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection(JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), 'batch[access]', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')); } // Set Department Selection $this->departmentOptions = $this->getTheDepartmentSelections(); if ($this->departmentOptions) { // Department Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_COMPANY_DEPARTMENT_LABEL') . ' -', 'filter_department', JHtml::_('select.options', $this->departmentOptions, 'value', 'text', $this->state->get('filter.department'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Department Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_COMPANY_DEPARTMENT_LABEL') . ' -', 'batch[department]', JHtml::_('select.options', $this->departmentOptions, 'value', 'text')); } } // Set Country Name Selection $this->countryNameOptions = JFormHelper::loadFieldType('Countries')->getOptions(); if ($this->countryNameOptions) { // Country Name Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_COMPANY_COUNTRY_LABEL') . ' -', 'filter_country', JHtml::_('select.options', $this->countryNameOptions, 'value', 'text', $this->state->get('filter.country'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Country Name Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_COMPANY_COUNTRY_LABEL') . ' -', 'batch[country]', JHtml::_('select.options', $this->countryNameOptions, 'value', 'text')); } } // Set Service Provider User Selection $this->service_providerUserOptions = JFormHelper::loadFieldType('Serviceprovider')->getOptions(); if ($this->service_providerUserOptions) { // Service Provider User Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_COMPANY_SERVICE_PROVIDER_LABEL') . ' -', 'filter_service_provider', JHtml::_('select.options', $this->service_providerUserOptions, 'value', 'text', $this->state->get('filter.service_provider'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Service Provider User Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_COMPANY_SERVICE_PROVIDER_LABEL') . ' -', 'batch[service_provider]', JHtml::_('select.options', $this->service_providerUserOptions, 'value', 'text')); } } // Set Per Selection $this->perOptions = $this->getThePerSelections(); if ($this->perOptions) { // Per Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_COMPANY_PER_LABEL') . ' -', 'filter_per', JHtml::_('select.options', $this->perOptions, 'value', 'text', $this->state->get('filter.per'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Per Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_COMPANY_PER_LABEL') . ' -', 'batch[per]', JHtml::_('select.options', $this->perOptions, 'value', 'text')); } } }
/** * Setting the toolbar */ protected function addToolBar() { JToolBarHelper::title(JText::_('COM_DEMO_LOOKS'), 'eye-open'); JHtmlSidebar::setAction('index.php?option=com_demo&view=looks'); JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { JToolBarHelper::addNew('look.add'); } // Only load if there are items if (DemoHelper::checkArray($this->items)) { if ($this->canEdit) { JToolBarHelper::editList('look.edit'); } if ($this->canState) { JToolBarHelper::publishList('looks.publish'); JToolBarHelper::unpublishList('looks.unpublish'); JToolBarHelper::archiveList('looks.archive'); if ($this->canDo->get('core.admin')) { JToolBarHelper::checkin('looks.checkin'); } } // Add a batch button if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); // set the batch button name $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { JToolbarHelper::deleteList('', 'looks.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { JToolbarHelper::trash('looks.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('look.export')) { JToolBarHelper::custom('looks.exportData', 'download', '', 'COM_DEMO_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('look.import')) { JToolBarHelper::custom('looks.importData', 'upload', '', 'COM_DEMO_IMPORT_DATA', false); } // set help url for this view if found $help_url = DemoHelper::getHelpUrl('looks'); if (DemoHelper::checkString($help_url)) { JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_demo'); } if ($this->canState) { JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)); // only load if batch allowed if ($this->canBatch) { JHtmlBatch_::addListSelection(JText::_('COM_DEMO_KEEP_ORIGINAL_STATE'), 'batch[published]', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)); } } JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection(JText::_('COM_DEMO_KEEP_ORIGINAL_ACCESS'), 'batch[access]', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')); } // Set Add Selection $this->addOptions = $this->getTheAddSelections(); if ($this->addOptions) { // Add Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_DEMO_LOOK_ADD_LABEL') . ' -', 'filter_add', JHtml::_('select.options', $this->addOptions, 'value', 'text', $this->state->get('filter.add'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Add Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_DEMO_LOOK_ADD_LABEL') . ' -', 'batch[add]', JHtml::_('select.options', $this->addOptions, 'value', 'text')); } } // Set Acronym Selection $this->acronymOptions = $this->getTheAcronymSelections(); if ($this->acronymOptions) { // Acronym Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_DEMO_LOOK_ACRONYM_LABEL') . ' -', 'filter_acronym', JHtml::_('select.options', $this->acronymOptions, 'value', 'text', $this->state->get('filter.acronym'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Acronym Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_DEMO_LOOK_ACRONYM_LABEL') . ' -', 'batch[acronym]', JHtml::_('select.options', $this->acronymOptions, 'value', 'text')); } } }
/** * Setting the toolbar */ protected function addToolBar() { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_FIELDS'), 'lamp'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=fields'); JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { JToolBarHelper::addNew('field.add'); } // Only load if there are items if (ComponentbuilderHelper::checkArray($this->items)) { if ($this->canEdit) { JToolBarHelper::editList('field.edit'); } if ($this->canState) { JToolBarHelper::publishList('fields.publish'); JToolBarHelper::unpublishList('fields.unpublish'); JToolBarHelper::archiveList('fields.archive'); if ($this->canDo->get('core.admin')) { JToolBarHelper::checkin('fields.checkin'); } } // Add a batch button if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); // set the batch button name $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { JToolbarHelper::deleteList('', 'fields.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { JToolbarHelper::trash('fields.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('field.export')) { JToolBarHelper::custom('fields.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('field.import')) { JToolBarHelper::custom('fields.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $help_url = ComponentbuilderHelper::getHelpUrl('fields'); if (ComponentbuilderHelper::checkString($help_url)) { JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); } if ($this->canState) { JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)); // only load if batch allowed if ($this->canBatch) { JHtmlBatch_::addListSelection(JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)); } } JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection(JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')); } // Category Filter. JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fields'), 'value', 'text', $this->state->get('filter.category_id'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Category Batch selection. JHtmlBatch_::addListSelection(JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), 'batch[category]', JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fields'), 'value', 'text')); } // Set Fieldtype Name Selection $this->fieldtypeNameOptions = JFormHelper::loadFieldType('Fieldtypes')->getOptions(); if ($this->fieldtypeNameOptions) { // Fieldtype Name Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL') . ' -', 'filter_fieldtype', JHtml::_('select.options', $this->fieldtypeNameOptions, 'value', 'text', $this->state->get('filter.fieldtype'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Fieldtype Name Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL') . ' -', 'batch[fieldtype]', JHtml::_('select.options', $this->fieldtypeNameOptions, 'value', 'text')); } } // Set Datatype Selection $this->datatypeOptions = $this->getTheDatatypeSelections(); if ($this->datatypeOptions) { // Datatype Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL') . ' -', 'filter_datatype', JHtml::_('select.options', $this->datatypeOptions, 'value', 'text', $this->state->get('filter.datatype'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Datatype Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL') . ' -', 'batch[datatype]', JHtml::_('select.options', $this->datatypeOptions, 'value', 'text')); } } // Set Indexes Selection $this->indexesOptions = $this->getTheIndexesSelections(); if ($this->indexesOptions) { // Indexes Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL') . ' -', 'filter_indexes', JHtml::_('select.options', $this->indexesOptions, 'value', 'text', $this->state->get('filter.indexes'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Indexes Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL') . ' -', 'batch[indexes]', JHtml::_('select.options', $this->indexesOptions, 'value', 'text')); } } // Set Null Switch Selection $this->null_switchOptions = $this->getTheNull_switchSelections(); if ($this->null_switchOptions) { // Null Switch Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL') . ' -', 'filter_null_switch', JHtml::_('select.options', $this->null_switchOptions, 'value', 'text', $this->state->get('filter.null_switch'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Null Switch Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL') . ' -', 'batch[null_switch]', JHtml::_('select.options', $this->null_switchOptions, 'value', 'text')); } } // Set Store Selection $this->storeOptions = $this->getTheStoreSelections(); if ($this->storeOptions) { // Store Filter JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL') . ' -', 'filter_store', JHtml::_('select.options', $this->storeOptions, 'value', 'text', $this->state->get('filter.store'))); if ($this->canBatch && $this->canCreate && $this->canEdit) { // Store Batch Selection JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL') . ' -', 'batch[store]', JHtml::_('select.options', $this->storeOptions, 'value', 'text')); } } }