]> git.mxchange.org Git - shipsimu.git/blob - inc/classes/main/helper/web/class_WebFormHelper.php
Re-added with access protection
[shipsimu.git] / inc / classes / main / helper / web / class_WebFormHelper.php
1 <?php
2 /**
3  * A helper for constructing web forms
4  *
5  * @author              Roland Haeder <webmaster@ship-simu.org>
6  * @version             0.0.0
7  * @copyright   Copyright(c) 2007, 2008 Roland Haeder, this is free software
8  * @license             GNU GPL 3.0 or any newer version
9  * @link                http://www.ship-simu.org
10  *
11  * This program is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see <http://www.gnu.org/licenses/>.
23  */
24 class WebFormHelper extends BaseHelper {
25         /**
26          * Instance to the class which provides field values
27          */
28         private $valueInstance = null;
29
30         /**
31          * Wether the form tag is opened (keep at false or else your forms will
32          * never work!)
33          */
34         private $formOpened = false;
35
36         /**
37          * Name of the form
38          */
39         private $formName = "";
40
41         /**
42          * Wether the group is opened or not
43          */
44         private $groupOpened = false;
45
46         /**
47          * Wether the sub group is opened or not
48          */
49         private $subGroupOpened = false;
50
51         /**
52          * Name of the sub group
53          */
54         private $subGroupName = "";
55
56         // Class Constants
57         const EXCEPTION_FORM_NAME_INVALID       = 0x030;
58         const EXCEPTION_CLOSED_FORM             = 0x031;
59         const EXCEPTION_OPENED_FORM             = 0x032;
60         const EXCEPTION_UNEXPECTED_CLOSED_GROUP = 0x033;
61
62         /**
63          * Protected constructor
64          *
65          * @return      void
66          */
67         protected function __construct () {
68                 // Call parent constructor
69                 parent::__construct(__CLASS__);
70
71                 // Set part description
72                 $this->setObjectDescription("Helper class for HTML forms");
73
74                 // Create unique ID number
75                 $this->generateUniqueId();
76         }
77
78         /**
79          * Creates the helper class with the given template engine instance and form name
80          *
81          * @param       $templateInstance       An instance of a valid template engine
82          * @param       $formName                       Name of the form
83          * @param       $formId                         Value for "id" attribute (default: $formName)
84          * @return      $helperInstance         A preparedf instance of this class
85          */
86         public final static function createWebFormHelper (CompileableTemplate $templateInstance, $formName, $formId = false) {
87                 // Get new instance
88                 $helperInstance = new WebFormHelper();
89
90                 // Set template instance
91                 $helperInstance->setTemplateInstance($templateInstance);
92
93                 // Is the form id not set?
94                 if ($formId === false) {
95                         // Use form id from form name
96                         $formId = $formName;
97                 }
98
99                 // Create the form
100                 $helperInstance->addFormTag($formName, $formId);
101
102                 // Return the prepared instance
103                 return $helperInstance;
104         }
105
106         /**
107          * Pre-fetches field default values from the given registry key instance into this class
108          *
109          * @param       $registryKey
110          * @return      void
111          * @throws      NullPointerException    If an instance from registry is null
112          */
113         public function prefetchFieldValues ($registryKey) {
114                 // Get the required instance
115                 $this->valueInstance = Registry::getRegistry()->getInstance($registryKey);
116
117                 // Is the instance valid?
118                 if (is_null($this->valueInstance)) {
119                         // Throw an exception
120                         throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
121                 } // END - if
122         }
123
124         /**
125          * Add the form tag or close it an already opened form tag
126          *
127          * @param       $formName       Name of the form (default: false)
128          * @param       $formId         Id of the form (attribute "id"; default: false)
129          * @return      void
130          * @throws      InvalidFormNameException        If the form name is invalid (=false)
131          * @todo        Add some unique PIN here to bypass problems with some browser and/or extensions
132          */
133         public function addFormTag ($formName = false, $formId = false) {
134                 // When the form is not yet opened at least form name must be valid
135                 if (($this->formOpened === false) && ($formName === false)) {
136                         // Thrown an exception
137                         throw new InvalidFormNameException ($this, self::EXCEPTION_FORM_NAME_INVALID);
138                 } // END - if
139
140                 // Close the form is default
141                 $formContent = "</form>";
142
143                 // Check wether we shall open or close the form
144                 if ($this->formOpened === false) {
145                         // Add HTML code
146                         $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\"",
147                                 $formName,
148                                 $this->getConfigInstance()->readConfig('base_url'),
149                                 $this->getConfigInstance()->readConfig('form_action'),
150                                 $this->getConfigInstance()->readConfig('form_method'),
151                                 $this->getConfigInstance()->readConfig('form_target')
152                         );
153
154                         // Is the form id set?
155                         if ($formId !== false) {
156                                 // Then add it as well
157                                 $formContent .= sprintf(" id=\"%s_form\"",
158                                         $formId
159                                 );
160                         }
161
162                         // Add close bracket
163                         $formContent .= ">";
164
165                         // Open the form and remeber the form name
166                         $this->formOpened = true;
167                         $this->formName = $formName;
168                 } else {
169                         // Add the hidden field required to identify safely this form
170                         $this->addInputHiddenField('form', $this->formName);
171
172                         // Is a group open?
173                         if ($this->groupOpened === true) {
174                                 // Then automatically close it here
175                                 $this->addFormGroup("", "");
176                         } // END - if
177
178                         // Simply close it
179                         $this->formOpened = false;
180                 }
181
182                 // Add it to the content
183                 $this->addContent($formContent);
184         }
185
186         /**
187          * Add a text input tag to the form or throw an exception if it is not yet
188          * opened. The field's name will be set as id.
189          *
190          * @param       $fieldName              Input field name
191          * @param       $fieldValue             Input default value (default: empty)
192          * @return      void
193          * @throws      FormClosedException             If the form is not yet opened
194          */
195         public function addInputTextField ($fieldName, $fieldValue = "") {
196                 // Is the form opened?
197                 if ($this->formOpened === false) {
198                         // Throw an exception
199                         throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
200                 } // END - if
201
202                 // Generate the content
203                 $inputContent = sprintf("<input type=\"text\" class=\"textfield\" id=\"%s_field\" name=\"%s\" value=\"%s\" />",
204                         $fieldName,
205                         $fieldName,
206                         $fieldValue
207                 );
208
209                 // And add it maybe with a "li" tag
210                 $this->addContent($inputContent);
211         }
212
213         /**
214          * Add a text input tag to the form with pre-loaded default value
215          *
216          * @param       $fieldName      Input field name
217          * @return      void
218          */
219         public function addInputTextFieldWithDefault ($fieldName) {
220                 // Get the value from instance
221                 $fieldValue = call_user_func_array(array($this->valueInstance, "getField"), array($fieldName));
222                 //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
223
224                 // Add the text field
225                 $this->addInputTextField($fieldName, $fieldValue);
226         }
227
228         /**
229          * Add a password input tag to the form or throw an exception if it is not
230          * yet opened. The field's name will be set as id.
231          *
232          * @param       $fieldName                      Input field name
233          * @param       $fieldValue                     Input default value (default: empty)
234          * @return      void
235          * @throws      FormClosedException             If the form is not yet opened
236          */
237         public function addInputPasswordField ($fieldName, $fieldValue = "") {
238                 // Is the form opened?
239                 if ($this->formOpened === false) {
240                         // Throw an exception
241                         throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
242                 } // END - if
243
244                 // Generate the content
245                 $inputContent = sprintf("<input type=\"password\" class=\"password\" id=\"%s_field\" name=\"%s\" value=\"%s\" />",
246                         $fieldName,
247                         $fieldName,
248                         $fieldValue
249                 );
250
251                 // And add it
252                 $this->addContent($inputContent);
253         }
254
255         /**
256          * Add a hidden input tag to the form or throw an exception if it is not
257          * yet opened. The field's name will be set as id.
258          *
259          * @param       $fieldName                      Input field name
260          * @param       $fieldValue                     Input default value (default: empty)
261          * @return      void
262          * @throws      FormClosedException             If the form is not yet opened
263          */
264         public function addInputHiddenField ($fieldName, $fieldValue = "") {
265                 // Is the form opened?
266                 if ($this->formOpened === false) {
267                         // Throw an exception
268                         throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
269                 } // END - if
270
271                 // Generate the content
272                 $inputContent = sprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\" />",
273                         $fieldName,
274                         $fieldValue
275                 );
276
277                 // And add it
278                 $this->addContent($inputContent);
279         }
280
281         /**
282          * Add a hidden input tag to the form with pre-loaded default value
283          *
284          * @param       $fieldName      Input field name
285          * @return      void
286          */
287         public function addInputHiddenFieldWithDefault ($fieldName) {
288                 // Get the value from instance
289                 $fieldValue = call_user_func_array(array($this->valueInstance, "getField"), array($fieldName));
290                 //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
291
292                 // Add the text field
293                 $this->addInputHiddenField($fieldName, $fieldValue);
294         }
295
296         /**
297          * Add a checkbox input tag to the form or throw an exception if it is not
298          * yet opened. The field's name will be set as id.
299          *
300          * @param       $fieldName                      Input field name
301          * @param       $fieldChecked           Wether the field is checked (defaut: checked)
302          * @return      void
303          * @throws      FormClosedException             If the form is not yet opened
304          */
305         public function addInputCheckboxField ($fieldName, $fieldChecked = true) {
306                 // Is the form opened?
307                 if ($this->formOpened === false) {
308                         // Throw an exception
309                         throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
310                 } // END - if
311
312                 // Set wether the check box is checked...
313                 $checked = " checked=\"checked\"";
314                 if ($fieldChecked === false) $checked = " ";
315
316                 // Generate the content
317                 $inputContent = sprintf("<input type=\"checkbox\" name=\"%s\" class=\"checkbox\" id=\"%s_field\" value=\"1\"%s/>",
318                         $fieldName,
319                         $fieldName,
320                         $checked
321                 );
322
323                 // And add it
324                 $this->addContent($inputContent);
325         }
326
327         /**
328          * Add a reset input tag to the form or throw an exception if it is not
329          * yet opened. The field's name will be set as id.
330          *
331          * @param       $buttonText             Text displayed on the button
332          * @return      void
333          * @throws      FormClosedException             If the form is not yet opened
334          */
335         public function addInputResetButton ($buttonText) {
336                 // Is the form opened?
337                 if ($this->formOpened === false) {
338                         // Throw an exception
339                         throw new FormClosedException (array($this, "reset"), self::EXCEPTION_CLOSED_FORM);
340                 } // END - if
341
342                 // Generate the content
343                 $inputContent = sprintf("<input type=\"reset\" class=\"reset_button\" id=\"%s_reset\" value=\"%s\" />",
344                         $this->formName,
345                         $buttonText
346                 );
347
348                 // And add it
349                 $this->addContent($inputContent);
350         }
351
352         /**
353          * Add a reset input tag to the form or throw an exception if it is not
354          * yet opened. The field's name will be set as id.
355          *
356          * @param       $buttonText                     Text displayed on the button
357          * @return      void
358          * @throws      FormClosedException             If the form is not yet opened
359          */
360         public function addInputSubmitButton ($buttonText) {
361                 // Is the form opened?
362                 if ($this->formOpened === false) {
363                         // Throw an exception
364                         throw new FormClosedException (array($this, "submit"), self::EXCEPTION_CLOSED_FORM);
365                 } // END - if
366
367                 // Generate the content
368                 $inputContent = sprintf("<input type=\"submit\" class=\"submit_button\" id=\"%s_submit\" name=\"%s_button\" value=\"%s\" />",
369                         $this->formName,
370                         $this->formName,
371                         $buttonText
372                 );
373
374                 // And add it
375                 $this->addContent($inputContent);
376         }
377
378         /**
379          * Add a form group or close an already opened and open a new one
380          *
381          * @param       $groupName      Name of the group
382          * @param       $groupText      Text including HTML to show above this group
383          * @return      void
384          * @throws      FormClosedException             If no form has been opened before
385          * @throws      EmptyVariableException  If $groupName is not set
386          */
387         public function addFormGroup ($groupName, $groupText) {
388                 // Is a form opened?
389                 if ($this->formOpened === false) {
390                         // Throw exception here
391                         throw new FormClosedException(array($this, $groupName), self::EXCEPTION_CLOSED_FORM);
392                 } // END - if
393
394                 // At least the group name should be set
395                 if ((empty($groupName)) && ($this->groupOpened === false)) {
396                         // Throw exception here
397                         throw new EmptyVariableException(array($this, 'groupName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
398                 } // END - if
399
400                 // Initialize content with closing div by default
401                 $content = "    </div>\n</div><!-- Group - CLOSE //-->";
402
403                 // Is this group opened?
404                 if ($this->groupOpened === false) {
405                         // Begin the div/span blocks
406                         $content = sprintf("<!-- Group %s - OPEN //-->
407 <div class=\"group_box\" id=\"%s_group_box\">
408         <span class=\"group_text\" id=\"%s_group_text\">
409                 %s
410         </span>
411         <div class=\"group_field\" id=\"%s_group_field\">",
412                                 $groupName,
413                                 $groupName,
414                                 $groupName,
415                                 $groupText,
416                                 $groupName
417                         );
418
419                         // Add the content
420                         $this->addContent($content);
421
422                         // Switch the state
423                         $this->groupOpened = true;
424                 } else {
425                         // Is a sub group opened?
426                         if ($this->subGroupOpened === true) {
427                                 // Close it here
428                                 $this->addFormSubGroup("", "");
429                         } // END - if
430
431                         // Add the content
432                         $this->addContent($content);
433
434                         // Switch the state
435                         $this->groupOpened = false;
436
437                         // All call it again if the group name is not empty
438                         if (!empty($groupName)) {
439                                 $this->addFormGroup($groupName, $groupText);
440                         } // END - if
441                 }
442         }
443
444         /**
445          * Add a form sub group or close an already opened and open a new one or
446          * throws an exception if no group has been opened before or if the sub
447          * group name is empty.
448          *
449          * @param       $subGroupName   Name of the group
450          * @param       $subGroupText   Text including HTML to show above this group
451          * @return      void
452          * @throws      FormGroupClosedException        If no group has been opened before
453          * @throws      EmptyVariableException          If $subGroupName is not set
454          */
455         public function addFormSubGroup ($subGroupName, $subGroupText) {
456                 // Is a group opened?
457                 if ($this->groupOpened === false) {
458                         // Throw exception here
459                         throw new FormGroupClosedException(array($this, $subGroupName), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP);
460                 } // END - if
461
462                 // At least the sub group name should be set
463                 if ((empty($subGroupName)) && ($this->subGroupOpened === false)) {
464                         // Throw exception here
465                         throw new EmptyVariableException(array($this, 'groupName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
466                 } // END - if
467
468                 // Initialize content with closing div by default
469                 $content = "    </div>\n</div><!-- Sub group- CLOSE //-->";
470
471                 // Is this group opened?
472                 if ($this->subGroupOpened === false) {
473                         // Begin the span block
474                         $content = sprintf("<!-- Sub group %s - OPEN //-->
475 <div class=\"subgroup_box\" id=\"%s_subgroup_box\">
476         <span class=\"subgroup_text\" id=\"%s_subgroup_text\">
477                 %s
478         </span>
479         <div class=\"subgroup_field\" id=\"%s_subgroup_field\">",
480                                 $subGroupName,
481                                 $subGroupName,
482                                 $subGroupName,
483                                 $subGroupText,
484                                 $subGroupName
485                         );
486
487                         // Add the content
488                         $this->addContent($content);
489
490                         // Switch the state and remeber the name
491                         $this->subGroupOpened = true;
492                         $this->subGroupName = $subGroupName;
493                 } else {
494                         // Add the content
495                         $this->addContent($content);
496
497                         // Switch the state
498                         $this->subGroupOpened = false;
499
500                         // All call it again if sub group name is not empty
501                         if (!empty($subGroupName)) {
502                                 $this->addFormSubGroup($subGroupName, $subGroupText);
503                         } // END - if
504                 }
505         }
506
507         /**
508          * Add text surrounded by a span block when there is a group opened before
509          * or else by a div block.
510          *
511          * @param       $fieldName                      Field name
512          * @param       $fieldText                      Text for the field
513          * @return      void
514          * @throws      FormClosedException             If the form is not yet opened
515          */
516         public function addFieldText ($fieldName, $fieldText) {
517                 // Is the form opened?
518                 if ($this->formOpened === false) {
519                         // Throw an exception
520                         throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
521                 } // END - if
522
523                 // Set the block type
524                 $block = "div";
525                 if ($this->groupOpened === true) $block = "span";
526
527                 // Generate the content
528                 $inputContent = sprintf("       <%s id=\"%s_text\">
529                 %s
530         </%s>",
531                         $block,
532                         $fieldName,
533                         $fieldText,
534                         $block
535                 );
536
537                 // And add it
538                 $this->addContent($inputContent);
539         }
540
541         /**
542          * Add text (notes) surrounded by a div block. Still opened groups or sub
543          * groups will be automatically closed.
544          *
545          * @param       $formNotes      The form notes we shell addd
546          * @return      void
547          * @throws      FormClosedException             If the form is not yet opened
548          */
549         public function addFormNote ($formNotes) {
550                 // Is the form opened?
551                 if ($this->formOpened === false) {
552                         // Throw an exception
553                         throw new FormClosedException (array($this, "form_notes"), self::EXCEPTION_CLOSED_FORM);
554                 } // END - if
555
556                 // Is a group open?
557                 if ($this->groupOpened === true) {
558                         // Then automatically close it here
559                         $this->addFormGroup("", "");
560                 } // END - if
561
562                 // Generate the content
563                 $inputContent = sprintf("       <div id=\"form_note\">
564                 %s
565         </div>",
566                         $formNotes
567                 );
568
569                 // And add it
570                 $this->addContent($inputContent);
571         }
572
573         /**
574          * Checks wether the registration requires a valid email address
575          *
576          * @return      $required       Wether the email address is required
577          */
578         public function ifRegisterRequiresEmailVerification () {
579                 $required = ($this->getConfigInstance()->readConfig('register_requires_email') == "Y");
580                 return $required;
581         }
582
583         /**
584          * Checks wether profile data shall be asked
585          *
586          * @return      $required       Wether profile shall be asked
587          */
588         public function ifRegisterIncludesProfile () {
589                 $required = ($this->getConfigInstance()->readConfig('register_includes_profile') == "Y");
590                 return $required;
591         }
592
593         /**
594          * Checks wether personal data shall be asked
595          *
596          * @return      $required       Wether personal data shall be asked
597          */
598         public function ifRegisterIncludesPersonaData () {
599                 $required = ($this->getConfigInstance()->readConfig('register_personal_data') == "Y");
600                 return $required;
601         }
602
603         /**
604          * Checks wether email addresses can only be once used
605          *
606          * @return      $isUnique
607          */
608         public function ifEmailMustBeUnique () {
609                 $isUnique = ($this->getConfigInstance()->readConfig('register_email_unique') == "Y");
610                 return $isUnique;
611         }
612
613         /**
614          * Checks wether the specified chat protocol is enabled in this form
615          *
616          * @return      $required       Wether the specified chat protocol is enabled
617          */
618         public function ifChatEnabled ($chatProtocol) {
619                 $required = ($this->getConfigInstance()->readConfig(sprintf("chat_enabled_%s", $chatProtocol)) == "Y");
620                 return $required;
621         }
622
623         /**
624          * Checks wether login is enabled or disabled
625          *
626          * @return      $isEnabled      Wether the login is enabled or disabled
627          */
628         public function ifLoginIsEnabled () {
629                 $isEnabled = ($this->getConfigInstance()->readConfig('login_enabled') == "Y");
630                 return $isEnabled;
631         }
632
633         /**
634          * Checks wether login shall be done by username
635          *
636          * @return      $isEnabled      Wether the login shall be done by username
637          */
638         public function ifLoginWithUsername () {
639                 $isEnabled = ($this->getConfigInstance()->readConfig('login_type') == "username");
640                 return $isEnabled;
641         }
642
643         /**
644          * Checks wether login shall be done by email
645          *
646          * @return      $isEnabled      Wether the login shall be done by email
647          */
648         public function ifLoginWithEmail () {
649                 $isEnabled = ($this->getConfigInstance()->readConfig('login_type') == "email");
650                 return $isEnabled;
651         }
652
653         /**
654          * Checks wether guest login is allowed
655          *
656          * @return      $isAllowed      Wether guest login is allowed
657          */
658         public function ifGuestLoginAllowed () {
659                 $isAllowed = ($this->getConfigInstance()->readConfig('guest_login_allowed') == "Y");
660                 return $isAllowed;
661         }
662
663         /**
664          * Checks wether the email address change must be confirmed
665          *
666          * @return      $requireConfirm         Wether email change must be confirmed
667          */
668         public function ifEmailChangeRequireConfirmation () {
669                 $requireConfirm = ($this->getConfigInstance()->readConfig('email_change_confirmation') == "Y");
670                 return $requireConfirm;
671         }
672
673         /**
674          * Checks wether the rules has been updated
675          *
676          * @return      $rulesUpdated   Wether rules has been updated
677          * @todo        Implement check if rules have been changed
678          */
679         public function ifRulesHaveChanged () {
680                 return false;
681         }
682
683         /**
684          * Checks wether email change is allowed
685          *
686          * @return      $emailChange    Wether changing email address is allowed
687          */
688         public function ifEmailChangeAllowed () {
689                 $emailChange = ($this->getConfigInstance()->readConfig('email_change_allowed') == "Y");
690                 return $emailChange;
691         }
692
693         /**
694          * Checks wether the user account is unconfirmed
695          *
696          * @return      $isUnconfirmed  Wether the user account is unconfirmed
697          */
698         public function ifUserAccountUnconfirmed () {
699                 $isUnconfirmed = ($this->getField('user_status') === $this->getConfigInstance()->readConfig('user_status_unconfirmed'));
700                 return $isUnconfirmed;
701         }
702
703         /**
704          * Checks wether the user account is locked
705          *
706          * @return      $isUnconfirmed  Wether the user account is locked
707          */
708         public function ifUserAccountLocked () {
709                 $isUnconfirmed = ($this->getField('user_status') === $this->getConfigInstance()->readConfig('user_status_locked'));
710                 return $isUnconfirmed;
711         }
712
713         /**
714          * Checks wether the user account is a guest
715          *
716          * @return      $isUnconfirmed  Wether the user account is a guest
717          */
718         public function ifUserAccountGuest () {
719                 $isUnconfirmed = ($this->getField('user_status') === $this->getConfigInstance()->readConfig('user_status_guest'));
720                 return $isUnconfirmed;
721         }
722
723         /**
724          * Flushs the content out (not yet secured against open forms, etc.!) or
725          * close the form automatically
726          *
727          * @return      void
728          * @throws      FormOpenedException             If the form is still open
729          */
730         public function flushContent () {
731                 // Is the form still open?
732                 if ($this->formOpened === true) {
733                         // Close the form automatically
734                         $this->addFormTag();
735                 } // END - if
736
737                 // Send content to template engine
738                 $this->getTemplateInstance()->assignVariable($this->formName, $this->getContent());
739         }
740
741         /**
742          * Getter for direct field values
743          *
744          * @param       $fieldName              Name of the field we shall fetch
745          * @return      $fieldValue             Value from field
746          */
747         public function getField ($fieldName) {
748                 // Get the field value
749                 $fieldValue = call_user_func_array(array($this->valueInstance, "getField"), array($fieldName));
750
751                 // Return it
752                 return $fieldValue;
753         }
754 }
755
756 // [EOF]
757 ?>