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

Class: HTML_Progress2_Lite

Source Location: /HTML_Progress2-2.4.2/HTML/Progress2_Lite.php

Class Overview


Standalone HTML loading bar with only PHP and JS interface.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005-2008 Laurent Laville

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 96]
Standalone HTML loading bar with only PHP and JS interface.

The HTML_Progress2_Lite class allow you to add a quick horizontal or vertical loading bar to any of your xhtml document. You should have a browser that accept DHTML feature.

This class has no dependency and can be used completely outside the PEAR infrastructure.

Here is a basic example:

  1.  <html>
  2.  <body>
  3.  <?php
  4.  require_once 'HTML/Progress2_Lite.php';
  5.  
  6.  function myProcess()
  7.  {
  8.      for ($i=0; $i<100000; $i++}
  9.  }
  10.  
  11.  $pbl = new HTML_Progress2_Lite();
  12.  $pbl->addLabel('text','txt1','Progress2 Lite - Basic Example');
  13.  $pbl->display();
  14.  
  15.  for($i=1; $i<=100; $i++{
  16.      $pbl->moveStep($i);
  17.      myProcess();
  18.  }
  19.  ?>
  20.  </body>
  21.  </html>



[ Top ]


Class Variables

$background_color =  '#C0C0C0'

[line 213]

Progress bar foreground color.
  • Since: 2.0.0
  • Access: public

Type:   string


[ Top ]

$border = array('width' => 1, 'style' => 'solid', 'color' => '#000000')

[line 230]

Progress bar border properties

  1.  $border = array(
  2.     'width' => 1          # width size in pixel
  3.     'style' => 'solid'    # style (solid, dashed, dotted ...)
  4.     'color' => '#000000'  # color
  5.  );

  • Since: 2.0.0
  • Access: public

Type:   array


[ Top ]

$direction =  'right'

[line 239]

Direction of motion (right, left, up, down).
  • Since: 2.0.0
  • Access: public

Type:   string


[ Top ]

$foreground_color =  '#0033FF'

[line 204]

Progress bar foreground color.
  • Since: 2.0.0
  • Access: public

Type:   string


[ Top ]

$frame = array('show' => false)

[line 265]

Progress bar frame properties

  1.  $frame = array(
  2.     'show' => false,             # frame show (true/false)
  3.     'left' => 200,               # frame position from left
  4.     'top' => 100,                # frame position from top
  5.     'width' => 320,              # frame width
  6.     'height' => 90,              # frame height
  7.     'color' => '#C0C0C0',        # frame color
  8.     'border-width' => 2,         # frame border width
  9.     'border-style' => 'solid',   # frame border style (solid,
  10.                                  # dashed, dotted, inset ...)
  11.     'border-color' => '#DFDFDF #404040 #404040 #DFDFDF'
  12.                                  # frame border color (3dfx)
  13.  );


Type:   array


[ Top ]

$height =

[line 186]

Progress bar height in pixel.
  • Since: 2.0.0
  • Access: public

Type:   integer


[ Top ]

$label = array()

[line 295]

Progress bar labels properties

  1.  $label = array(
  2.     'name' => array(                  # label name
  3.       'type' => 'text',               # label type
  4.                                       # (text,button,step,percent,crossbar)
  5.       'value' => '&nbsp;',            # label value
  6.       'left' => ($left),              # label position from left
  7.       'top' => ($top - 16),           # label position from top
  8.       'width' => 0,                   # label width
  9.       'height' => 0,                  # label height
  10.       'align' => 'left',              # label align
  11.       'background-color' => 'transparent',          # label background color
  12.       'font-family' => 'Verdana, Tahoma, Arial',    # label font family
  13.       'font-size' => 11,                            # label font size
  14.       'font-weight' => 'normal',                    # label font weight
  15.       'font-style' => 'normal',                     # label font style
  16.       'color' => '#000000'                          # label font color
  17.  );


Type:   array


[ Top ]

$left =

[line 159]

Progress bar position from left.
  • Since: 2.0.0
  • Access: public

Type:   integer


[ Top ]

$max =

[line 141]

Maximum steps of the progress bar.
  • Since: 2.0.0
  • Access: public

Type:   integer


[ Top ]

$min =

[line 132]

Minimum steps of the progress bar.
  • Since: 2.0.0
  • Access: public

Type:   integer


[ Top ]

$padding =

[line 195]

Progress bar padding in pixel.
  • Since: 2.0.0
  • Access: public

Type:   integer


[ Top ]

$position =

[line 150]

Progress bar position (absolute, relative).
  • Since: 2.0.0
  • Access: public

Type:   string


[ Top ]

$top =

[line 168]

Progress bar position from top.
  • Since: 2.0.0
  • Access: public

Type:   integer


[ Top ]

$width =

[line 177]

Progress bar width in pixel.
  • Since: 2.0.0
  • Access: public

Type:   integer


[ Top ]



Method Detail

__construct (Constructor)   [line 323]

object __construct( [array $options = array()], [string $id = null])

Constructor (ZE2) Summary.
  • Since: version 2.0.0 (2005-10-01)
  • Access: protected

Parameters:

array   $options   —  (optional) has of style parameters for the progress bar
string   $id   —  (optional) progress bar unique identifier

[ Top ]

HTML_Progress2_Lite (Constructor)   [line 307]

HTML_Progress2_Lite HTML_Progress2_Lite( [array $options = array()], [string $id = null])

Constructor (ZE1)
  • Since: version 2.0.0 (2005-10-01)
  • Access: public

Parameters:

array   $options   —  (optional) has of style parameters for the progress bar
string   $id   —  (optional) progress bar unique identifier

[ Top ]

addButton   [line 521]

void addButton( string $name, string $value, string $action, [string $target = 'self'])

Add a new button with the progress bar.

Parameters:

string   $name   —  Button name
string   $value   —  Label value
string   $action   —  Action to do (see QUERY_STRING)
string   $target   —  (optional) Frame target (default is self)

[ Top ]

addLabel   [line 398]

void addLabel( string $type, string $name, [string $value = '&nbsp;'])

Add a new label to the progress bar.

Parameters:

string   $type   —  Label type (text,button,step,percent,crossbar)
string   $name   —  Label name
string   $value   —  (optional) default label value

[ Top ]

display   [line 991]

void display( )

Show the renders of the progress bar.

[ Top ]

hide   [line 1004]

void hide( )

Hides the progress bar.
  • Since: version 2.0.0 (2005-10-01)
  • Access: public

[ Top ]

moveMin   [line 799]

void moveMin( )

Changes value of the progress bar to the minimum step.

[ Top ]

moveNext   [line 786]

void moveNext( )

Changes value of the progress bar to the next step.

[ Top ]

moveStep   [line 739]

void moveStep( integer $step)

Changes new step value of the progress bar.
  • Since: version 2.0.0 (2005-10-01)
  • Access: public

Parameters:

integer   $step   —  new step value

[ Top ]

removeButton   [line 538]

void removeButton( string $name)

Removes a button to the progress bar.

Parameters:

string   $name   —  Label name

[ Top ]

removeLabel   [line 501]

void removeLabel( string $name)

Removes a label to the progress bar.

Parameters:

string   $name   —  Label name

[ Top ]

setBarAttributes   [line 590]

void setBarAttributes( [array $attributes = array()])

Defines main style of a progress bar.
  • Since: version 2.0.0 (2005-10-01)
  • Access: public

Parameters:

array   $attributes   —  (optional) hash of style parameters

[ Top ]

setDirection   [line 366]

void setDirection( string $direction)

Moves the progress bar in all directions (left, right, up , down).
  • Since: version 2.0.0 (2005-10-01)
  • Access: public

Parameters:

string   $direction   —  fill way of the progress bar

[ Top ]

setFrameAttributes   [line 554]

void setFrameAttributes( [array $attributes = array()])

Build a frame around the progress bar.
  • Since: version 2.0.0 (2005-10-01)
  • Access: public

Parameters:

array   $attributes   —  (optional) hash of style parameters

[ Top ]

setLabelAttributes   [line 649]

void setLabelAttributes( string $name, [array $attributes = array()])

Defines style of a progress bar label.

Parameters:

string   $name   —  Label identifier
array   $attributes   —  (optional) hash of style parameters

[ Top ]

show   [line 1019]

void show( )

Shows a progress bar hidden.
  • Since: version 2.0.0 (2005-10-01)
  • Access: public

[ Top ]

toHtml   [line 812]

string toHtml( )

Returns the progress bar structure as HTML.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:46:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.