home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2005 June / PCpro_2005_06.ISO / files / opensource / xamp / xampp-win32.exe / xampp / ITDynamic.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  2.9 KB  |  74 lines

  1. <?php
  2. // +----------------------------------------------------------------------+
  3. // | PHP Version 4                                                        |
  4. // +----------------------------------------------------------------------+
  5. // | Copyright (c) 1997-2004 The PHP Group                                |
  6. // +----------------------------------------------------------------------+
  7. // | This source file is subject to version 3.0 of the PHP license,       |
  8. // | that is bundled with this package in the file LICENSE, and is        |
  9. // | available at through the world-wide-web at                           |
  10. // | http://www.php.net/license/3_0.txt.                                  |
  11. // | If you did not receive a copy of the PHP license and are unable to   |
  12. // | obtain it through the world-wide-web, please send a note to          |
  13. // | license@php.net so we can mail you a copy immediately.               |
  14. // +----------------------------------------------------------------------+
  15. // | Author: Laurent Laville <pear@laurent-laville.org>                   |
  16. // +----------------------------------------------------------------------+
  17. //
  18. // $Id: ITDynamic.php,v 1.1 2004/02/13 15:36:55 farell Exp $
  19.  
  20. require_once 'HTML/QuickForm/Renderer/ITDynamic.php';
  21. // can use either HTML_Template_Sigma or HTML_Template_ITX
  22. require_once 'HTML/Template/ITX.php';
  23. //require_once 'HTML/Template/Sigma.php';
  24.  
  25. /**
  26.  * The ActionDisplay class provides a ITDynamic form rendering
  27.  * with template engine IT[x] family.
  28.  *
  29.  * @version    1.1
  30.  * @author     Laurent Laville <pear@laurent-laville.org>
  31.  * @access     public
  32.  * @category   HTML
  33.  * @package    HTML_Progress
  34.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  35.  */
  36.  
  37. class ActionDisplay extends HTML_QuickForm_Action_Display
  38. {
  39.     function _renderForm(&$page) 
  40.     {
  41.         $pageName = $page->getAttribute('name');
  42.         $tabPreview = array_slice ($page->controller->_tabs, -2, 1);
  43.  
  44.         // can use either HTML_Template_Sigma or HTML_Template_ITX
  45.         $tpl =& new HTML_Template_ITX('./templates');
  46.         // $tpl =& new HTML_Template_Sigma('./templates');
  47.  
  48.         $tpl->loadTemplateFile('itdynamic.html');
  49.  
  50.         // on preview tab, add progress bar javascript and stylesheet
  51.         if ($pageName == $tabPreview[0][0]) {
  52.             $bar = $page->controller->createProgressBar();
  53.  
  54.             $tpl->setVariable(array(
  55.                 'qf_style'  => $bar->getStyle(),
  56.                 'qf_script' => $bar->getScript()
  57.                 )
  58.             );
  59.  
  60.             $barElement =& $page->getElement('progressBar');
  61.             $barElement->setText( $bar->toHtml() );
  62.         }
  63.  
  64.         $renderer =& new HTML_QuickForm_Renderer_ITDynamic($tpl);
  65.         $renderer->setElementBlock(array(
  66.             'buttons'     => 'qf_buttons'
  67.         ));
  68.  
  69.         $page->accept($renderer);
  70.  
  71.         $tpl->show();
  72.     }
  73. }
  74. ?>