Esempio n. 1
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     $canDo = ZhYandexMapHelper::getPathActions();
     JToolBarHelper::title(JText::_('COM_ZHYANDEXMAP_MAPPATH_MANAGER'), 'mappath');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('mappath.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('mappath.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::divider();
         JToolBarHelper::publish('mappaths.publish', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::unpublish('mappaths.unpublish', 'JTOOLBAR_UNPUBLISH', true);
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'mappaths.delete', 'JTOOLBAR_DELETE');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_zhyandexmap');
     }
     JHtmlSidebar::setAction('index.php?option=com_zhyandexmap');
     JHtmlSidebar::addFilter(JText::_('COM_ZHYANDEXMAP_MAPMARKER_FILTER_MAP'), 'filter_mapid', JHtml::_('select.options', $this->mapList, 'value', 'text', $this->state->get('filter.mapid')));
     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();
 }
Esempio n. 2
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->id;
     $isNew = $this->item->id == 0;
     $canDo = ZhYandexMapHelper::getPathActions($this->item->id);
     JToolBarHelper::title($isNew ? JText::_('COM_ZHYANDEXMAP_MAPPATH_NEW') : JText::_('COM_ZHYANDEXMAP_MAPPATH_EDIT'), 'mappath');
     // Built the actions for new and existing records.
     if ($isNew) {
         // For new records, check the create permission.
         if ($canDo->get('core.create')) {
             JToolBarHelper::apply('mappath.apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('mappath.save', 'JTOOLBAR_SAVE');
             JToolBarHelper::custom('mappath.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
         }
         JToolBarHelper::cancel('mappath.cancel', 'JTOOLBAR_CANCEL');
     } else {
         if ($canDo->get('core.edit')) {
             // We can save the new record
             JToolBarHelper::apply('mappath.apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('mappath.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('mappath.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
             }
         }
         if ($canDo->get('core.create')) {
             JToolBarHelper::custom('mappath.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
         }
         JToolBarHelper::cancel('mappath.cancel', 'JTOOLBAR_CLOSE');
     }
 }
Esempio n. 3
0
/*------------------------------------------------------------------------
# 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::getPathActions($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 JHtml::_('grid.id', $i, $item->id);
    ?>
		</td>
		<td>