HTML_QuickForm_Controller
[ class tree: HTML_QuickForm_Controller ] [ index: HTML_QuickForm_Controller ] [ all elements ]

Source for file Jump.php

Documentation is available at Jump.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP version 4.0                                                      |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Author: Alexey Borzov <avb@php.net>                                  |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: Jump.php,v 1.4 2005/11/04 19:16:11 avb Exp $
  20.  
  21. require_once 'HTML/QuickForm/Action.php';
  22.  
  23. /**
  24.  * The action handles the HTTP redirect to a specific page.
  25.  * 
  26.  * @author  Alexey Borzov <avb@php.net>
  27.  * @package HTML_QuickForm_Controller
  28.  * @version $Revision: 1.4 $
  29.  */
  30. {
  31.     function perform(&$page$actionName)
  32.     {
  33.         // check whether the page is valid before trying to go to it
  34.         if ($page->controller->isModal()) {
  35.             // we check whether *all* pages up to current are valid
  36.             // if there is an invalid page we go to it, instead of the
  37.             // requested one
  38.             $pageName $page->getAttribute('id');
  39.             if (!$page->controller->isValid($pageName)) {
  40.                 $pageName $page->controller->findInvalid();
  41.             }
  42.             $current =$page->controller->getPage($pageName);
  43.  
  44.         else {
  45.             $current =$page;
  46.         }
  47.         // generate the URL for the page 'display' event and redirect to it
  48.         $action $current->getAttribute('action');
  49.         $url    $action (false === strpos($action'?')'?''&'.
  50.                   $current->getButtonName('display''=true' .
  51.                   ((!defined('SID'|| '' == SID || ini_get('session.use_only_cookies'))'''&' . SID);
  52.         header('Location: ' $url);
  53.         exit;
  54.     }
  55. }
  56. ?>

Documentation generated on Sat, 14 Oct 2006 08:32:15 -0400 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.