Class digital_clock

Description

The digital_clock class. This is implemented as a 'layer' or 'div'

and rendered using Javascript. UNless you specify the initial time yourself, the time will be taken from the server, rather than from the user's browser, which may be innaccurate. Timezone settings are then used to adjust it to display the appropriate date & time.

Located in /clock-defs.php (line 66)

RenderableObject
   |
   --StylableObject
      |
      --HTMLObject
         |
         --digital_clock
Variable Summary
 mixed $clockid
 mixed $css_date
 mixed $css_time
 mixed $date_format
 mixed $initial_ts
 mixed $leftx
 mixed $position
 mixed $topy
 mixed $tz
 mixed $visibility
Method Summary
 digital_clock digital_clock ([integer $initial_ts = ""])
 void html ()
 void set_css_date ($css $css)
 void set_css_time ($css $css)
 void set_date_format ($css $fmt)
 void set_display_property (integer $propertyid, mixed $value)
 void set_position ([integer $leftx = ""], [integer $topy = ""], [string $pos = "absolute"])
 void set_timezone (mixed $tz)
 void set_to_gmt ()
 void set_update_interval_secs (integer $secs)
 void set_visibility ([string $vis = "visible"])
 void show_24hrs ()
 void show_date ()
 void show_date_first ()
 void show_dayname ()
 void show_inline ()
 void show_seconds ()
Variables
mixed $clockid = "" (line 68)

Unique ID for this clock widget

mixed $css_date (line 89)

Style or class for date display

mixed $css_time (line 87)

Style or class for time digits

mixed $date_format = "M d, ccyy" (line 91)

Date format eg. 'M d, ccyy' for 'April 4, 2005'

mixed $display_properties = array() (line 85)

Clock display settings. An array of booleans.

mixed $initial_ts = "" (line 70)

Initial time to set the clock to

mixed $leftx (line 77)

X-offset from left

mixed $position = "" (line 81)

Positioning mode

mixed $topy (line 79)

Y-offset from top

mixed $tz (line 75)

The timezone offset in +/- hours from GMT.

mixed $update_interval_ms = 1000 (line 94)

Interval between clock updates in millisecs

mixed $visibility = "visible" (line 83)

Visibility setting

Inherited Variables

Inherited from HTMLObject

HTMLObject::$accesskey
HTMLObject::$align
HTMLObject::$alt
HTMLObject::$bgcolor
HTMLObject::$bgurl
HTMLObject::$border
HTMLObject::$color
HTMLObject::$height
HTMLObject::$hspace
HTMLObject::$lang
HTMLObject::$langdir
HTMLObject::$linkover_text
HTMLObject::$name
HTMLObject::$onblur
HTMLObject::$onchange
HTMLObject::$onclick
HTMLObject::$ondblclick
HTMLObject::$onfocus
HTMLObject::$onkeydown
HTMLObject::$onkeypress
HTMLObject::$onkeyup
HTMLObject::$onload
HTMLObject::$onmousedown
HTMLObject::$onmousemove
HTMLObject::$onmouseout
HTMLObject::$onmouseover
HTMLObject::$onmouseup
HTMLObject::$onselect
HTMLObject::$size
HTMLObject::$src
HTMLObject::$tabindex
HTMLObject::$target
HTMLObject::$title
HTMLObject::$user_attributes
HTMLObject::$valign
HTMLObject::$vspace
HTMLObject::$width

Inherited from StylableObject

StylableObject::$class
StylableObject::$id
StylableObject::$style
Methods
Constructor digital_clock (line 100)

Constructor for the clock

digital_clock digital_clock ([integer $initial_ts = ""])
  • integer $initial_ts: Optional initial time - a Unix timestamp
abbreviate_dayname (line 195)
void abbreviate_dayname ()
html (line 227)

Render the clock.

void html ()

Redefinition of:
RenderableObject::html()
Return output suitable for normal HTML-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to web browsers.
set_css_date (line 210)

Set the style of class for the date display

void set_css_date ($css $css)
  • $css $css: string Style or class name for date display
set_css_time (line 203)

Set the style of class for the time display

void set_css_time ($css $css)
  • $css $css: string Style or class name for time display
set_date_format (line 220)

Set the format for the date display. This is just done by replacement in a format string where d=month date, M=month name, m=month no, cc=century, and yy=year (99). Eg. 'm d, ccyy' would give 'April 4, 2005'. Another example would be 'd/m/yy' which would render '4/4/05'.

void set_date_format ($css $fmt)
  • $css $fmt: string Style or class name for date display
set_display_property (line 184)

Set a display property for the clock. Display property IDs are defined at the top of this script, and can be any type of content. NB: Boolean properties are so arranged that the default is always false.

void set_display_property (integer $propertyid, mixed $value)
  • integer $propertyid: ID of the property to set
  • mixed $value: Value for the given display property
set_position (line 131)

Set the position and the positioning directive for the clock.

void set_position ([integer $leftx = ""], [integer $topy = ""], [string $pos = "absolute"])
  • integer $leftx: Pixels from left margin
  • integer $topy: Pixels from top margin
  • string $pos: Positioning mode "absolute" or "relative"
set_timezone (line 149)

Set the timezone to use for this clock. The argument should be an integer (or decimal) in the range +12 to -12, in hours offset from GMT.

void set_timezone (mixed $tz)
  • mixed $tz: From +12 to -12 hours offset from GMT.
set_to_gmt (line 161)

Special set timezone case - setting to GMT (0 hours offset).

void set_to_gmt ()
set_update_interval_secs (line 171)

Set the number of seconds to wait before updating the clock each time.

The default value is every second, but if you aren't showing seconds then you might want to offload the browser a little and make it every 30 secs or even longer.

void set_update_interval_secs (integer $secs)
  • integer $secs: Number of seconds between updates
set_visibility (line 141)

Set the starting visibility for the clock. In case you want to reveal/hide it with some javascript.

void set_visibility ([string $vis = "visible"])
  • string $vis: Visibility: "visible" or "hidden"
show_24hrs (line 191)
void show_24hrs ()
show_date (line 193)
void show_date ()
show_date_first (line 196)
void show_date_first ()
show_dayname (line 194)
void show_dayname ()
show_inline (line 197)
void show_inline ()
show_seconds (line 192)
void show_seconds ()

Inherited Methods

Inherited From HTMLObject

 HTMLObject::HTMLObject()
 HTMLObject::inherit_attributes()
 HTMLObject::setaccesskey()
 HTMLObject::setalign()
 HTMLObject::setalt()
 HTMLObject::setbackground()
 HTMLObject::setbgcolor()
 HTMLObject::setborder()
 HTMLObject::setcolor()
 HTMLObject::setheight()
 HTMLObject::sethspace()
 HTMLObject::setlang()
 HTMLObject::setlangdir()
 HTMLObject::setname()
 HTMLObject::setsize()
 HTMLObject::setsrc()
 HTMLObject::settabindex()
 HTMLObject::settarget()
 HTMLObject::settitle()
 HTMLObject::setvalign()
 HTMLObject::setvspace()
 HTMLObject::setwidth()
 HTMLObject::set_attribute()
 HTMLObject::set_linkover_text()
 HTMLObject::set_onblur()
 HTMLObject::set_onchange()
 HTMLObject::set_onclick()
 HTMLObject::set_ondblclick()
 HTMLObject::set_onfocus()
 HTMLObject::set_onkeydown()
 HTMLObject::set_onkeypress()
 HTMLObject::set_onkeyup()
 HTMLObject::set_onload()
 HTMLObject::set_onmousedown()
 HTMLObject::set_onmousemove()
 HTMLObject::set_onmouseout()
 HTMLObject::set_onmouseover()
 HTMLObject::set_onmouseup()
 HTMLObject::set_onselect()
 HTMLObject::set_tabindex()
 HTMLObject::taghtml()

Inherited From StylableObject

 StylableObject::StylableObject()
 StylableObject::clearstyle()
 StylableObject::setclass()
 StylableObject::setcss()
 StylableObject::setid()
 StylableObject::setstyle()

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3