b2evolution PHP Cross Reference Blogging Systems

Source: /inc/_filters.inc.php - 51 lines - 1813 bytes - Text - Print

Description: This is the handler/dispatcher for asynchronous calls (both AJax calls and HTTP GET fallbacks)

   1  <?php
   2  /**
   3   * This is the handler/dispatcher for asynchronous calls (both AJax calls and HTTP GET fallbacks)
   4   *
   5   * This file is part of the evoCore framework - {@link http://evocore.net/}
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   9   *
  10   * {@internal License choice
  11   * - If you have received this file as part of a package, please find the license.txt file in
  12   *   the same folder or the closest folder above for complete license terms.
  13   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  14   *   then you must choose one of the following licenses before using the file:
  15   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  16   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  17   * }}
  18   *
  19   * {@internal Open Source relicensing agreement:
  20   * }}
  21   *
  22   * @package evocore
  23   *
  24   * @version $Id: _filters.inc.php 6136 2014-03-08 07:59:48Z manuel $
  25   */
  26  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  27  
  28  $action = param( 'action', 'string', '' );
  29  
  30  switch( $action )
  31  {
  32      case 'collapse_filter':
  33      case 'expand_filter':
  34          param( 'target', 'string', '' );
  35          if( !empty( $target ) )
  36          {    // We want to record a 'collapse'/'expand' value:
  37              $target_status = $action == 'collapse_filter' ? 'collapsed' : 'expanded';
  38              if( preg_match( '/_(filters|colselect)$/', $target ) )
  39              {    // accept all _filters and _colselect open/close requests!
  40                  // We have a valid value:
  41                  $Session->set( $target, $target_status );
  42              }
  43              else
  44              {    // Warning: you may not see this on AJAX calls
  45                  $Messages->add( 'Cannot ['.$target_status.'] unknown param ['.$target.']' );
  46              }
  47          }
  48          break;
  49  }
  50  
  51  ?>

title

Description

title

Description

title

Description

title

title

Body