/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/improved_ajax_login.php'; $state = $this->get('State'); $canDo = Improved_ajax_loginHelper::getActions($state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_IMPROVED_AJAX_LOGIN_TITLE_OAUTHS'), 'oauths.png'); //Check if the form exists before showing the add/edit buttons $formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/oauth'; if (file_exists($formPath)) { if ($canDo->get('core.edit') && isset($this->items[0])) { JToolBarHelper::editList('oauth.edit', 'JTOOLBAR_EDIT'); } } if ($canDo->get('core.edit.state')) { if (isset($this->items[0]->published)) { JToolBarHelper::divider(); JToolBarHelper::custom('oauths.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('oauths.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } else { if (isset($this->items[0])) { //If this component does not use state then show a direct delete button as we can not trash JToolBarHelper::deleteList('', 'oauths.delete', 'JTOOLBAR_DELETE'); } } } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_improved_ajax_login'); } //Set sidebar action - New in 3.0 JHtmlSidebar::setAction('index.php?option=com_improved_ajax_login&view=oauths'); $this->extra_sidebar = ''; JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), "value", "text", $this->state->get('filter.state'), true)); }
/** * Add the page title and toolbar. */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $isNew = $this->item->id == 0; if (isset($this->item->checked_out)) { $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); } else { $checkedOut = false; } $canDo = Improved_ajax_loginHelper::getActions(); JToolBarHelper::title(JText::_('COM_IMPROVED_AJAX_LOGIN_TITLE_OAUTH'), 'oauth.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolBarHelper::apply('oauth.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('oauth.save', 'JTOOLBAR_SAVE'); } if (empty($this->item->id)) { JToolBarHelper::cancel('oauth.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('oauth.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Add the page title and toolbar. */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $isNew = $this->item->id == 0; if (isset($this->item->checked_out)) { $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); } else { $checkedOut = false; } $canDo = Improved_ajax_loginHelper::getActions(); JToolBarHelper::title(JText::_('COM_IMPROVED_AJAX_LOGIN_TITLE_FORM'), 'form.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolBarHelper::apply('form.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('form.save', 'JTOOLBAR_SAVE'); } /* if (!$checkedOut && ($canDo->get('core.create'))){ JToolBarHelper::custom('form.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('form.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } */ if (empty($this->item->id)) { JToolBarHelper::cancel('form.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('form.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/improved_ajax_login.php'; $state = $this->get('State'); $canDo = Improved_ajax_loginHelper::getActions($state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_IMPROVED_AJAX_LOGIN_TITLE_FORMS'), 'forms.png'); //Check if the form exists before showing the add/edit buttons $formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/form'; if (file_exists($formPath)) { /* if ($canDo->get('core.create')) { JToolBarHelper::addNew('form.add','JTOOLBAR_NEW'); } */ if ($canDo->get('core.edit') && isset($this->items[0])) { JToolBarHelper::editList('form.edit', 'JTOOLBAR_EDIT'); } } /* if ($canDo->get('core.edit.state')) { if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::custom('forms.publish', 'publish.png', 'publish_f2.png','JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('forms.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } else if (isset($this->items[0])) { //If this component does not use state then show a direct delete button as we can not trash JToolBarHelper::deleteList('', 'forms.delete','JTOOLBAR_DELETE'); } if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::archiveList('forms.archive','JTOOLBAR_ARCHIVE'); } if (isset($this->items[0]->checked_out)) { JToolBarHelper::custom('forms.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } } //Show trash and delete for components that uses the state field if (isset($this->items[0]->state)) { if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'forms.delete','JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } else if ($canDo->get('core.edit.state')) { JToolBarHelper::trash('forms.trash','JTOOLBAR_TRASH'); JToolBarHelper::divider(); } } */ if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_improved_ajax_login'); } //Set sidebar action - New in 3.0 JHtmlSidebar::setAction('index.php?option=com_improved_ajax_login&view=forms'); $this->extra_sidebar = ''; JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), "value", "text", $this->state->get('filter.state'), true)); //Filter for the field type $select_label = JText::sprintf('COM_IMPROVED_AJAX_LOGIN_FILTER_SELECT_LABEL', 'Type'); $options = array(); $options[0] = new stdClass(); $options[0]->value = "login"; $options[0]->text = "Login"; $options[1] = new stdClass(); $options[1]->value = "registration"; $options[1]->text = "Registration"; $options[2] = new stdClass(); $options[2]->value = "profile"; $options[2]->text = "Edit Profile"; JHtmlSidebar::addFilter($select_label, 'filter_type', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.type'), true)); //Filter for the field theme $select_label = JText::sprintf('COM_IMPROVED_AJAX_LOGIN_FILTER_SELECT_LABEL', 'Theme'); $options = array(); $options[0] = new stdClass(); $options[0]->value = "elegant"; $options[0]->text = "Elegant"; JHtmlSidebar::addFilter($select_label, 'filter_theme', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.theme'), true)); }