Class image_button

Description

Image button.

A form elelement which behaves like a submit button, but takes the form of the given image

Located in /button-defs.php (line 212)

button_object
   |
   --button
      |
      --image_button
Variable Summary
 mixed $border
 mixed $img
 mixed $target
 mixed $title
 mixed $type
Method Summary
 image_button image_button (string $action, [string $label = ""], [string $parms = ""], [string $onclick = ""], [string $src = ""], integer $width, integer $height, [string $alt = ""], string $border)
 string html ([mixed $action = ""])
 void set_confirm_text (string $conf)
 void set_image (string $src, integer $width, integer $height, [string $alt = ""], string $border)
 void set_window_target (string $target, [integer $win_width = 200], [integer $win_height = 200])
Variables
mixed $border = 0 (line 222)

Border size, pixels

mixed $confirm_text = "" (line 224)

Popup confirmation text to display on button click

mixed $img (line 214)

Image object for this button

mixed $onclick_form_submit = false (line 226)

Whether to allow form submit on-click

mixed $target = "" (line 216)

Target URL for a window to open when button clicked

mixed $title = "" (line 220)

Title/tooltip

mixed $type = "image" (line 218)

Form element type ID

Inherited Variables

Inherited from button

button::$accesskey
button::$confirmation
button::$onclick
Methods
Constructor image_button (line 241)

Constructor

image_button image_button (string $action, [string $label = ""], [string $parms = ""], [string $onclick = ""], [string $src = ""], integer $width, integer $height, [string $alt = ""], string $border)
  • string $action: The name of the button control in the form
  • string $label: The label which might be attached to the button
  • string $parms: Optional parameters
  • string $onclick: Optional javascript for onclick event
  • string $src: URL or path to image for the button
  • integer $width: Button image width (px)
  • integer $height: Button image height (px)
  • string $alt: Button image alt tag content
  • string $border: Size of border around image
html (line 303)

Use render() to render this element in your page.

This renders the image button as HTML. If we have onclick then we render this as a simple image with a javascript URL rather than a INPUT form element of type "image". This is done to cope with Netscape's lack of an onclick event handler for INPUT TYPE=IMAGE, and we don't use BUTTON since that's only HTML4.

  • return: HTML rendering of button
  • see: render()
string html ([mixed $action = ""])

Redefinition of:
button::html()
Use render() to render this element in your page.
set_confirm_text (line 275)

Set the confirmation text to popup on click.

void set_confirm_text (string $conf)
  • string $conf: Tetx to display in the confirmation popup.
set_image (line 261)

Sets the image to display for this button.

Usually these details are specified in the initial instantiation

void set_image (string $src, integer $width, integer $height, [string $alt = ""], string $border)
  • string $src: URL or path to image for the button
  • integer $width: Button image width (px)
  • integer $height: Button image height (px)
  • string $alt: Button image alt tag content
  • string $border: Size of border around image
set_window_target (line 286)

Specific function for use with the rugbyvu framework. This causes a button click to open another browser window as a popup.

void set_window_target (string $target, [integer $win_width = 200], [integer $win_height = 200])
  • string $target: URL to fill window with
  • integer $win_width: Width of new window (px)
  • integer $win_height: Height of new window (px)

Inherited Methods

Inherited From button

 button::button()
 button::html()
 button::set_confirmation()
 button::set_onclick()

Documentation generated by phpDocumentor 1.3.0RC3