/** * Add the page title and toolbar. */ protected function addToolbar() { JRequest::setVar('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 = iCagendaHelper::getActions(); // Set Title if (version_compare(JVERSION, '3.0', 'lt')) { JToolBarHelper::title(JText::_('COM_ICAGENDA_TITLE_MAIL'), 'mail.png'); } else { JToolBarHelper::title('iCagenda <span style="font-size:14px;">- ' . JText::_('COM_ICAGENDA_TITLE_MAIL') . '</span>', 'mail'); } $icTitle = JText::_('COM_ICAGENDA_TITLE_MAIL'); $document = JFactory::getDocument(); $app = JFactory::getApplication(); $sitename = $app->getCfg('sitename'); $title = $app->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - iCagenda: ' . $icTitle; $document->setTitle($title); if (version_compare(JVERSION, '3.0', 'lt')) { JToolBarHelper::custom('mail', 'forward.png', 'forward.png', 'ICAGENDA_JTOOLBAR_SEND', false); } else { JToolbarHelper::custom('mail', 'envelope.png', 'send_f2.png', 'ICAGENDA_JTOOLBAR_SEND', false); } JToolBarHelper::cancel('mail.cancel', 'JTOOLBAR_CLOSE'); }
/** * Add the page title and toolbar. * * @since 1.0 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/icagenda.php'; $document = JFactory::getDocument(); $app = JFactory::getApplication(); $state = $this->get('State'); $canDo = iCagendaHelper::getActions($state->get('filter.category_id')); //JToolBarHelper::title(JText::_('COM_ICAGENDA_TITLE_ICAGENDA_IMAGE')); // Set Title if (version_compare(JVERSION, '3.0', 'lt')) { JToolBarHelper::title(JText::_('COM_ICAGENDA_TITLE_ICAGENDA_IMAGE')); } else { $logo_icagenda_url = '../media/com_icagenda/images/iconicagenda36.png'; if (file_exists($logo_icagenda_url)) { $logo_icagenda = '<img src="' . $logo_icagenda_url . '" height="36px" alt="iCagenda" />'; } else { $logo_icagenda = 'iCagenda :: ' . JText::_('COM_ICAGENDA_TITLE_ICAGENDA') . ''; } JToolBarHelper::title($logo_icagenda, 'icagenda'); } $icTitle = JText::_('COM_ICAGENDA_TITLE_ICAGENDA'); $sitename = $app->getCfg('sitename'); $title = $app->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - iCagenda: ' . $icTitle; $document->setTitle($title); }
/** * Add the page title and toolbar. * * @since 1.0 */ protected function addToolbar() { if (version_compare(JVERSION, '3.0', 'lt')) { JRequest::setVar('hidemainmenu', true); } else { JFactory::getApplication()->input->set('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 = iCagendaHelper::getActions(); // Set Title if (version_compare(JVERSION, '3.0', 'lt')) { JToolBarHelper::title($isNew ? 'iCagenda - ' . JText::_('COM_ICAGENDA_LEGEND_NEW_EVENT') : 'iCagenda - ' . JText::_('COM_ICAGENDA_LEGEND_EDIT_EVENT'), 'event'); } else { JToolBarHelper::title($isNew ? 'iCagenda <span style="font-size:14px;">- ' . JText::_('COM_ICAGENDA_LEGEND_NEW_EVENT') . '</span>' : 'iCagenda <span style="font-size:14px;">- ' . JText::_('COM_ICAGENDA_LEGEND_EDIT_EVENT') . '</span>', $isNew ? 'new' : 'pencil-2'); } $icTitle = $isNew ? JText::_('COM_ICAGENDA_LEGEND_NEW_EVENT') : JText::_('COM_ICAGENDA_LEGEND_EDIT_EVENT'); $document = JFactory::getDocument(); $app = JFactory::getApplication(); $sitename = $app->getCfg('sitename'); $title = $app->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - iCagenda: ' . $icTitle; $document->setTitle($title); // Build the actions for new and existing records. if ($isNew) { // For new records, check the create permission. if ($canDo->get('core.create')) { JToolBarHelper::apply('event.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('event.save', 'JTOOLBAR_SAVE'); JToolBarHelper::custom('event.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } JToolBarHelper::cancel('event.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) { // We can save the new record JToolBarHelper::apply('event.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('event.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::custom('event.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } } // If checked out, we can still save if ($canDo->get('core.create')) { JToolBarHelper::custom('event.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } JToolBarHelper::cancel('event.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Add the page title and toolbar. */ protected function addToolbar() { JRequest::setVar('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 = iCagendaHelper::getActions(); //JToolBarHelper::title(JText::_('COM_ICAGENDA_TITLE_CATEGORY'), 'category.png'); // Set Title if (version_compare(JVERSION, '3.0', 'lt')) { JToolBarHelper::title($isNew ? 'iCagenda - ' . JText::_('COM_ICAGENDA_LEGEND_NEW_REGISTRATION') : 'iCagenda - ' . JText::_('COM_ICAGENDA_LEGEND_EDIT_REGISTRATION'), 'registration.png'); } else { JToolBarHelper::title($isNew ? 'iCagenda <span style="font-size:14px;">- ' . JText::_('COM_ICAGENDA_LEGEND_NEW_REGISTRATION') . '</span>' : 'iCagenda <span style="font-size:14px;">- ' . JText::_('COM_ICAGENDA_LEGEND_EDIT_REGISTRATION') . '</span>', $isNew ? 'new' : 'pencil-2'); } $icTitle = $isNew ? JText::_('COM_ICAGENDA_LEGEND_NEW_REGISTRATION') : JText::_('COM_ICAGENDA_LEGEND_EDIT_REGISTRATION'); $document = JFactory::getDocument(); $app = JFactory::getApplication(); $sitename = $app->getCfg('sitename'); $title = $app->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - iCagenda: ' . $icTitle; $document->setTitle($title); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.edit.own') || $canDo->get('core.create'))) { JToolBarHelper::apply('registration.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('registration.save', 'JTOOLBAR_SAVE'); } if (!$checkedOut && $canDo->get('core.create')) { JToolBarHelper::custom('registration.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('registration.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } if (empty($this->item->id)) { JToolBarHelper::cancel('registration.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('registration.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/icagenda.php'; $state = $this->get('State'); // $canDo = iCagendaHelper::getActions($state->get('filter.registration_id')); $canDo = iCagendaHelper::getActions(); // Set Title if (version_compare(JVERSION, '3.0', 'lt')) { JToolBarHelper::title('iCagenda - ' . JText::_('COM_ICAGENDA_TITLE_REGISTRATION'), 'registration.png'); } else { JToolBarHelper::title('iCagenda <span style="font-size:14px;">- ' . JText::_('COM_ICAGENDA_TITLE_REGISTRATION') . '</span>', 'users'); } $icTitle = JText::_('COM_ICAGENDA_TITLE_REGISTRATION'); $document = JFactory::getDocument(); $app = JFactory::getApplication(); $sitename = $app->getCfg('sitename'); $title = $app->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - iCagenda: ' . $icTitle; $document->setTitle($title); //Check if the form exists before showing the add/edit buttons $formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/registration'; if (file_exists($formPath)) { // Add Export Button to the ToolBar $bar = JToolBar::getInstance('toolbar'); $export_icon = version_compare(JVERSION, '3.0', 'ge') ? 'download' : 'export'; $bar->appendButton('Popup', $export_icon, 'JTOOLBAR_EXPORT', 'index.php?option=com_icagenda&view=download&tmpl=component', 600, 300); JToolBarHelper::divider(); if ($canDo->get('core.create')) { JToolBarHelper::addNew('registration.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolBarHelper::editList('registration.edit', 'JTOOLBAR_EDIT'); } } if ($canDo->get('core.edit.state')) { if (isset($this->items[0]->state)) { // JToolBarHelper::divider(); JToolBarHelper::custom('registrations.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('registrations.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } else { // If this component does not use state then show a direct delete button as we can not trash JToolBarHelper::deleteList('', 'registrations.delete', 'JTOOLBAR_DELETE'); } if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::archiveList('registrations.archive', 'JTOOLBAR_ARCHIVE'); } if (isset($this->items[0]->checked_out)) { JToolBarHelper::custom('registrations.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('', 'registrations.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('registrations.trash', 'JTOOLBAR_TRASH'); JToolBarHelper::divider(); } } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_icagenda'); } if (version_compare(JVERSION, '3.0', 'ge')) { JHtmlSidebar::setAction('index.php?option=com_icagenda&view=registrations'); JHtmlSidebar::addFilter(JText::_('COM_ICAGENDA_REGISTRATIONS_SELECT_STATUS'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true)); JHtmlSidebar::addFilter(JText::_('COM_ICAGENDA_REGISTRATIONS_SELECT_CATEGORY'), 'filter_categories', JHtml::_('select.options', $this->get('Categories'), 'value', 'text', $this->state->get('filter.categories'), true)); JHtmlSidebar::addFilter(JText::_('COM_ICAGENDA_REGISTRATIONS_SELECT_EVENT'), 'filter_events', JHtml::_('select.options', $this->get('Events'), 'value', 'text', $this->state->get('filter.events'), true)); JHtmlSidebar::addFilter(JText::_('COM_ICAGENDA_REGISTRATIONS_SELECT_DATE'), 'filter_dates', JHtml::_('select.options', $this->get('Dates'), 'value', 'text', $this->state->get('filter.dates'), true)); } }
/** * Add the page title and toolbar. * * @since 3.4.0 */ protected function addToolbar() { require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'icagenda.php'; $state = $this->get('State'); $user = JFactory::getUser(); $userId = $user->get('id'); $canDo = iCagendaHelper::getActions(); // Set Title if (version_compare(JVERSION, '3.0', 'lt')) { JToolBarHelper::title('iCagenda - ' . JText::_('COM_ICAGENDA_CUSTOMFIELDS'), 'customfields.png'); } else { JToolBarHelper::title('iCagenda <span style="font-size:14px;">- ' . JText::_('COM_ICAGENDA_CUSTOMFIELDS') . '</span>', 'list-2'); } $icTitle = JText::_('COM_ICAGENDA_CUSTOMFIELDS'); $document = JFactory::getDocument(); $app = JFactory::getApplication(); $sitename = $app->getCfg('sitename'); $title = $app->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - iCagenda: ' . $icTitle; $document->setTitle($title); //Check if the form exists before showing the add/edit buttons $formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/customfield'; if (file_exists($formPath)) { if ($canDo->get('core.create')) { JToolBarHelper::addNew('customfield.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('customfield.edit', 'JTOOLBAR_EDIT'); } } if ($canDo->get('core.edit.state')) { if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::custom('customfields.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('customfields.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } else { //If this component does not use state then show a direct delete button as we can not trash JToolBarHelper::deleteList('', 'customfields.delete', 'JTOOLBAR_DELETE'); } if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::archiveList('customfields.archive', 'JTOOLBAR_ARCHIVE'); } if (isset($this->items[0]->checked_out)) { JToolBarHelper::custom('customfields.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('', 'customfields.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('customfields.trash', 'JTOOLBAR_TRASH'); JToolBarHelper::divider(); } } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_icagenda'); } if (version_compare(JVERSION, '3.0', 'ge')) { JHtmlSidebar::setAction('index.php?option=com_icagenda&view=customfields'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true)); JHtmlSidebar::addFilter(JText::_('COM_ICAGENDA_CUSTOMFIELDS_FILTER_OPTION_SELECT_PARENT_FORM'), 'filter_parent_form', JHtml::_('select.options', $this->get('ParentForm'), 'value', 'text', $this->state->get('filter.parent_form'), true)); JHtmlSidebar::addFilter(JText::_('COM_ICAGENDA_CUSTOMFIELDS_FILTER_OPTION_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', $this->get('FieldTypes'), 'value', 'text', $this->state->get('filter.type'), true)); } }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/icagenda.php'; $state = $this->get('State'); $user = JFactory::getUser(); $userId = $user->get('id'); $canDo = iCagendaHelper::getActions(); $icagenda_categories = class_exists('icagendaCategories') ? icagendaCategories::getList() : false; // Set Title if (version_compare(JVERSION, '3.0', 'lt')) { JToolBarHelper::title('iCagenda - ' . JText::_('COM_ICAGENDA_TITLE_EVENTS'), 'events.png'); } else { JToolBarHelper::title('iCagenda <span style="font-size:14px;">- ' . JText::_('COM_ICAGENDA_TITLE_EVENTS') . '</span>', 'calendar'); } $icTitle = JText::_('COM_ICAGENDA_TITLE_EVENTS'); $document = JFactory::getDocument(); $app = JFactory::getApplication(); $sitename = $app->getCfg('sitename'); $title = $app->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - iCagenda: ' . $icTitle; $document->setTitle($title); //Check if the form exists before showing the add/edit buttons $formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/event'; if (file_exists($formPath) && $icagenda_categories) { if ($canDo->get('core.create')) { JToolBarHelper::addNew('event.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolBarHelper::editList('event.edit'); } } if ($canDo->get('core.edit.state') && $icagenda_categories) { if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::custom('events.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('events.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } else { // If this component does not use state then show a direct delete button as we can not trash JToolBarHelper::deleteList('', 'events.delete', 'JTOOLBAR_DELETE'); } if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::archiveList('events.archive', 'JTOOLBAR_ARCHIVE'); } if (isset($this->items[0]->checked_out)) { JToolBarHelper::custom('events.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) && $icagenda_categories) { if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'events.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } elseif ($canDo->get('core.edit.state')) { JToolBarHelper::trash('events.trash', 'JTOOLBAR_TRASH'); JToolBarHelper::divider(); } } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_icagenda'); } if (version_compare(JVERSION, '3.0', 'ge')) { JHtmlSidebar::setAction('index.php?option=com_icagenda&view=events'); JHtmlSidebar::addFilter(JText::_('COM_ICAGENDA_SELECT_STATE'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true)); JHtmlSidebar::addFilter(JText::_('COM_ICAGENDA_SELECT_CATEGORY'), 'filter_category', JHtml::_('select.options', $this->get('Categories'), 'value', 'text', $this->state->get('filter.category'), true)); JHtmlSidebar::addFilter(JText::_('COM_ICAGENDA_SELECT_DATES'), 'filter_upcoming', JHtml::_('select.options', $this->get('Upcoming'), 'value', 'text', $this->state->get('filter.upcoming'), true)); JHtmlSidebar::addFilter(JText::_('COM_ICAGENDA_SELECT_SITE_ITEMID'), 'filter_site_itemid', JHtml::_('select.options', $this->get('MenuItemID'), 'value', 'text', $this->state->get('filter.site_itemid'), true)); } }