Framework  3.9
TimezoneFieldRenderer Class Reference
+ Inheritance diagram for TimezoneFieldRenderer:
+ Collaboration diagram for TimezoneFieldRenderer:

Public Member Functions

 TimezoneFieldRenderer (&$parent)
 
 renderField ($field)
 FieldRenderers must override this method to provide the HTML implementation of the control used to edit the field. More...
 
 renderSearchField ($field, $mode)
 FieldRenderers must override this method to provide the HTML implementation of the control displayed for the field in a search form. More...
 
 renderReadOnly ($field)
 
- Public Member Functions inherited from FieldRenderer
 FieldRenderer ($parent)
 Constructor. More...
 
 _printLabel ($field, $colspan=1, $styles="", $annotation="")
 Internal method to generate the HTML for the field label. More...
 
 _getLabel ($field, $addSuffix=true)
 
 _startField ($field, $styles="")
 Internal method to generate the starting HTML for the field (including the label) More...
 
 _endField ($field)
 Internal method to generate the closing HTML for the field. More...
 
 addValidatorsToForm ($field, $required=false)
 This method is called by the AutoForm to add any default input validators that are required by the FieldRenderer. More...
 
 addSearchValidatorsToForm ($field, $mode, $required=false)
 For SearchForm, the validator field needs to match the name tag in the form which is in the format field:mode. More...
 
 formatName ($item, $name)
 Formats the given DataItem based on the supplied format string. More...
 
 renderScript ($field)
 FieldRenderers can override this method to provide any Javascript that their control requires for an edit form. More...
 
 renderSearchScript ($field, $mode)
 FieldRenderers can override this method to provide any Javascript that the control requires when being used in a search form. More...
 
 renderOnSubmitHandler ($field)
 FieldRenderers can override this method to provide any Javascript that must be executed when the form is submitted on the client. More...
 
 preProcess ($field="")
 FieldRenderers can override this method to provide behavior that occurs prior to the saving of the parent form's target object to the database. More...
 
 postProcess ($field="")
 FieldRenderers can override this method to provide behavior that occurs after the parent form's target object has been saved to the database. More...
 

Additional Inherited Members

- Public Attributes inherited from FieldRenderer
 $parent = null
 
 $labelSuffix = ""
 
 $colspan = 1
 
 $annotateBefore = false
 
 $annotateNextLine = true
 
 $hideLabel = false
 
 $onPreProcess = null
 callback hook for processing prior to saving the form's data object - individual renderers may override with custom processing More...
 
 $onPostProcess = null
 callback hook for processing after saving the form's data object - individual renderers may override with custom processing More...
 

Detailed Description

Definition at line 132 of file timezone_field_renderer.inc.

Member Function Documentation

◆ renderField()

TimezoneFieldRenderer::renderField (   $field)

FieldRenderers must override this method to provide the HTML implementation of the control used to edit the field.

Parameters
string$fieldthe field name

Reimplemented from FieldRenderer.

Definition at line 139 of file timezone_field_renderer.inc.

140  {
141  $this->_startField($field);
142 
143  if ($this->abbreviated)
144  {
145  $options = $abbreviatedTimezones;
146  }
147  else
148  {
149  $options = DateTimeZone::listIdentifiers();
150  $options = array_combine($options, $options);
151  }
152 
153  echo "<select id='{$this->parent->id}_{$field}'>";
154 
155  $value = $this->parent->data->get($field);
156 
157  foreach($options as $zone=>$description)
158  {
159  option($zone, $description, $value);
160  }
161 
162  $this->_endField($field);
163  }
_startField($field, $styles="")
Internal method to generate the starting HTML for the field (including the label)
_endField($field)
Internal method to generate the closing HTML for the field.
option($value, $text, $sel="")
Write out an option tag, marking as selected if applicable.
Definition: functions.inc:888

◆ renderReadOnly()

TimezoneFieldRenderer::renderReadOnly (   $field)

Definition at line 170 of file timezone_field_renderer.inc.

171  {
172  $this->_startField($field);
173 
174  if ($this->abbreviated)
175  {
176  echo $abbreviatedTimezones[$this->parent->get($field)];
177  }
178  else
179  {
180  echo $this->parent->get($field);
181  }
182 
183  $this->_endField($field);
184  }

◆ renderSearchField()

TimezoneFieldRenderer::renderSearchField (   $field,
  $mode 
)

FieldRenderers must override this method to provide the HTML implementation of the control displayed for the field in a search form.

Parameters
string$fieldthe field name

Reimplemented from FieldRenderer.

Definition at line 165 of file timezone_field_renderer.inc.

166  {
167  $this->renderField($field);
168  }
renderField($field)
FieldRenderers must override this method to provide the HTML implementation of the control used to ed...

◆ TimezoneFieldRenderer()

TimezoneFieldRenderer::TimezoneFieldRenderer ( $parent)

Definition at line 134 of file timezone_field_renderer.inc.

135  {
136  $this->FieldRenderer($parent);
137  }
FieldRenderer($parent)
Constructor.

The documentation for this class was generated from the following file: