Your IP : 216.73.216.240


Current Path : /home/juvelize/www/administrator/components/com_zhgooglemap/views/mapmarkers/tmpl/
Upload File :
Current File : /home/juvelize/www/administrator/components/com_zhgooglemap/views/mapmarkers/tmpl/default_body.php

<?php
/*------------------------------------------------------------------------
# com_zhgooglemap - Zh GoogleMap
# ------------------------------------------------------------------------
# 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
# website:   http://zhuk.cc
# Technical Support Forum: http://forum.zhuk.cc/
-------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
?>
<?php 
    $user        = JFactory::getUser();
    $userId = $user->id;

    $listOrder    = $this->escape($this->state->get('list.ordering'));
    $listDirn    = $this->escape($this->state->get('list.direction'));

    foreach($this->items as $i => $item): 
    $ordering  = ($listOrder == 'ordering');
    
    $canDo = ZhGoogleMapHelper::getMarkerActions($item->id);
    
    $canEdit    = $canDo->get('core.edit');
    $canEditOwn = $canDo->get('core.edit.own') && $item->createdbyuser == $userId;
    $canChange  = $canDo->get('core.edit.state');

    $saveOrder    = $listOrder == 'ordering';
    
    $imgpath = JURI::root() .'administrator/components/com_zhgooglemap/assets/icons/';
    $utilspath = JURI::root() .'administrator/components/com_zhgooglemap/assets/utils/';
    
?>
    <tr class="row<?php echo $i % 2; ?>" sortable-group-id="<?php echo $item->catid?>">
        <td class="order nowrap center hidden-phone">
        <?php if ($canChange) :
            $disableClassName = '';
            $disabledLabel      = '';
            if (!$saveOrder) :
                $disabledLabel    = JText::_('JORDERINGDISABLED');
                $disableClassName = 'inactive tip-top';
            endif; ?>
            <span class="sortable-handler hasTooltip <?php echo $disableClassName?>" title="<?php echo $disabledLabel?>">
                <i class="icon-menu"></i>
            </span>
            <input type="text" style="display:none" name="order[]" size="5"
                value="<?php echo $item->ordering;?>" class="width-20 text-area-order " />
        <?php else : ?>
            <span class="sortable-handler inactive" >
                <i class="icon-menu"></i>
            </span>
        <?php endif; ?>
        </td>
        <td>
            <?php echo $item->id; ?>
        </td>
        <td>
            <?php echo JHtml::_('grid.id', $i, $item->id); ?>
        </td>
        <td>

            <?php if ($canEdit || $canEditOwn) : ?>
                    <a href="<?php echo JRoute::_('index.php?option=com_zhgooglemap&task=mapmarker.edit&id=' . $item->id); ?>">
                    <?php echo $this->escape($item->title); ?></a>
            <?php else : ?>
                    <?php echo $this->escape($item->title); ?>
            <?php endif; ?>

        </td>
        <td>
            <?php echo $this->escape($item->mapname); ?>
        </td>
        <td align="center">
            <?php echo '<img src="'.$imgpath.str_replace("#", "%23", $item->icontype).'.png" alt="" />'; ?>
        </td>
        <td align="center">
            <?php 
                echo JHtml::_('jgrid.published', $item->published, $i, 'mapmarkers.', $canChange, 'cb', $item->publish_up, $item->publish_down); 
                //echo '<img src="'.JURI::root() .'administrator/components/com_zhgooglemap/assets/utils/published'.$item->published.'.png" alt="" />'; 
            ?>            
        </td>
        <td>
            <?php echo $this->escape($item->markergroupname); ?>
        </td>
        <td>
            <?php 
            if ($item->category != "")
            {
                if ($item->category_language !== '*')
                {
                    echo $this->escape($item->category) . ' (' .$this->escape($item->category_language) . ')';
                }
                else
                {
                    echo $this->escape($item->category); 
                }  
            }
            ?>
        </td>
        <td>
            <?php 
                        echo "<div>";
                        $val_cnt_max = 5;
                        
                        $val_main = $item->rating_value;
                        $val_int = floor($val_main);
                        
                        if ($val_main > $val_cnt_max)
                        {
                            $val_main = $val_cnt_max;
                            $val_int = $val_cnt_max;
                        }
                        
                        $val_cnt = 0;
                        if ($val_main == 0)
                        {
                            echo '<img name="image" src="'.$utilspath .'star0_00.png" alt="" />';
                            $val_cnt++;
                        }
                        else if ($val_int == 0 && $val_main > 0)
                        {
                            echo '<img name="image" src="'.$utilspath .'star0_05.png" alt="" />';
                            $val_cnt++;
                        }
                        else
                        {
                            for ($i=0; $i<$val_int; $i++)
                            {
                                echo '<img name="image" src="'.$utilspath .'star0_10.png" alt="" />';
                                $val_cnt++;
                            }
                            if (ceil(($val_main-$val_int)*10)>4)
                            {
                                echo '<img name="image" src="'.$utilspath .'star0_05.png" alt="" />';
                                $val_cnt++;
                            }
                        }
                        for ($i=$val_cnt; $i < $val_cnt_max; $i++)
                        {
                            echo '<img name="image" src="'.$utilspath .'star0_00.png" alt="" />';
                        }
                        
                        
                        echo "</div>";
            ?>
        </td>
        <td class="small hidden-phone">
            <?php echo $this->escape($item->access_level); ?>
        </td>
        <td>
            <?php echo $this->escape($item->fullusername); ?>
        </td>
        <td>
            <?php echo $this->escape($item->userorder); ?>
        </td>        
    </tr>
<?php endforeach; ?>