Beispiel #1
0
 /**
  * Default constructor that takes in initial parameters and setting prefix.
  * @param Array $paramList The list of parameters to create the form from.
  * @param String $settingPrefix The prefix to use for the settings.
  * @param String $formID The optional ID to give to the form. Ideal for when there's more than 1 form on a page. 
  */
 public function __construct($paramList, $settingPrefix, $formID = false)
 {
     parent::__construct($paramList, $formID);
     // Default save text reflects this is a settings form
     $this->buttonText = 'Save Settings';
     // Store the setting prefix.
     $this->settingPrefix = $settingPrefix;
     // Load default values
     parent::loadDefaults(TidySettings_getSettings($settingPrefix));
 }
Beispiel #2
0
 /**
  * Default constructor that takes in initial parameters and setting prefix.
  * @param Array $paramList The list of parameters to create the form from.
  * @param String $settingPrefix The prefix to use for the settings.
  * @param String $formID The optional ID to give to the form. Ideal for when there's more than 1 form on a page. 
  */
 public function __construct($paramList, $settingPrefix, $formID = false)
 {
     parent::__construct($paramList, $formID);
     // Default save text reflects this is a settings form
     $this->buttonText = __('Save Settings');
     // Store the setting prefix.
     $this->settingPrefix = $settingPrefix;
     // Messages
     $this->msg_settingsSaved = __('Settings successfully saved.');
     $this->msg_settingsProblem = __('There was a problem saving the settings.');
     // Load default values
     parent::loadDefaults(TidySettings_getSettings($settingPrefix));
 }
 /**
  * Default constructor that takes in initial parameters.
  * @param Array $paramList The list of parameters to create the form from.
  * @param String $tableName The name of the table to save the details to (or retrieve them from).
  * @param String $primaryKey The name of the primary key used to locate a record to update it.
  * @param Stirng $metaTableName The name of the table storing meta data. 
  * @param String $formID The optional ID to give to the form. Ideal for when there's more than 1 form on a page. 
  */
 public function __construct($paramList, $tableName, $primaryKey, $metaTableName = false, $formID = false)
 {
     parent::__construct($paramList, $formID);
     // Default save text reflects this is a data entry form.
     $this->buttonText = 'Save Details';
     $this->tableName = $tableName;
     $this->primaryKey = $primaryKey;
     $this->primaryKeyValue = false;
     $this->fn_record_updated = false;
     $this->fn_record_created = false;
     // Exists checks
     $this->alreadyInDB = false;
     // Turn primary key into a hidden field, so that we can handle modifies.
     $elem = new FormElement($primaryKey, false);
     $elem->setTypeAsHidden();
     $this->formObj->addFormElement($elem);
     // Meta data support
     $this->metaTableName = $metaTableName;
     $this->meta_element_list = false;
     // Pull out fields being stored as meta data if we have a meta table name
     if ($metaTableName) {
         $this->meta_element_list = array();
         if (!empty($paramList)) {
             foreach ($paramList as $fieldName => $fieldDetails) {
                 // We're looking for metadata => true in the list of elements
                 // which determines it should be saved as meta data, not as a
                 // value in the normal table column.
                 if (isset($fieldDetails['metadata']) && $fieldDetails['metadata'] == true) {
                     $this->meta_element_list[] = $fieldName;
                 }
             }
             // end foreach
         }
         // end if (!empty($paramList))
     }
     // end if ($metaTableName)
     // Default messages
     $this->msg_record_created = 'Record successfully created';
     $this->msg_record_updated = 'Record successfully updated.';
 }
Beispiel #4
0
 function __construct(&$xmlArr)
 {
     parent::__construct($xmlArr);
     $this->initPivotConfig();
 }