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 / pages.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  14.2 KB  |  309 lines

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