/** * Setting the toolbar */ protected function addToolBar() { $canDo = ZhYandexMapHelper::getMarkerGroupActions(); JToolBarHelper::title(JText::_('COM_ZHYANDEXMAP_MAPMARKERGROUP_MANAGER'), 'mapmarkergroup'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('mapmarkergroup.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('mapmarkergroup.edit', 'JTOOLBAR_EDIT'); } if ($canDo->get('core.edit.state')) { JToolBarHelper::divider(); JToolBarHelper::publish('mapmarkergroups.publish', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::unpublish('mapmarkergroups.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolBarHelper::divider(); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'mapmarkergroups.delete', 'JTOOLBAR_DELETE'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_zhyandexmap'); } JHtmlSidebar::setAction('index.php?option=com_zhyandexmap'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_zhyandexmap'), 'value', 'text', $this->state->get('filter.category_id'))); $this->sidebar = JHtmlSidebar::render(); }
/** * Setting the toolbar */ protected function addToolBar() { JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; $canDo = ZhYandexMapHelper::getMarkerGroupActions($this->item->id); JToolBarHelper::title($isNew ? JText::_('COM_ZHYANDEXMAP_MAPMARKERGROUP_NEW') : JText::_('COM_ZHYANDEXMAP_MAPMARKERGROUP_EDIT'), 'mapmarkergroup'); // Built the actions for new and existing records. if ($isNew) { // For new records, check the create permission. if ($canDo->get('core.create')) { JToolBarHelper::apply('mapmarkergroup.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('mapmarkergroup.save', 'JTOOLBAR_SAVE'); JToolBarHelper::custom('mapmarkergroup.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } JToolBarHelper::cancel('mapmarkergroup.cancel', 'JTOOLBAR_CANCEL'); } else { if ($canDo->get('core.edit')) { // We can save the new record JToolBarHelper::apply('mapmarkergroup.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('mapmarkergroup.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('mapmarkergroup.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } if ($canDo->get('core.create')) { JToolBarHelper::custom('mapmarkergroup.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } JToolBarHelper::cancel('mapmarkergroup.cancel', 'JTOOLBAR_CLOSE'); } }
/*------------------------------------------------------------------------ # com_zhyandexmap - Zh YandexMap # ------------------------------------------------------------------------ # author Dmitry Zhuk # copyright Copyright (C) 2011 zhuk.cc. All Rights Reserved. # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later # Websites: http://zhuk.cc # Technical Support Forum: http://forum.zhuk.cc/ -------------------------------------------------------------------------*/ // No direct access to this file defined('_JEXEC') or die('Restricted Access'); $user = JFactory::getUser(); $userId = $user->id; foreach ($this->items as $i => $item) { $canDo = ZhYandexMapHelper::getMarkerGroupActions($item->id); $canEdit = $canDo->get('core.edit'); $canEditOwn = $canDo->get('core.edit.own') && 1 == 2; //&& $item->createdbyuser == $userId; $canChange = $canDo->get('core.edit.state'); ?> <tr class="row<?php echo $i % 2; ?> "> <td> <?php echo $item->id; ?> </td> <td>