[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/components/com_weblinks/views/weblinks/ -> view.html.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: view.html.php 19343 2010-11-03 18:12:02Z ian $
   4  * @package        Joomla
   5  * @subpackage    Weblinks
   6  * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7  * @license        GNU/GPL, see LICENSE.php
   8  * Joomla! is free software. This version may have been modified pursuant
   9  * to the GNU General Public License, and as distributed it includes or
  10  * is derivative of works licensed under the GNU General Public License or
  11  * other free or open source software licenses.
  12  * See COPYRIGHT.php for copyright notices and details.
  13  */
  14  
  15  // Check to ensure this file is included in Joomla!
  16  defined('_JEXEC') or die( 'Restricted access' );
  17  
  18  jimport( 'joomla.application.component.view');
  19  
  20  /**
  21   * HTML View class for the WebLinks component
  22   *
  23   * @static
  24   * @package        Joomla
  25   * @subpackage    Weblinks
  26   * @since 1.0
  27   */
  28  class WeblinksViewWeblinks extends JView
  29  {
  30  	function display($tpl = null)
  31      {
  32          global $mainframe, $option;
  33  
  34          $db        =& JFactory::getDBO();
  35          $uri    =& JFactory::getURI();
  36  
  37          $filter_state        = $mainframe->getUserStateFromRequest( $option.'filter_state',        'filter_state',        '',                'word' );
  38          $filter_catid        = $mainframe->getUserStateFromRequest( $option.'filter_catid',        'filter_catid',        0,                'int' );
  39          $filter_order        = $mainframe->getUserStateFromRequest( $option.'filter_order',        'filter_order',        'a.ordering',    'cmd' );
  40          $filter_order_Dir    = $mainframe->getUserStateFromRequest( $option.'filter_order_Dir',    'filter_order_Dir',    '',                'word' );
  41          $search                = $mainframe->getUserStateFromRequest( $option.'search',            'search',            '',                'string' );
  42          if (strpos($search, '"') !== false) {
  43              $search = str_replace(array('=', '<'), '', $search);
  44          }
  45          $search = JString::strtolower($search);
  46  
  47          // sanitize $filter_order
  48          if (!in_array($filter_order, array('a.title', 'a.published', 'a.ordering', 'category', 'a.hits', 'a.id'))) {
  49              $filter_order = 'a.ordering';
  50          }
  51  
  52          if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
  53              $filter_order_Dir = '';
  54          }
  55  
  56          // Get data from the model
  57          $items        = & $this->get( 'Data');
  58          $total        = & $this->get( 'Total');
  59          $pagination = & $this->get( 'Pagination' );
  60  
  61          // build list of categories
  62          $javascript     = 'onchange="document.adminForm.submit();"';
  63          $lists['catid'] = JHTML::_('list.category',  'filter_catid', $option, intval( $filter_catid ), $javascript );
  64  
  65          // state filter
  66          $lists['state']    = JHTML::_('grid.state',  $filter_state );
  67  
  68          // table ordering
  69          $lists['order_Dir'] = $filter_order_Dir;
  70          $lists['order'] = $filter_order;
  71  
  72          // search filter
  73          $lists['search']= $search;
  74  
  75          $this->assignRef('user',        JFactory::getUser());
  76          $this->assignRef('lists',        $lists);
  77          $this->assignRef('items',        $items);
  78          $this->assignRef('pagination',    $pagination);
  79  
  80          parent::display($tpl);
  81      }
  82  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1