/** * Method to display a view. * * @param boolean If true, the view output will be cached * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { require_once JPATH_COMPONENT . '/helpers/banners.php'; BannersHelper::updateReset(); // Load the submenu. BannersHelper::addSubmenu(JRequest::getCmd('view', 'banners')); $view = JRequest::getCmd('view', 'banners'); $layout = JRequest::getCmd('layout', 'default'); $id = JRequest::getInt('id'); // Check for edit form. if ($view == 'banner' && $layout == 'edit' && !$this->checkEditId('com_banners.edit.banner', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_banners&view=banners', false)); return false; } elseif ($view == 'client' && $layout == 'edit' && !$this->checkEditId('com_banners.edit.client', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_banners&view=clients', false)); return false; } parent::display(); return $this; }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $isNew = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); $canDo = BannersHelper::getActions(); JToolBarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_CLIENT_NEW') : JText::_('COM_BANNERS_MANAGER_CLIENT_EDIT'), 'banners-clients.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolBarHelper::apply('client.apply'); JToolBarHelper::save('client.save'); } if (!$checkedOut && $canDo->get('core.create')) { JToolBarHelper::save2new('client.save2new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolBarHelper::save2copy('client.save2copy'); } if (empty($this->item->id)) { JToolBarHelper::cancel('client.cancel'); } else { JToolBarHelper::cancel('client.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS_EDIT'); }
/** * Setup the Toolbar * * @since 1.6 */ protected function _setToolbar() { JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $isNew = $this->item->id == 0; $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); $canDo = BannersHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title($isNew ? JText::_('Banners_Manager_Banner_New') : JText::_('Banners_Manager_Banner_Edit')); // If not checked out, can save the item. if (!$checkedOut && $canDo->get('core.edit')) { JToolBarHelper::apply('banner.apply', 'JToolbar_Apply'); JToolBarHelper::save('banner.save', 'JToolbar_Save'); JToolBarHelper::addNew('banner.save2new', 'JToolbar_Save_and_new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolBarHelper::custom('banner.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JToolbar_Save_as_Copy', false); } if (empty($this->item->id)) { JToolBarHelper::cancel('banner.cancel'); } else { JToolBarHelper::cancel('banner.cancel', 'JToolbar_Close'); } JToolBarHelper::divider(); JToolBarHelper::help('screen.banners.banner'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/banners.php'; $canDo = BannersHelper::getActions(); JToolBarHelper::title(JText::_('COM_BANNERS_MANAGER_CLIENTS'), 'banners-clients.png'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('client.add'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('client.edit'); } if ($canDo->get('core.edit.state')) { JToolBarHelper::divider(); JToolBarHelper::publish('clients.publish', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::unpublish('clients.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolBarHelper::divider(); JToolBarHelper::archiveList('clients.archive'); JToolBarHelper::checkin('clients.checkin'); } if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'clients.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('clients.trash'); JToolBarHelper::divider(); } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_banners'); JToolBarHelper::divider(); } JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS'); }
/** * 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 = BannersHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_BANNER_NEW') : JText::_('COM_BANNERS_MANAGER_BANNER_EDIT'), 'banners.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolBarHelper::apply('banner.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('banner.save', 'JTOOLBAR_SAVE'); if ($canDo->get('core.create')) { JToolBarHelper::custom('banner.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolBarHelper::custom('banner.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } if (empty($this->item->id)) { JToolBarHelper::cancel('banner.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('banner.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS_EDIT'); }
/** * Setup the Toolbar. */ protected function _setToolbar() { require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'banners.php'; $state = $this->get('State'); $canDo = BannersHelper::getActions($state->get('filter.category_id')); JToolBarHelper::title(JText::_('Banners_Manager_Banners'), 'generic.png'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('banner.add'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('banner.edit'); } JToolBarHelper::divider(); if ($canDo->get('core.edit.state')) { JToolBarHelper::custom('banners.publish', 'publish.png', 'publish_f2.png', 'Publish', true); JToolBarHelper::custom('banners.unpublish', 'unpublish.png', 'unpublish_f2.png', 'Unpublish', true); JToolBarHelper::divider(); if ($state->get('filter.published') != -1) { JToolBarHelper::archiveList('banners.archive'); } } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'banners.delete'); } else { if ($canDo->get('core.edit.state')) { JToolBarHelper::trash('banners.trash'); } } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_banners'); } JToolBarHelper::divider(); JToolBarHelper::help('screen.banners.banners'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/banners.php'; $canDo = BannersHelper::getActions(); JToolbarHelper::title(JText::_('COM_BANNERS_MANAGER_CLIENTS'), 'banners-clients.png'); if ($canDo->get('core.create')) { JToolbarHelper::addNew('client.add'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('client.edit'); } if ($canDo->get('core.edit.state')) { JToolbarHelper::publish('clients.publish', 'JTOOLBAR_PUBLISH', true); JToolbarHelper::unpublish('clients.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolbarHelper::archiveList('clients.archive'); JToolbarHelper::checkin('clients.checkin'); } if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'clients.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('clients.trash'); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_banners'); } JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS'); JHtmlSidebar::setAction('index.php?option=com_banners&view=clients'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true)); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/banners.php'; $canDo = BannersHelper::getActions(); JToolBarHelper::title(JText::_('COM_BANNERS_MANAGER_CLIENTS'), 'banners-clients.png'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('client.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('client.edit', 'JTOOLBAR_EDIT'); } if ($canDo->get('core.edit.state')) { JToolBarHelper::divider(); JToolBarHelper::custom('clients.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('clients.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); JToolBarHelper::divider(); JToolBarHelper::archiveList('clients.archive', 'JTOOLBAR_ARCHIVE'); JToolBarHelper::custom('clients.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } if ($canDo->get('core.edit.state')) { JToolBarHelper::trash('clients.trash', 'JTOOLBAR_TRASH'); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'clients.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_banners'); JToolBarHelper::divider(); } JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS'); }
/** * 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); // Since we don't track these assets at the item level, use the category id. $canDo = BannersHelper::getActions($this->item->catid, 0); JToolBarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_BANNER_NEW') : JText::_('COM_BANNERS_MANAGER_BANNER_EDIT'), 'banners.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0)) { JToolBarHelper::apply('banner.apply'); JToolBarHelper::save('banner.save'); if ($canDo->get('core.create')) { JToolBarHelper::save2new('banner.save2new'); } } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolBarHelper::save2copy('banner.save2copy'); } if (empty($this->item->id)) { JToolBarHelper::cancel('banner.cancel'); } else { JToolBarHelper::cancel('banner.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS_EDIT'); }
/** * Add the page title and toolbar. * * @since 1.6 */ 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 ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'banners.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } else if ($canDo->get('core.edit.state')) { JToolBarHelper::trash('banners.trash'); JToolBarHelper::divider(); } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_banners'); JToolBarHelper::divider(); } JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS'); }
/** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise an Error object. */ public function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } BannersHelper::addSubmenu('clients'); $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); return parent::display($tpl); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/banners.php'; $canDo = BannersHelper::getActions($this->state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_BANNERS_MANAGER_TRACKS'), 'banners-tracks.png'); $bar = JToolBar::getInstance('toolbar'); $bar->appendButton('Popup', 'export', 'JTOOLBAR_EXPORT', 'index.php?option=com_banners&view=download&tmpl=component', 600, 300); $document = JFactory::getDocument(); $app = JFactory::getApplication(); if ($canDo->get('core.delete')) { $bar->appendButton('Confirm', 'COM_BANNERS_DELETE_MSG', 'delete', 'COM_BANNERS_TRACKS_DELETE', 'tracks.delete', false); JToolBarHelper::divider(); } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_banners'); JToolBarHelper::divider(); } JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_TRACKS'); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { $canDo = JHelperContent::getActions('com_banners', 'category', $this->state->get('filter.category_id')); JToolbarHelper::title(JText::_('COM_BANNERS_MANAGER_TRACKS'), 'bookmark banners-tracks'); $bar = JToolbar::getInstance('toolbar'); $bar->appendButton('Popup', 'download', 'JTOOLBAR_EXPORT', 'index.php?option=com_banners&view=download&tmpl=component', 600, 300); if ($canDo->get('core.delete')) { $bar->appendButton('Confirm', 'COM_BANNERS_DELETE_MSG', 'delete', 'COM_BANNERS_TRACKS_DELETE', 'tracks.delete', false); JToolbarHelper::divider(); } if ($canDo->get('core.admin') || $canDo->get('core.options')) { JToolbarHelper::preferences('com_banners'); JToolbarHelper::divider(); } JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_TRACKS'); JHtmlSidebar::setAction('index.php?option=com_banners&view=tracks'); JHtmlSidebar::addFilter(JText::_('COM_BANNERS_SELECT_CLIENT'), 'filter_client_id', JHtml::_('select.options', BannersHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_banners'), 'value', 'text', $this->state->get('filter.category_id'))); JHtmlSidebar::addFilter(JText::_('COM_BANNERS_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', array(JHtml::_('select.option', 1, JText::_('COM_BANNERS_IMPRESSION')), JHtml::_('select.option', 2, JText::_('COM_BANNERS_CLICK'))), 'value', 'text', $this->state->get('filter.type'))); }
/** * Method to display a view. * * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return BannersController This object to support chaining. * * @since 1.5 */ public function display($cachable = false, $urlparams = array()) { BannersHelper::updateReset(); $view = $this->input->get('view', 'banners'); $layout = $this->input->get('layout', 'default'); $id = $this->input->getInt('id'); // Check for edit form. if ($view == 'banner' && $layout == 'edit' && !$this->checkEditId('com_banners.edit.banner', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_banners&view=banners', false)); return false; } elseif ($view == 'client' && $layout == 'edit' && !$this->checkEditId('com_banners.edit.client', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_banners&view=clients', false)); return false; } return parent::display(); }
/** * Method to display the view. * * @param string $tpl A template file to load. [optional] * * @return mixed A string if successful, otherwise a JError object. * * @since 1.6 */ public function display($tpl = null) { $this->categories = $this->get('CategoryOrders'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } BannersHelper::addSubmenu('banners'); $this->addToolbar(); // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); $this->sidebar = JHtmlSidebar::render(); return parent::display($tpl); }
/** * Setup the Toolbar. */ protected function _setToolbar() { require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'banners.php'; $state = $this->get('State'); $canDo = BannersHelper::getActions($state->get('filter.category_id')); JToolBarHelper::title(JText::_('Banners_Manager_Tracks'), 'generic.png'); $bar =& JToolBar::getInstance('toolbar'); $bar->appendButton('Popup', 'export', 'Banners_Tracks_Export', 'index.php?option=com_banners&view=download&tmpl=component', 600, 250); $document =& JFactory::getDocument(); $app =& JFactory::getApplication(); // TODO: must be written in the bluestork template $document->addStyleDeclaration('.icon-32-export { background-image: url(templates/' . $app->getTemplate() . '/images/toolbar/icon-32-export.png); }'); if ($canDo->get('core.delete')) { $bar->appendButton('Confirm', 'Banners_Delete_Msg', 'delete', 'Delete', 'tracks.delete', false); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_banners'); } JToolBarHelper::divider(); JToolBarHelper::help('screen.banners.tracks'); }
/** * Method to display a view. */ public function display() { require_once JPATH_COMPONENT . '/helpers/banners.php'; BannersHelper::updateReset(); // Get the document object. $document = JFactory::getDocument(); // Set the default view name and format from the Request. $vName = JRequest::getWord('view', 'banners'); $vFormat = $document->getType(); $lName = JRequest::getWord('layout', 'default'); // Get and render the view. if ($view =& $this->getView($vName, $vFormat)) { // Get the model for the view. $model =& $this->getModel($vName); // Push the model into the view (as default). $view->setModel($model, true); $view->setLayout($lName); // Push document object into the view. $view->assignRef('document', $document); $view->display(); // Load the submenu. BannersHelper::addSubmenu($vName); } }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ public function getOptions() { return BannersHelper::getClientOptions(); }
<?php /** * @version $Id$ * @package Joomla.Site * @subpackage mod_banners * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; // Include the syndicate functions only once require_once dirname(__FILE__) . '/helper.php'; $headerText = trim($params->get('header_text')); $footerText = trim($params->get('footer_text')); require_once JPATH_ROOT . '/administrator/components/com_banners/helpers/banners.php'; BannersHelper::updateReset(); $list =& modBannersHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_banners', $params->get('layout', 'default'));
/** * Method to get the field options. * * @return array The field option objects. * * @since 1.6 */ public function getOptions() { return array_merge(parent::getOptions(), BannersHelper::getClientOptions()); }
<?php /** * @package Joomla.Administrator * @subpackage Templates.hathor * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.formvalidation'); $canDo = BannersHelper::getActions(); ?> <script type="text/javascript"> Joomla.submitbutton = function(task) { if (task == 'client.cancel' || document.formvalidator.isValid(document.id('client-form'))) { Joomla.submitform(task, document.getElementById('client-form')); } } </script> <form action="<?php echo JRoute::_('index.php?option=com_banners&layout=edit&id=' . (int) $this->item->id); ?> " method="post" name="adminForm" id="client-form" class="form-validate"> <div class="col main-section"> <fieldset class="adminform">
/** * Method to get the field options. * * @return array The field option objects. * * @since 1.6 */ public function getOptions() { $options = BannersHelper::getClientOptions(); return array_merge(parent::getOptions(), $options); }
echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true); ?> </select> <label class="selectlabel" for="filter_client_id"> <?php echo JText::_('COM_BANNERS_SELECT_CLIENT'); ?> </label> <select name="filter_client_id" class="inputbox" id="filter_client_id"> <option value=""><?php echo JText::_('COM_BANNERS_SELECT_CLIENT'); ?> </option> <?php echo JHtml::_('select.options', BannersHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')); ?> </select> <label class="selectlabel" for="filter_category_id"> <?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?> </label> <select name="filter_category_id" class="inputbox" id="filter_category_id"> <option value=""><?php echo JText::_('JOPTION_SELECT_CATEGORY'); ?> </option> <?php echo JHtml::_('select.options', JHtml::_('category.options', 'com_banners'), 'value', 'text', $this->state->get('filter.category_id'));
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/banners.php'; $canDo = BannersHelper::getActions($this->state->get('filter.category_id')); $user = JFactory::getUser(); // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); 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::publish('banners.publish', 'JTOOLBAR_PUBLISH', true); JToolbarHelper::unpublish('banners.unpublish', 'JTOOLBAR_UNPUBLISH', true); } if ($this->state->get('filter.state') != -1) { if ($this->state->get('filter.state') != 2) { JToolbarHelper::archiveList('banners.archive'); } elseif ($this->state->get('filter.state') == 2) { JToolbarHelper::unarchiveList('banners.publish'); } } } if ($canDo->get('core.edit.state')) { JToolbarHelper::checkin('banners.checkin'); } if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'banners.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('banners.trash'); } // Add a batch button if ($user->authorise('core.edit')) { JHtml::_('bootstrap.modal', 'collapseModal'); $title = JText::_('JTOOLBAR_BATCH'); $dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">\n\t\t\t\t\t\t<i class=\"icon-checkbox-partial\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>"; $bar->appendButton('Custom', $dhtml, 'batch'); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_banners'); } JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS'); JHtmlSidebar::setAction('index.php?option=com_banners&view=banners'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true)); JHtmlSidebar::addFilter(JText::_('COM_BANNERS_SELECT_CLIENT'), 'filter_client_id', JHtml::_('select.options', BannersHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_banners'), 'value', 'text', $this->state->get('filter.category_id'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'))); }