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

Class: HTML_Progress2_Monitor

Source Location: /HTML_Progress2-2.0.0RC2/Progress2/Monitor.php

Class Overview


The HTML_Progress2_Monitor class allow an easy way to display progress in a dialog box. The user-end can cancel the task.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 The PHP Group

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 48]
The HTML_Progress2_Monitor class allow an easy way to display progress in a dialog box. The user-end can cancel the task.

PHP versions 4 and 5

LICENSE: This source file is subject to version 3.0 of the PHP license that is available through the world-wide-web at the following URI: http://www.php.net/license/3_0.txt. If you did not receive a copy of the PHP License and are unable to obtain it through the web, please send a note to license@php.net so we can mail you a copy immediately.



[ Top ]


Class Variables

$autorun =

[line 69]

Attributes of monitor form.
  • Since: 2.0.0
  • Access: public

Type:   string


[ Top ]

$buttonCancel =

[line 68]

Attributes of monitor form.
  • Since: 2.0.0
  • Access: public

Type:   string


[ Top ]

$buttonStart =

[line 67]

Attributes of monitor form.
  • Since: 2.0.0
  • Access: public

Type:   string


[ Top ]

$caption = array()

[line 79]

Monitor status (text label of progress bar).
  • Since: 2.0.0
  • Access: public

Type:   array


[ Top ]

$dispatcher =

[line 106]

Stores the event dispatcher which handles notifications
  • Since: 2.0.0RC2
  • Access: protected

Type:   array


[ Top ]

$windowname =

[line 66]

Attributes of monitor form.
  • Since: 2.0.0
  • Access: public

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 162]

HTML_Progress2_Monitor __construct( [string $formName = 'ProgressMonitor'], [array $attributes = array()], [array $errorPrefs = array()])

Constructor (ZE2) Summary

  • Creates a standard progress bar into a dialog box (QuickForm). Form name, buttons 'start', 'cancel' labels and style, and title of dialog box may also be changed.
    1.    $monitor = new HTML_Progress2_Monitor();
  • Creates a progress bar into a dialog box, with only a new form name.
    1.    $monitor = new HTML_Progress2_Monitor($formName);
  • Creates a progress bar into a dialog box, with a new form name, new buttons name and style, and also a different title box.
    1.    $monitor = new HTML_Progress2_Monitor($formName$attributes);

  • Since: 2.0.0
  • Throws: HTML_PROGRESS2_ERROR_INVALID_INPUT
  • Access: protected

Parameters:

string   $formName   —  (optional) Name of monitor dialog box (QuickForm)
array   $attributes   —  (optional) List of renderer options
array   $errorPrefs   —  (optional) Hash of params to configure error handler

[ Top ]

HTML_Progress2_Monitor (Constructor)   [line 126]

HTML_Progress2_Monitor HTML_Progress2_Monitor( [ $formName = 'ProgressMonitor'], [ $attributes = array()], [ $errorPrefs = array()])

Constructor (ZE1)
  • Since: 2.0.0
  • Access: public

Parameters:

   $formName   — 
   $attributes   — 
   $errorPrefs   — 

[ Top ]

accept   [line 477]

void accept( &$renderer, object $renderer)

Accepts a renderer
  • Tutorial: monitor.accept.pkg
  • Since: 2.0.0
  • Access: public

Parameters:

object   $renderer   —  An HTML_QuickForm_Renderer object
   &$renderer   — 

[ Top ]

addListener   [line 238]

void addListener( mixed $callback)

Adds a new observer to the Event Dispatcher that will listen for all messages emitted by this HTML_Progress2 instance.

Parameters:

mixed   $callback   —  PHP callback that will act as listener

[ Top ]

display   [line 462]

void display( )

  • Tutorial: monitor.display.pkg
  • Since: 2.0.0RC2
  • Access: public

[ Top ]

getProgressElement   [line 374]

object &getProgressElement( )

Returns a reference to the progress bar object used with the monitor.

[ Top ]

getScript   [line 414]

string getScript( [boolean $raw = true])

Returns the javascript URL or inline code to manage progress bar.
  • Tutorial: monitor.getscript.pkg
  • Throws: HTML_PROGRESS2_ERROR_INVALID_INPUT
  • Since: 2.0.0
  • Access: public

Parameters:

boolean   $raw   —  (optional) html output with script tags or just raw data

[ Top ]

getStyle   [line 390]

string getStyle( [boolean $raw = true])

Returns progress styles (StyleSheet).
  • Tutorial: monitor.getstyle.pkg
  • Throws: HTML_PROGRESS2_ERROR_INVALID_INPUT
  • Since: 2.0.0
  • Access: public

Parameters:

boolean   $raw   —  (optional) html output with script tags or just raw data

[ Top ]

isCanceled   [line 308]

bool isCanceled( )

Returns TRUE if progress was canceled by user, FALSE otherwise.
  • Tutorial: monitor.iscanceled.pkg
  • Since: 2.0.0
  • Access: public

[ Top ]

isStarted   [line 294]

bool isStarted( )

Returns TRUE if progress was started by user, FALSE otherwise.
  • Tutorial: monitor.isstarted.pkg
  • Since: 2.0.0
  • Access: public

[ Top ]

removeListener   [line 265]

bool removeListener( mixed $callback)

Removes a registered observer.
  • Return: True if observer was removed, false otherwise
  • Tutorial: monitor.removelistener.pkg
  • See: HTML_Progress2_Monitor::addListener()
  • Throws: HTML_PROGRESS2_ERROR_INVALID_CALLBACK
  • Since: 2.0.0
  • Access: public

Parameters:

mixed   $callback   —  PHP callback that act as listener

[ Top ]

run   [line 326]

void run( )

Display Monitor and catch user action (cancel button).
  • Tutorial: monitor.run.pkg
  • Since: 2.0.0
  • Access: public

[ Top ]

setCaption   [line 510]

void setCaption( [string $caption = ' '], [array $args = array()])

Display a caption on action in progress.

The idea of a simple utility function for replacing variables with values in an message template, come from sprintfErrorMessage function of Error_Raise package by Greg Beaver.

This simple str_replace-based function can be used to have an order-independent sprintf, so messages can be passed in with different grammar ordering, or other possibilities without changing the source code.

Variables should simply be surrounded by % as in %varname%

  • Tutorial: monitor.setcaption.pkg
  • Since: 2.0.0
  • Access: public

Parameters:

string   $caption   —  (optional) message template
array   $args   —  (optional) associative array of template var -> message text

[ Top ]

setProgressElement   [line 349]

void setProgressElement( &$bar, object $bar)

Attach a progress bar to this monitor.

Parameters:

object   $bar   —  a html_progress2 instance
   &$bar   — 

[ Top ]

toHtml   [line 435]

string toHtml( )

Returns Monitor forms as a Html string.
  • Tutorial: monitor.tohtml.pkg
  • Since: 2.0.0
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:16:23 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.