internal package Foswiki::Configure::Type

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

internal package Foswiki::Configure::Type

Base class of all types. Types are involved only in the presentation of values in the configure interface. They do not play any part in loading, saving or checking configuration values.

This is not an abstract class. Objects of this type are used when a specialised class for a type cannot be found.

StaticMethod load($id, $keys) → $typeObject

Load the named type object
  • $id - the type name e.g. SELECTCLASS
  • $keys - the item the type is being loaded for. Only used to generate errors.

ObjectMethod prompt(id) → $html

  • $id e.g. {This}{Item}
  • $opts formatting options e.g. 10x30
  • $value current value of item (string)
  • $class CSS class
Generate HTML for a suitable prompt for the type. Default behaviour is a string 55% of the width of the display area. Subclasses will override this.

ObjectMethod equals($a, $b)

Test to determine if two values of this type are equal.
  • $a, $b the values (strings, usually)

ObjectMethod string2value($string) → $data

Used to process input values from CGI. Values taken from the query are run through this method before being saved in the value store. It should not be used to do validation - use a Checker to do that, or JavaScript invoked from the prompt.

Topic revision: r1 - 19 Apr 2011, ProjectContributor
 

This site is powered by FoswikiCopyright &© by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding BACCHUS Wiki? Send feedback