Examples TOCexamples

Template ITX static

$Date: 2005/07/25 11:53:55 $

 Table of contents

Introduction

This example requires :


This example will run a progress meter embedded into a template file.

Template engine is IT(X), but you could use any others template engine.

On lines 17 thru 32, there is your user-callback (function myFunctionHandler), where you do what you want. This callback is attached on progress bar at line 80.

Inside this callback, we will show a custom string (build at line 31) at 25% (lines 22 to 24), at 50% (lines 25 to 27), at 100% (lines 28 to 30).

As for all demos, to smooth animation, i've added a sleep method at line 19. Delay depends on value set by setAnimSpeed method at line 75. In real world, you have to do a long task, so delay (sleep) is unnecesary.

Tips: to build custom string, you don't forget to set lines 78 and 79.

Depending of your template engine, you should :

Before to run the progress meter at line 107.

Note: usage of quickform is only to show you how to dynamic change look and feel of progress meter.

[Top]

 Render options

Here are options to build the progress bar cells (count=10 filled in natural way):
active-color   = #7B7B88
inactive-color = #D0D0D0
width          = 10
HTML_Progress_UI::setCellAttributes()
Here are options to build the progress bar string :
width            = 320
font-size        = 10
align            = left
valign           = bottom
background-color = #D0D0D0
HTML_Progress_UI::setStringAttributes()
Here are options to build the progress bar itself:
width  = 320
HTML_Progress_UI::setProgressAttributes()

[Top]

 Output

Screenshot

[Top]

 PHP source syntax highlight

Open source listing in a new window.

[Top]

 Play demo

Run the script.

[Top]