joomla /components/com_weblinks/views/category/tmpl/default_items.php

Language PHP Lines 132
MD5 Hash d57b25f6b597b1065f2db85fb9badab7
Repository https://github.com/joebushi/joomla.git View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/**
 * @version                $Id: default_items.php 13471 2009-11-12 00:38:49Z eddieajau
 * @package                Joomla.Site
 * @subpackage        com_weblinks
 * @copyright        Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
 * @license                GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

// TODO: Optimise some of the fixed params in the loops
?>
<script  type="text/javascript">
        function tableOrdering(order, dir, task) {
        var form = document.adminForm;

        form.filter_order.value         = order;
        form.filter_order_Dir.value        = dir;
        document.adminForm.submit(task);
}
</script>



 <form action="<?php echo JFilterOutput::ampReplace(JFactory::getURI()->toString()); ?>" method="post" name="adminForm">
 <div class="filter">
         <?php echo JText::_('Display Num'); ?>
         <?php echo $this->pagination->getLimitBox(); ?>
 </div>
        <input type="hidden" name="filter_order" value="<?php echo $this->state->get('list.ordering'); ?>" />
        <input type="hidden" name="filter_order_Dir" value="<?php echo $this->state->get('list.direction'); ?>" />
 </form>
        <table class="weblinks">
           <?php if ($this->params->def('show_headings', 1)) : ?>
                 <thead>

                                               <tr>
                                <th class="num">
                                        <?php echo JText::_('Num'); ?>
                                </th>
                                <th class="title">
                                        <?php echo JHtml::_('grid.sort',  'Web Link', 'title', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                                </th>
                                <?php if ($this->params->get('show_link_hits')) : ?>
                                <th class="hits">
                                        <?php echo JHtml::_('grid.sort',  'Hits', 'hits', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                                </th>
                                <?php endif; ?>
                        </tr>

                </thead>
      <?php endif; ?>
                <tbody>
                        <?php foreach ($this->items as $i => $item) : ?>
                        <tr class="<?php echo $i % 2 ? 'odd' : 'even';?>">
                                <td class="num">
                                        <?php echo $this->pagination->getRowOffset($i); ?>
                                </td>
                                <td class="title">
                                <p>
                                        <?php if ($this->params->get('link_icons') <> -1) : ?>
                                                <?php echo JHtml::_('image',  'system/'.$this->params->get('link_icons', 'weblink.png'), JText::_('Link'), NULL, true);?>
                                        <?php endif; ?>

                                        <?php
                                                // Compute the correct link

                                                $menuclass = 'category'.$this->params->get('pageclass_sfx');
                                                $link        = JRoute::_('index.php?task=weblink.go&&id='. $item->id);
                                                switch ($item->params->get('target', $this->params->get('target')))
                                                {
                                                        case 1:
                                                                // open in a new window
                                                                echo '<a href="'. $link .'" target="_blank" class="'. $menuclass .'" rel="nofollow">'.
                                                                        $this->escape($item->title) .'</a>';
                                                                break;

                                                        case 2:
                                                                // open in a popup window
                                                                echo "<a href=\"#\" onclick=\"javascript: window.open('". $link ."', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\" class=\"$menuclass\">".
                                                                        $this->escape($item->title) ."</a>\n";
                                                                break;
                                                        case 3:
                                                                // TODO: open in a modal window
                                                                JHtml::_('behavior.modal', 'a.modal'); ?>

                                                                <a class="modal" title="<?php  echo $this->escape($item->title) ?> " href="<?php echo $link;?>"  rel="{handler: 'iframe', size: {x: 500, y: 506}}\">
                                                                <?php echo        $this->escape($item->title). ' </a>' ;
                                                                         break;

                                                        default:
                                                                // open in parent window
                                                                        echo '<a href="'.  $link . '\" class="'. $menuclass .'" rel="nofollow">'.
                                                                                $this->escape($item->title) . ' </a>';
                                                                break;
                                                }
                                        ?>
                                        </p>


                                        <?php if (($this->params->get('show_link_description')) AND ($item->description !='')): ?>
                                            <p>
                                              <?php echo nl2br($item->description); ?>
                                              </p>
                                        <?php endif; ?>

                                </td>
                                <?php if ($this->params->get('show_link_hits')) : ?>
                                <td class="hits">
                                        <?php echo $item->hits; ?>
                                </td>
                                <?php endif; ?>
                        </tr>
                        <?php endforeach; ?>
               </tbody>
                  </table>
                  <? if($this->pagination->get('pages.total')>1): ?>
               <div class="pagination">

                                        <p><?php echo $this->pagination->getPagesCounter(); ?></p>


                                <?php echo $this->pagination->getPagesLinks(); ?>

                </div>
                  <?php endif; ?>
Back to Top