Your IP : 216.73.216.240


Current Path : /home/juvelize/www/components/com_zhgooglemap/views/placemarks/tmpl/
Upload File :
Current File : /home/juvelize/www/components/com_zhgooglemap/views/placemarks/tmpl/default.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');
// load tooltip behavior
JHtml::_('behavior.tooltip');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');

$user        = JFactory::getUser();
$userId        = $user->get('id');
$listOrder    = $this->escape($this->state->get('list.ordering'));
$listDirn    = $this->escape($this->state->get('list.direction'));
$canOrder    = false;  //$user->authorise('core.edit.state', 'com_zhgooglemap.category');
$saveOrder    = false;  //$listOrder == 'ordering';

$canViewDetails = true;

/*
if ($saveOrder)
{
    $saveOrderingUrl = 'index.php?option=com_zhgooglemap&task=placemarks.saveOrderAjax&tmpl=component';
    JHtml::_('sortablelist.sortable', 'zhgm_placemarks', 'adminForm', strtolower($listDirn), $saveOrderingUrl);

}
*/

$sortFields = $this->getSortFields();

$document = JFactory::getDocument();

$load_bs = (int)$this->state->get('map.load_bootstrap');
$prop_thumbnail = (int)$this->state->get('map.thumbnail');
$prop_imagegalery = (int)$this->state->get('map.imagegalery');

$prop_hidedescriptionhtml = (int)$this->state->get('map.hidedescriptionhtml');
$prop_showdescriptionfullhtml = (int)$this->state->get('map.showdescriptionfullhtml');

$load_bs_det = $load_bs;

if ($load_bs == 90
 || $load_bs == 30)
{
    $load_bs_det = 0;
} 
else if ($load_bs == 91
      || $load_bs == 31)
{
    $load_bs_det = 1;
}

if ( $load_bs == 0
  || $load_bs == 1
  || $load_bs == 20
  || $load_bs == 21
  || $load_bs == 30
  || $load_bs == 31)
{
    $document->addStyleSheet(JURI::root().'components/com_zhgooglemap/assets/bootstrap/css/bootstrap.min.css');
    $document->addStyleSheet(JURI::root().'components/com_zhgooglemap/assets/bootstrap/css/bootstrap-responsive.min.css');
}
$document->addStyleSheet(JURI::root().'components/com_zhgooglemap/assets/css/placemarklist-common.css');

if ($load_bs == 0
 || $load_bs == 20
 || $load_bs == 31)
{
    $document->addScript(JURI::root().'components/com_zhgooglemap/assets/bootstrap/js/bootstrap.min.js');
}

?>

<script type="text/javascript">
    Joomla.orderTable = function() {
        table = document.getElementById("sortTable");
        direction = document.getElementById("directionTable");
        order = table.options[table.selectedIndex].value;
        if (order != '<?php echo $listOrder; ?>') {
            dirn = 'asc';
        } else {
            dirn = direction.options[direction.selectedIndex].value;
        }
        Joomla.tableOrdering(order, dirn, '');
    }
</script>



<form action="<?php echo JRoute::_('index.php?option=com_zhgooglemap&view=placemarks'); ?>" method="post" name="adminForm" id="adminForm">

    <div class="row-fluid">

    <div class="row-fluid">
    <?php  
    if ((int)$this->state->get('map.header_fixed')==1)
    {
    ?>
        <div class="navbar navbar-fixed-top">
    <?php  }
    else
    {?>
        <div class="navbar">
    <?php  
    }
    ?>
        <div class="navbar-inner">
        <div class="container">

            <div id="filter-bar" class="btn-toolbar">
                <?php
                    if (!empty( $this->sidebar)) { ?>
                    <!-- Modal -->
                        <div id="zhgmPlacemarkListModalOptions" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="zhgmPlacemarkListModalOptions" aria-hidden="true">
                            <div class="row-fluid">
                            <div class="span12">

                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h3 id="zhgmModalHeader" class="zhgm-modal-header" ><?php echo JText::_('COM_ZHGOOGLEMAP_MAPMARKER_FILTER_OPTIONS'); ?></h3>
                                </div>
                                <div class="modal-body">
                                    <div id="filter-container-header" class="controls span12">
                                    <?php 
                                        echo $this->sidebar; 
                                    ?>
                                    </div>

                                </div>
                            </div>
                            </div>

                        </div>        
                <?php  } ?>
            
                <?php 
                    if (!empty( $this->sidebar)) { ?>
                    <!-- Button to trigger modal -->
                    <div class="btn-group pull-left">
                    <div id="main-option-container" class="span1">
                        <a href="#zhgmPlacemarkListModalOptions" role="button" class="btn btn-group" data-toggle="modal"><i class="icon-filter"></i></a>
                    </div>
                    </div>


                <?php  } ?>

                
                <div class="filter-search btn-group pull-left">
                    <label class="element-invisible" for="filter_search"><?php echo JText::_('JSEARCH_FILTER_LABEL'); ?></label>
                    <input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('COM_ZHGOOGLEMAP_MAPMARKER_FILTER_SEARCH_IN_TITLE'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_ZHGOOGLEMAP_MAPMARKER_FILTER_SEARCH_IN_TITLE'); ?>" />
                </div>
                <div class="btn-group pull-left">
                    <button class="btn hasTooltip" type="submit" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
                    <button class="btn hasTooltip" type="button" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
                </div>        
            
                <div class="btn-group pull-right hidden-phone">
                    <label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
                    <?php echo $this->pagination->getLimitBox(); ?>
                </div>
                <div class="btn-group pull-right hidden-phone">
                    <label for="directionTable" class="element-invisible"><?php echo JText::_('COM_ZHGOOGLEMAP_ORDERING_DESC');?></label>
                    <select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
                        <option value=""><?php echo JText::_('COM_ZHGOOGLEMAP_ORDERING_DESC');?></option>
                        <option value="asc" <?php if ($listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('COM_ZHGOOGLEMAP_ORDER_ASCENDING');?></option>
                        <option value="desc" <?php if ($listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('COM_ZHGOOGLEMAP_ORDER_DESCENDING');?></option>
                    </select>
                </div>
                <div class="btn-group pull-right">
                    <label for="sortTable" class="element-invisible"><?php echo JText::_('COM_ZHGOOGLEMAP_SORT_BY');?></label>
                    <select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
                        <option value=""><?php echo JText::_('COM_ZHGOOGLEMAP_SORT_BY');?></option>
                        <?php echo JHtml::_('select.options', $sortFields, 'value', 'text', $listOrder);?>
                    </select>
                </div>

            </div>
        
        </div>
        </div>
    </div>
    </div>
    <div class="row-fluid">
    <?php  
    if (1==1)
    {?>
        <div id="main-container-table" class="zhgm-main-content-body span12">
    <?php  }
    else
    {?>
        <div id="main-container-table" class="span12">
    <?php  
    }
    ?>    
        <table class="table table-striped" id="zhgm_placemarks">
            <thead>
                <tr>
                    <?php $tab_column_count = 0 ?>
                    <th width="1%" class="nowrap center hidden-phone">
                        <?php $tab_column_count += 1 ?>
                        <?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $listDirn, $listOrder, null, 'asc', 'COM_ZHGOOGLEMAP_HEADING_ORDERING'); ?>
                    </th>
                    <?php if ((int)$this->state->get('map.option_filter_id') == 0
                       || (int)$this->state->get('map.option_filter_id') == 1 )
                    
                    {
                    ?>
                    <th width="10" class="nowrap center hidden-phone">
                        <?php $tab_column_count += 1 ?>
                        <?php echo JHtml::_('grid.sort', 'COM_ZHGOOGLEMAP_MAPMARKER_HEADING_ID', 'h.id', $listDirn, $listOrder); ?>
                    </th>
                    <?php } ?>
                    <th width="20" class="hidden-phone">
                        <?php $tab_column_count += 1 ?>
                        <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
                    </th>            
                    <th class="title">
                        <?php $tab_column_count += 1 ?>
                        <?php echo JHtml::_('grid.sort', 'COM_ZHGOOGLEMAP_MAPMARKER_HEADING_TITLE', 'h.title', $listDirn, $listOrder); ?>
                    </th>
                    <?php if ((int)$this->state->get('map.option_filter_map') == 0
                       || (int)$this->state->get('map.option_filter_map') == 1 )
                    
                    {
                    ?>
                    <th>
                        <?php $tab_column_count += 1 ?>
                        <?php echo JText::_('COM_ZHGOOGLEMAP_MAPMARKER_HEADING_MAPTITLE'); ?>
                    </th>
                    <?php } ?>
                    <?php if ((int)$this->state->get('map.option_filter_icon') == 0
                       || (int)$this->state->get('map.option_filter_icon') == 1 )
                    
                    {
                    ?>
                    <th width="5">
                        <?php $tab_column_count += 1 ?>
                        <?php echo JText::_('COM_ZHGOOGLEMAP_MAPMARKER_HEADING_ICONTYPE'); ?>
                    </th>
                    <?php } ?>
                    <?php if ((int)$this->state->get('map.option_filter_publish') == 0
                       || (int)$this->state->get('map.option_filter_publish') == 1 )
                    
                    {
                    ?>
                    <th width="5" class="nowrap center">
                        <?php $tab_column_count += 1 ?>
                        <?php echo JHtml::_('grid.sort', 'COM_ZHGOOGLEMAP_MAPMARKER_HEADING_PUBLISHED', 'h.published', $listDirn, $listOrder); ?>
                    </th>
                    <?php } ?>
                    <?php if ((int)$this->state->get('map.option_filter_group') == 0
                       || (int)$this->state->get('map.option_filter_group') == 1 )
                    
                    {
                    ?>
                    <th>
                        <?php $tab_column_count += 1 ?>
                        <?php echo JText::_('COM_ZHGOOGLEMAP_MAPMARKER_HEADING_MARKERGROUP'); ?>
                    </th>
                    <?php } ?>
                    <?php if ((int)$this->state->get('map.option_filter_category') == 0
                       || (int)$this->state->get('map.option_filter_category') == 1 )
                    
                    {
                    ?>
                    <th>
                        <?php $tab_column_count += 1 ?>
                        <?php echo JHtml::_('grid.sort', 'COM_ZHGOOGLEMAP_MAPMARKER_HEADING_CATEGORY', 'category_title', $listDirn, $listOrder); ?>
                    </th>
                    <?php } ?>
                    <?php if ((int)$this->state->get('map.option_filter_rating') == 0
                       || (int)$this->state->get('map.option_filter_rating') == 1 )
                    
                    {
                    ?>
                    <th width="90">
                        <?php $tab_column_count += 1 ?>
                        <?php echo JHtml::_('grid.sort', 'COM_ZHGOOGLEMAP_MAPMARKER_HEADING_RATING', 'h.rating_value', $listDirn, $listOrder); ?>
                    </th>
                    <?php } ?>
                    <?php if ((int)$this->state->get('map.option_filter_access') == 0
                       || (int)$this->state->get('map.option_filter_access') == 1 )
                    
                    {
                    ?>
                    <th width="10%" class="nowrap hidden-phone">
                        <?php $tab_column_count += 1 ?>
                        <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'h.access', $listDirn, $listOrder); ?>
                    </th>
                    <?php } ?>
                    <?php if ((int)$this->state->get('map.option_filter_user') == 0
                       || (int)$this->state->get('map.option_filter_user') == 1 )
                    
                    {
                    ?>
                    <th>
                        <?php $tab_column_count += 1 ?>
                        <?php echo JText::_('COM_ZHGOOGLEMAP_MAPMARKER_HEADING_USER'); ?>
                    </th>
                    <?php } ?>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <td colspan="<?php echo $tab_column_count;?>">
                    <div id="zhgm_placemarklist_pagination" class="zhgm-pagination">
                    <?php 
                        echo $this->pagination->getPagesLinks(); 
                        //echo $this->pagination->getResultsCounter(); 
                    ?>
                    
                    </div>
                    </td>
                </tr>
            </tfoot>
            <tbody>
                <?php 
                    foreach($this->items as $i => $item): 
                    $ordering  = ($listOrder == 'ordering');
                    
                    $canDo = ZhGoogleMapHelper::getMarkerActions($item->id);
                    
                    $canEdit    = false; //$canDo->get('core.edit');
                    $canEditOwn = false; //$canDo->get('core.edit.own') && $item->createdbyuser == $userId;
                    $canChange  = false; //$canDo->get('core.edit.state');

                    $saveOrder    = false;  //$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>
                        <?php if ((int)$this->state->get('map.option_filter_id') == 0
                           || (int)$this->state->get('map.option_filter_id') == 1 )
                        
                        {
                        ?>
                        <td>
                            <?php echo $item->id; ?>
                        </td>
                        <?php } ?>
                        <td>
                            <?php echo JHtml::_('grid.id', $i, $item->id); ?>
                        </td>
                        <td>
 
                            <?php if ($canViewDetails) : ?>
                                    <a href="<?php echo JRoute::_('index.php?option=com_zhgooglemap&view=placemark&load_bootstrap='.$load_bs_det
                                                                  .'&thumbnail='.$prop_thumbnail
                                                                  .'&imagegalery='.$prop_imagegalery
                                                                  .'&hidedescriptionhtml='.$prop_hidedescriptionhtml
                                                                  .'&showdescriptionfullhtml='.$prop_showdescriptionfullhtml
                                                                  .'&id=' . $item->id); ?>">
                                    <?php echo $this->escape($item->title); ?></a>
                            <?php else : ?>
                                    <?php echo $this->escape($item->title); ?>
                            <?php endif; ?>

                        </td>
                        <?php if ((int)$this->state->get('map.option_filter_map') == 0
                           || (int)$this->state->get('map.option_filter_map') == 1 )
                        
                        {
                        ?>
                        <td>
                            <?php echo $this->escape($item->mapname); ?>
                        </td>
                        <?php } ?>
                        <?php if ((int)$this->state->get('map.option_filter_icon') == 0
                           || (int)$this->state->get('map.option_filter_icon') == 1 )
                        
                        {
                        ?>
                        <td align="center">
                            <?php echo '<img src="'.$imgpath.str_replace("#", "%23", $item->icontype).'.png" alt="" />'; ?>
                        </td>
                        <?php } ?>
                        <?php if ((int)$this->state->get('map.option_filter_publish') == 0
                           || (int)$this->state->get('map.option_filter_publish') == 1 )
                        
                        {
                        ?>
                        <td align="center">
                            <?php 
                                echo JHtml::_('jgrid.published', $item->published, $i, 'placemarks.', $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>
                        <?php } ?>
                        <?php if ((int)$this->state->get('map.option_filter_group') == 0
                           || (int)$this->state->get('map.option_filter_group') == 1 )
                        
                        {
                        ?>
                        <td>
                            <?php echo $this->escape($item->markergroupname); ?>
                        </td>
                        <?php } ?>
                        <?php if ((int)$this->state->get('map.option_filter_category') == 0
                           || (int)$this->state->get('map.option_filter_category') == 1 )
                        
                        {
                        ?>
                        <td>
                            <?php echo $this->escape($item->category); ?>
                        </td>
                        <?php } ?>
                        <?php if ((int)$this->state->get('map.option_filter_rating') == 0
                           || (int)$this->state->get('map.option_filter_rating') == 1 )
                        
                        {
                        ?>
                        <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>
                        <?php } ?>
                        <?php if ((int)$this->state->get('map.option_filter_access') == 0
                           || (int)$this->state->get('map.option_filter_access') == 1 )
                        
                        {
                        ?>
                        <td class="small hidden-phone">
                            <?php echo $this->escape($item->access_level); ?>
                        </td>
                        <?php } ?>
                        <?php if ((int)$this->state->get('map.option_filter_user') == 0
                           || (int)$this->state->get('map.option_filter_user') == 1 )
                        
                        {
                        ?>
                        <td>
                            <?php echo $this->escape($item->fullusername); ?>
                        </td>
                        <?php } ?>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
    </div>
    <div>
        <input type="hidden" name="task" value="" />
        <input type="hidden" name="boxchecked" value="0" />
        <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
        <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
        <?php echo JHtml::_('form.token'); ?>
    </div>
</div>
</form>