Class form_imagecombo

Description

Image Combo class

This is a hybrid field. It is basically a single-line combo field where the list of values are unique IDs of an image (eg. Axyl catalog ID). A preview of the selected image is displayed below the combo, in fixed size (configurable).

Located in /form-defs.php (line 1871)

RenderableObject
   |
   --StylableObject
      |
      --HTMLObject
         |
         --form_field
            |
            --form_textfield
               |
               --form_combofield
                  |
                  --form_imagecombo
Variable Summary
Method Summary
 form_imagecombo form_imagecombo ([string $name = ""], [string $label = ""], [string $value = ""], [boolean $editable = EDITABLE], [string $css = ""], [mixed $formname = ""], integer $width)
 void additem (string $imgkey, string $imgdesc, [string $imgurl = ""])
 string html ([mixed $name = ""], string $formname)
 void set_formname (string $formname)
 void set_preview_metrics ([integer $prev_width = 125], [integer $prev_height = 125])
Variables
mixed $formname = "" (line 1881)

The form this widget is to be displayed in

mixed $image_keys = array() (line 1873)

Array of image IDs we have in our combo

mixed $image_urls = array() (line 1875)

Array of image URLS, one per ID above

mixed $preview_img_height = 125 (line 1879)

Height of preview in px

mixed $preview_img_width = 125 (line 1877)

Width of preview in px

Inherited Variables

Inherited from form_combofield

form_combofield::$itemlist
form_combofield::$multiselect

Inherited from form_textfield

form_textfield::$format
form_textfield::$maxlength

Inherited from form_field

form_field::$autocomplete
form_field::$disabled
form_field::$editable
form_field::$label
form_field::$type
form_field::$value

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 form_imagecombo (line 1893)

Constructor Create a field object. Sets basic field attributes.

form_imagecombo form_imagecombo ([string $name = ""], [string $label = ""], [string $value = ""], [boolean $editable = EDITABLE], [string $css = ""], [mixed $formname = ""], integer $width)
  • string $name: The name of the field
  • string $label: The label which can be displayed alongside the field
  • string $value: The value of the field
  • boolean $editable: Editability: EDITABLE or DISPLAY_ONLY (true or false)
  • string $css: CSS class or style to apply to the button
  • integer $width: Width of element in characters
additem (line 1922)

Add an image item to preview. We override the combofield additem() so we can store the image URL against the key value nin our arrays.

These get rendered as hidden fields for the preview javascript.

void additem (string $imgkey, string $imgdesc, [string $imgurl = ""])
  • string $imgkey: The key or unique ID of this image
  • string $imgdesc: The description or name of this image
  • string $imgurl: The URl of this image, to display it

Redefinition of:
form_combofield::additem()
Add a data item Adds a key=>value pair into the combo options collection.
html (line 1935)

This renders the field as HTML. Note that because of the special nature of this widget, we need to know the name of the form it is in to do the previewing. Without it, no preview image is displayed.

  • return: The field as HTML.
string html ([mixed $name = ""], string $formname)
  • string $formname: Name of the form this widget is placed in.

Redefinition of:
form_combofield::html()
This renders the field as HTML.
set_formname (line 1911)

Set the name of the form this will be displayed in.

void set_formname (string $formname)
  • string $formname: The name of the form hosting this field
set_preview_metrics (line 1903)

Set the width and height of the preview image. The default setting is 125 x 125 pixels.

void set_preview_metrics ([integer $prev_width = 125], [integer $prev_height = 125])
  • integer $prev_width: The width of the preview image (px)
  • integer $prev_height: The height of the preview image (px)

Inherited Methods

Inherited From form_combofield

 form_combofield::form_combofield()
 form_combofield::additem()
 form_combofield::add_querydata()
 form_combofield::clearitems()
 form_combofield::html()
 form_combofield::ovenready_data()
 form_combofield::set_size()
 form_combofield::set_width()
 form_combofield::wml()

Inherited From form_textfield

 form_textfield::form_textfield()
 form_textfield::html()
 form_textfield::set_format()
 form_textfield::set_width()
 form_textfield::wml()

Inherited From form_field

 form_field::form_field()
 form_field::as_displayonly()
 form_field::as_hiddenfield()
 form_field::disable_autocomplete()
 form_field::setlabel()
 form_field::setvalue()
 form_field::set_displayonly()

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