home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / pages.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  14.0 KB  |  289 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: pages.php,v 1.1 2004/02/13 15:37:32 farell Exp $
  19.  
  20. /**
  21.  * The six classes below provides GUI for interactive tools: 
  22.  * HTML Progress Generator.
  23.  *
  24.  * @version    1.1
  25.  * @author     Laurent Laville <pear@laurent-laville.org>
  26.  * @access     public
  27.  * @category   HTML
  28.  * @package    HTML_Progress
  29.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  30.  */
  31.  
  32. /**
  33.  *  Class for first Tab:
  34.  *  Progress main properties
  35.  */
  36. class Property1 extends HTML_QuickForm_Page
  37. {
  38.     function buildForm()
  39.     {
  40.         $this->_formBuilt = true;
  41.  
  42.         $this->controller->createTabs($this, array('class' => 'flat'));
  43.  
  44.         $this->addElement('header', null, 'Progress Generator - Control Panel: main properties');
  45.  
  46.         $models = array(
  47.             ''  => ' ',
  48.             'ancestor.ini'  => 'Ancestor',
  49.             'bluesand.ini'  => 'BlueSand',
  50.             'redsandback.ini'  => 'RedSandBack',
  51.             'bullit.ini'  => 'Bullit',
  52.             'smallest.ini'  => 'Smallest',
  53.             'bgimages.ini'  => 'BgImages'
  54.         );
  55.         $this->addElement('select', 'model', 'pre-set UI models:', $models);
  56.  
  57.         $this->addElement('text', 'progressclass', 'CSS class:', array('size' => 32));
  58.  
  59.         $shape[] =& $this->createElement('radio', null, null, 'Horizontal', '1');
  60.         $shape[] =& $this->createElement('radio', null, null, 'Vertical', '2');
  61.         $this->addGroup($shape, 'shape', 'Progress shape:');
  62.  
  63.         $way[] =& $this->createElement('radio', null, null, 'Natural', 'natural');
  64.         $way[] =& $this->createElement('radio', null, null, 'Reverse', 'reverse');
  65.         $this->addGroup($way, 'way', 'Progress way:');
  66.  
  67.         $autosize[] =& $this->createElement('radio', null, null, 'Yes', true);
  68.         $autosize[] =& $this->createElement('radio', null, null, 'No', false);
  69.         $this->addGroup($autosize, 'autosize', 'Progress best size:');
  70.  
  71.         $progresssize['width']   =& $this->createElement('text', 'width', null, array('size' => 4));
  72.         $progresssize['height']  =& $this->createElement('text', 'height', null, array('size' => 4));
  73.         $progresssize['bgcolor'] =& $this->createElement('text', 'bgcolor', null, array('size' => 7));
  74.         $this->addGroup($progresssize, 'progresssize', 'Size and color (width, height, bgcolor):', ', ');
  75.  
  76.         $this->addElement('text', 'rAnimSpeed', array('Animation speed (0-1000 ; 0:fast, 1000:slow):', 'Rule type \'rangelength\', $format = array(0, 1000)'));
  77.         $this->addRule('rAnimSpeed', 'Should be between 0 and 1000', 'rangelength', array(0,1000), 'client');
  78.  
  79.         $buttons = array('back'   => $this->controller->_buttonBack,
  80.                          'next'   => $this->controller->_buttonNext,
  81.                          'cancel' => $this->controller->_buttonCancel,
  82.                          'reset'  => $this->controller->_buttonReset,
  83.                          'apply'  => $this->controller->_buttonApply,
  84.                          'process'=> $this->controller->_buttonSave
  85.                          );
  86.         $this->controller->createButtons($this, $buttons, $this->controller->_buttonAttr);
  87.         $this->controller->disableButton($this, array('back','apply','process'));
  88.     }
  89. }
  90.  
  91. /**
  92.  *  Class for second Tab:
  93.  *  Cell properties
  94.  */
  95. class Property2 extends HTML_QuickForm_Page
  96. {
  97.     function buildForm()
  98.     {
  99.         $this->_formBuilt = true;
  100.  
  101.         $this->controller->createTabs($this, array('class' => 'flat'));
  102.  
  103.         $this->addElement('header', null, 'Progress Generator - Control Panel: cell properties');
  104.  
  105.         $this->addElement('text', 'cellid', 'Id mask:', array('size' => 32));
  106.         $this->addElement('text', 'cellclass', 'CSS class:', array('size' => 32));
  107.  
  108.         $cellvalue['min'] =& $this->createElement('text', 'min', null, array('size' => 4));
  109.         $cellvalue['max'] =& $this->createElement('text', 'max', null, array('size' => 4));
  110.         $cellvalue['inc'] =& $this->createElement('text', 'inc', null, array('size' => 4));
  111.         $this->addGroup($cellvalue, 'cellvalue', 'Value (minimum, maximum, increment):', ', ');
  112.  
  113.         $cellsize['width']   =& $this->createElement('text', 'width', null, array('size' => 4));
  114.         $cellsize['height']  =& $this->createElement('text', 'height', null, array('size' => 4));
  115.         $cellsize['spacing'] =& $this->createElement('text', 'spacing', null, array('size' => 2));
  116.         $cellsize['count']   =& $this->createElement('text', 'count', null, array('size' => 2));
  117.         $this->addGroup($cellsize, 'cellsize', 'Size (width, height, spacing, count):', ', ');
  118.  
  119.         $cellcolor['active']   =& $this->createElement('text', 'active', null, array('size' => 7));
  120.         $cellcolor['inactive'] =& $this->createElement('text', 'inactive', null, array('size' => 7));
  121.         $this->addGroup($cellcolor, 'cellcolor', 'Color (active, inactive):', ', ');
  122.  
  123.         $cellfont['family'] =& $this->createElement('text', 'family', null, array('size' => 32));
  124.         $cellfont['size']   =& $this->createElement('text', 'size', null, array('size' => 2));
  125.         $cellfont['color']  =& $this->createElement('text', 'color', null, array('size' => 7));
  126.         $this->addGroup($cellfont, 'cellfont', 'Font (family, size, color):', ', ');
  127.  
  128.         $buttons = array('back'   => $this->controller->_buttonBack,
  129.                          'next'   => $this->controller->_buttonNext,
  130.                          'cancel' => $this->controller->_buttonCancel,
  131.                          'reset'  => $this->controller->_buttonReset,
  132.                          'apply'  => $this->controller->_buttonApply,
  133.                          'process'=> $this->controller->_buttonSave
  134.                          );
  135.         $this->controller->createButtons($this, $buttons, $this->controller->_buttonAttr);
  136.         $this->controller->disableButton($this, array('apply','process'));
  137.     }
  138. }
  139.  
  140. /**
  141.  *  Class for third Tab:
  142.  *  Progress border properties
  143.  */
  144. class Property3 extends HTML_QuickForm_Page
  145. {
  146.     function buildForm()
  147.     {
  148.         $this->_formBuilt = true;
  149.  
  150.         $this->controller->createTabs($this, array('class' => 'flat'));
  151.  
  152.         $this->addElement('header', null, 'Progress Generator - Control Panel: border properties');
  153.  
  154.         $borderpainted[] =& $this->createElement('radio', null, null, 'Yes', true);
  155.         $borderpainted[] =& $this->createElement('radio', null, null, 'No', false);
  156.         $this->addGroup($borderpainted, 'borderpainted', 'Display a border around the progress bar:');
  157.  
  158.         $this->addElement('text', 'borderclass', 'CSS class:', array('size' => 32));
  159.  
  160.         $borderstyle['style'] =& $this->createElement('select', 'style', null, array('solid'=>'Solid', 'dashed'=>'Dashed', 'dotted'=>'Dotted', 'inset'=>'Inset', 'outset'=>'Outset'));
  161.         $borderstyle['width'] =& $this->createElement('text', 'width', null, array('size' => 2));
  162.         $borderstyle['color'] =& $this->createElement('text', 'color', null, array('size' => 7));
  163.         $this->addGroup($borderstyle, 'borderstyle', '(style, width, color):', ', ');
  164.  
  165.         $buttons = array('back'   => $this->controller->_buttonBack,
  166.                          'next'   => $this->controller->_buttonNext,
  167.                          'cancel' => $this->controller->_buttonCancel,
  168.                          'reset'  => $this->controller->_buttonReset,
  169.                          'apply'  => $this->controller->_buttonApply,
  170.                          'process'=> $this->controller->_buttonSave
  171.                          );
  172.         $this->controller->createButtons($this, $buttons, $this->controller->_buttonAttr);
  173.         $this->controller->disableButton($this, array('apply','process'));
  174.     }
  175. }
  176.  
  177. /**
  178.  *  Class for fourth Tab:
  179.  *  String properties
  180.  */
  181. class Property4 extends HTML_QuickForm_Page
  182. {
  183.     function buildForm()
  184.     {
  185.         $this->_formBuilt = true;
  186.  
  187.         $this->controller->createTabs($this, array('class' => 'flat'));
  188.  
  189.         $this->addElement('header', null, 'Progress Generator - Control Panel: string properties');
  190.  
  191.         $stringpainted[] =& $this->createElement('radio', null, null, 'Yes', true);
  192.         $stringpainted[] =& $this->createElement('radio', null, null, 'No', false);
  193.         $this->addGroup($stringpainted, 'stringpainted', 'Render a custom string:');
  194.  
  195.         $this->addElement('text', 'stringid', 'Id:', array('size' => 32));
  196.  
  197.         $stringsize['width']   =& $this->createElement('text', 'width', null, array('size' => 4));
  198.         $stringsize['height']  =& $this->createElement('text', 'height', null, array('size' => 4));
  199.         $stringsize['bgcolor'] =& $this->createElement('text', 'bgcolor', null, array('size' => 7));
  200.         $this->addGroup($stringsize, 'stringsize', 'Size and color (width, height, bgcolor):', ', ');
  201.  
  202.         $stringvalign[] =& $this->createElement('radio', null, null, 'Left', 'left');
  203.         $stringvalign[] =& $this->createElement('radio', null, null, 'Right', 'right');
  204.         $stringvalign[] =& $this->createElement('radio', null, null, 'Top', 'top');
  205.         $stringvalign[] =& $this->createElement('radio', null, null, 'Bottom', 'bottom');
  206.         $this->addGroup($stringvalign, 'stringvalign', 'Vertical alignment:');
  207.  
  208.         $stringalign[] =& $this->createElement('radio', null, null, 'Left', 'left');
  209.         $stringalign[] =& $this->createElement('radio', null, null, 'Right', 'right');
  210.         $stringalign[] =& $this->createElement('radio', null, null, 'Center', 'center');
  211.         $this->addGroup($stringalign, 'stringalign', 'Horizontal alignment:');
  212.  
  213.         $stringfont['family'] =& $this->createElement('text', 'family', null, array('size' => 40));
  214.         $stringfont['size']   =& $this->createElement('text', 'size', null, array('size' => 2));
  215.         $stringfont['color']  =& $this->createElement('text', 'color', null, array('size' => 7));
  216.         $this->addGroup($stringfont, 'stringfont', 'Font (family, size, color):', ', ');
  217.  
  218.         $this->addElement('textarea', 'strings', 'percent, string thrown:', array('rows' => 10, 'cols' => 50));
  219.  
  220.         $buttons = array('back'   => $this->controller->_buttonBack,
  221.                          'next'   => $this->controller->_buttonNext,
  222.                          'cancel' => $this->controller->_buttonCancel,
  223.                          'reset'  => $this->controller->_buttonReset,
  224.                          'apply'  => $this->controller->_buttonApply,
  225.                          'process'=> $this->controller->_buttonSave
  226.                          );
  227.         $this->controller->createButtons($this, $buttons, $this->controller->_buttonAttr);
  228.         $this->controller->disableButton($this, array('apply','process'));
  229.     }
  230. }
  231.  
  232. /**
  233.  *  Class for fifth Tab:
  234.  *  Show a preview of your progress bar design.
  235.  */
  236. class Preview extends HTML_QuickForm_Page
  237. {
  238.     function buildForm()
  239.     {
  240.         $this->_formBuilt = true;
  241.  
  242.         $this->controller->createTabs($this, array('class' => 'flat'));
  243.  
  244.         $this->addElement('header', null, 'Progress Generator - Control Panel: run demo');
  245.  
  246.         $this->addElement('static', 'progressBar', 'Your progress bar looks like:');
  247.  
  248.         $buttons = array('back'   => $this->controller->_buttonBack,
  249.                          'next'   => $this->controller->_buttonNext,
  250.                          'cancel' => $this->controller->_buttonCancel,
  251.                          'reset'  => $this->controller->_buttonReset,
  252.                          'apply'  => $this->controller->_buttonApply,
  253.                          'process'=> $this->controller->_buttonSave
  254.                          );
  255.         $this->controller->createButtons($this, $buttons, $this->controller->_buttonAttr);
  256.         $this->controller->disableButton($this, array('reset','process'));
  257.     }
  258. }
  259.  
  260. /**
  261.  *  Class for sixth Tab:
  262.  *  Save PHP and/or CSS code
  263.  */
  264. class Save extends HTML_QuickForm_Page
  265. {
  266.     function buildForm()
  267.     {
  268.         $this->_formBuilt = true;
  269.  
  270.         $this->controller->createTabs($this, array('class' => 'flat'));
  271.  
  272.         $this->addElement('header', null, 'Progress Generator - Control Panel: save PHP/CSS code');
  273.  
  274.         $code[] =& $this->createElement('checkbox', 'P', null, 'PHP');
  275.         $code[] =& $this->createElement('checkbox', 'C', null, 'CSS');
  276.         $this->addGroup($code, 'phpcss', 'PHP and/or StyleSheet source code:');
  277.  
  278.         $buttons = array('back'   => $this->controller->_buttonBack,
  279.                          'next'   => $this->controller->_buttonNext,
  280.                          'cancel' => $this->controller->_buttonCancel,
  281.                          'reset'  => $this->controller->_buttonReset,
  282.                          'apply'  => $this->controller->_buttonApply,
  283.                          'process'=> $this->controller->_buttonSave
  284.                          );
  285.         $this->controller->createButtons($this, $buttons, $this->controller->_buttonAttr);
  286.         $this->controller->disableButton($this, array('next','apply'));
  287.     }
  288. }
  289. ?>