home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / HTML / Progress / generator / ITDynamic.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  3.1 KB  |  88 lines

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