[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/components/com_banners/ -> router.php (source)

   1  <?php
   2  /**
   3   * @version        $Id: router.php 14401 2010-01-26 14:10:00Z louis $
   4   * @package        Joomla
   5   * @subpackage    Banners
   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 to the
   9   * GNU General Public License, and as distributed it includes or is derivative
  10   * of works licensed under the GNU General Public License or other free or open
  11   * source software licenses. See COPYRIGHT.php for copyright notices and
  12   * details.
  13   */
  14  
  15  /**
  16   * @param    array    A named array
  17   * @return    array
  18   */
  19  function BannersBuildRoute( &$query )
  20  {
  21      $segments = array();
  22  
  23      if (isset($query['task'])) {
  24          $segments[] = $query['task'];
  25          unset( $query['task'] );
  26      }
  27      if (isset($query['bid'])) {
  28          $segments[] = $query['bid'];
  29          unset( $query['bid'] );
  30      }
  31  
  32      return $segments;
  33  }
  34  
  35  /**
  36   * @param    array    A named array
  37   * @param    array
  38   *
  39   * Formats:
  40   *
  41   * index.php?/banners/task/bid/Itemid
  42   *
  43   * index.php?/banners/bid/Itemid
  44   */
  45  function BannersParseRoute( $segments )
  46  {
  47      $vars = array();
  48  
  49      // view is always the first element of the array
  50      $count = count($segments);
  51  
  52      if ($count)
  53      {
  54          $count--;
  55          $segment = array_shift( $segments );
  56          if (is_numeric( $segment )) {
  57              $vars['bid'] = $segment;
  58          } else {
  59              $vars['task'] = $segment;
  60          }
  61      }
  62  
  63      if ($count)
  64      {
  65          $count--;
  66          $segment = array_shift( $segments) ;
  67          if (is_numeric( $segment )) {
  68              $vars['bid'] = $segment;
  69          }
  70      }
  71  
  72      return $vars;
  73  }


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