Field FieldTagList FieldSelect

public class FieldSelect extends FieldTagList

field.select.php #11

A simple Select field that essentially maps to HTML's <select/>. The options for this field can be static, or feed from another field.

Methods

void __construct()

Construct a new instance of this field.

boolean allowDatasourceOutputGrouping()

Test whether this field supports data source output grouping. This default implementation prohibits grouping. Data-source grouping allows clients of this field to group the XML output according to this field. Subclasses should override this if grouping is supported.

Returns

true if this field does support data source grouping, false otherwise.

boolean allowDatasourceParamOutput()

Test whether this field supports data source parameter output. This default implementation prohibits parameter output. Data-source parameter output allows this field to be provided as a parameter to other data sources or XSLT. Subclasses should override this if parameter output is supported.

Returns

true if this supports data source parameter output, false otherwise.

boolean canFilter()

Test whether this field can be filtered. This default implementation prohibits filtering. Filtering allows the XML output results to be limited according to an input parameter. Subclasses should override this if filtering is supported.

Returns

true if this can be filtered, false otherwise.

boolean canPrePopulate()

Test whether this field can be prepopulated with data. This default implementation does not support pre-population and, thus, returns false.

Returns

true if this can be pre-populated, false otherwise.

boolean canToggle()

Test whether this field can be toggled using the With Selected menu on the Publish Index.

Returns

true if it can be toggled, false otherwise.

integer checkFields(array $errors, bool $checkForDuplicates)

Check the field's settings to ensure they are valid on the section editor

Parameters
  • $errors arraythe array to populate with the errors found.

  • $checkForDuplicates bool(optional) if set to true, duplicate Field name's in the same section will be flagged as errors. Defaults to true.

Returns

returns the status of the checking. if errors has been populated with any errors self::__ERROR__, self::__OK__ otherwise.

integer checkPostFieldData(array $data, string $message, integer $entry_id)

Check the field data that has been posted from a form. This will set the input message to the error message or to null if there is none. Any existing message value will be overwritten.

Parameters
  • $data arraythe input data to check.

  • $message stringthe place to set any generated error message. any previous value for this variable will be overwritten.

  • $entry_id integer(optional) the optional id of this field entry instance. this defaults to null.

Returns

self::__MISSING_FIELDS__ if there are any missing required fields, self::__OK__ otherwise.

boolean commit()

Commit the settings of this field from the section editor to create an instance of this field in a section.

Returns

true if the commit was successful, false otherwise.

boolean createTable()

The default field table construction method. This constructs the bare minimum set of columns for a valid field table. Subclasses are expected to overload this method to create a table structure that contains additional columns to store the specific data created by the field.

See Also
void displayFilteringOptions(XMLElement $wrapper)

Inserts tags at the bottom of the filter panel

void displayPublishPanel(XMLElement $wrapper, array $data, mixed $flagWithError, string $fieldnamePrefix, string $fieldnamePostfix, integer $entry_id)

Display the publish panel for this field. The display panel is the interface shown to Authors that allow them to input data into this field for an Entry.

Parameters
  • $wrapper XMLElementthe XML element to append the html defined user interface to this field.

  • $data array(optional) any existing data that has been supplied for this field instance. this is encoded as an array of columns, each column maps to an array of row indexes to the contents of that column. this defaults to null.

  • $flagWithError mixed(optional) flag with error defaults to null.

  • $fieldnamePrefix string(optional) the string to be prepended to the display of the name of this field. this defaults to null.

  • $fieldnamePostfix string(optional) the string to be appended to the display of the name of this field. this defaults to null.

  • $entry_id integer(optional) the entry id of this field. this defaults to null.

void displaySettingsPanel(XMLElement $wrapper, mixed $errors)

Display the default settings panel, calls the buildSummaryBlock function after basic field settings are added to the wrapper.

Parameters
  • $wrapper XMLElementthe input XMLElement to which the display of this will be appended.

  • $errors mixedthe input error collection. this defaults to null.

See Also
array fetchSuggestionTypes()

Returns the types of filter suggestion this field supports. The array may contain the following values:

  • entry for searching entries in the current section
  • association for searching entries in associated sections
  • static for searching static values
  • date for searching in a calendar
  • parameters for searching in parameters

    If the date type is set, only the calendar will be shown in the suggestion dropdown.

void findAndAddDynamicOptions(mixed $values)
void findDefaults(array $settings)

Allows a field to set default settings.

Parameters
  • $settings arraythe array of settings to populate with their defaults.

XMLElement getExampleFormMarkup()

The default method for constructing the example form markup containing this field when utilized as part of an event. This displays in the event documentation and serves as a basic guide for how markup should be constructed on the Frontend to save this field

Returns

a label widget containing the formatted field element name of this.

array getExportModes()

Return a list of supported export modes for use with prepareExportValue.

array getToggleStates()

Accessor to the toggle states. This default implementation returns an empty array.

Returns

the array of toggle states.

void groupRecords(array $records)

Default implementation of record grouping. This default implementation will throw an Exception. Thus, clients must overload this method for grouping to be successful.

Parameters
  • $records arraythe records to group.

boolean isSortable()

Test whether this field can be sorted. This default implementation returns false.

Returns

true if this field is sortable, false otherwise.

array prepareExportValue(mixed $data, integer $mode, integer $entry_id)

Give the field some data and ask it to return a value using one of many possible modes.

void prepareImportValue(mixed $data, mixed $mode, mixed $entry_id)
string prepareTextValue(array $data, integer $entry_id)

Format this field value for complete display as text (string). By default, it looks for the 'value' key in the $data array and strip tags from it.

Parameters
  • $data arrayan associative array of data for this string. At minimum this requires a key of 'value'.

  • $entry_id integer(optional) An option entry ID for more intelligent processing. defaults to null

Returns

the complete text representation of the values of this field instance.

array processRawFieldData(mixed $data, integer $status, string $message, bool $simulate, mixed $entry_id)

Process the raw field data.

Parameters
  • $data mixedpost data from the entry form

  • $status integerthe status code resultant from processing the data.

  • $message stringthe place to set any generated error message. any previous value for this variable will be overwritten.

  • $simulate bool(optional) true if this will tell the CF's to simulate data creation, false otherwise. this defaults to false. this is important if clients will be deleting or adding data outside of the main entry object commit function.

  • $entry_id mixed(optional) the current entry. defaults to null.

Returns

the processed field data.

boolean requiresSQLGrouping()

Test whether this field requires grouping. If this function returns true SQL statements generated in the EntryManager will include the DISTINCT keyword to only return a single row for an entry regardless of how many 'matches' it might have. This default implementation returns false.

Returns

true if this field requires grouping, false otherwise.

array toggleFieldData(array $data, string $newState, integer $entry_id)

Toggle the field data. This default implementation always returns the input data.

Parameters
  • $data arraythe data to toggle.

  • $newState stringthe new value to set

  • $entry_id integer(optional) an optional entry ID for more intelligent processing. defaults to null

Returns

the toggled data.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details