*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007 - 2009 Roland Haeder, this is free software
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
*
* @param $templateInstance An instance of a valid template engine
* @param $formName Name of the form
- * @param $formId Value for "id" attribute (default: $formName)
+ * @param $formId Value for 'id' attribute (default: $formName)
* @param $withForm Wether include the form tag
* @return $helperInstance A preparedf instance of this helper
*/
// Set form name
$helperInstance->setFormName($formName);
- // A form-less field may say "false" here...
+ // A form-less field may say 'false' here...
if ($withForm === true) {
// Create the form
$helperInstance->addFormTag($formName, $formId);
* Add the form tag or close it an already opened form tag
*
* @param $formName Name of the form (default: false)
- * @param $formId Id of the form (attribute "id"; default: false)
+ * @param $formId Id of the form (attribute 'id'; default: false)
* @return void
- * @throws InvalidFormNameException If the form name is invalid (=false)
+ * @throws InvalidFormNameException If the form name is invalid ( = false)
* @todo Add some unique PIN here to bypass problems with some browser and/or extensions
*/
public function addFormTag ($formName = false, $formId = false) {
} // END - if
// Close the form is default
- $formContent = "</form>";
+ $formContent = '</form>';
// Check wether we shall open or close the form
if (($this->formOpened === false) && ($this->formEnabled === true)) {
);
// Add close bracket
- $formContent .= ">";
+ $formContent .= '>';
// Open the form and remeber the form name
$this->formOpened = true;
$fieldValue
);
- // And add it maybe with a "li" tag
+ // And add it maybe with a 'li' tag
$this->addContentToPreviousGroup($inputContent);
}
public function addInputTextFieldWithDefault ($fieldName) {
// Get the value from instance
$fieldValue = $this->getValueField($fieldName);
- //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
+ //* DEBUG: */ echo __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
// Add the text field
$this->addInputTextField($fieldName, $fieldValue);
public function addInputHiddenFieldWithDefault ($fieldName) {
// Get the value from instance
$fieldValue = $this->getValueField($fieldName);
- //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
+ //* DEBUG: */ echo __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
// Add the text field
$this->addInputHiddenField($fieldName, $fieldValue);
public function addInputHiddenConfiguredField ($fieldName, $prefix) {
// Get the value from instance
$fieldValue = $this->getConfigInstance()->readConfig("{$prefix}_{$fieldName}");
- //* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
+ //* DEBUG: */ echo __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
// Add the text field
$this->addInputHiddenField($fieldName, $fieldValue);
// Set wether the check box is checked...
$checked = " checked=\"checked\"";
- if ($fieldChecked === false) $checked = " ";
+ if ($fieldChecked === false) $checked = ' ';
// Generate the content
$inputContent = sprintf("<input type=\"checkbox\" name=\"%s\" class=\"checkbox %s_field\" value=\"1\"%s/>",
// All call it again if group name is not empty
if ((!empty($groupId)) && ($groupId != $prevGroupId)) {
- //* DEBUG: */ echo $groupId."/".$prevGroupId."<br />\n";
+ //* DEBUG: */ echo $groupId.'/'.$prevGroupId."<br />\n";
$this->addFormGroup($groupId, $groupText);
} // END - if
}
* @return $required Wether the email address is required
*/
public function ifRegisterRequiresEmailVerification () {
- $required = ($this->getConfigInstance()->readConfig('register_requires_email') === "Y");
+ $required = ($this->getConfigInstance()->readConfig('register_requires_email') == 'Y');
return $required;
}
* @return $required Wether profile data shall be asked
*/
public function ifRegisterIncludesProfile () {
- $required = ($this->getConfigInstance()->readConfig('register_includes_profile') === "Y");
+ $required = ($this->getConfigInstance()->readConfig('register_includes_profile') == 'Y');
return $required;
}
* @return $isSecured Wether this form is secured by a CAPTCHA
*/
public function ifFormSecuredWithCaptcha () {
- $isSecured = ($this->getConfigInstance()->readConfig($this->getFormName().'_captcha_secured') === "Y");
+ $isSecured = ($this->getConfigInstance()->readConfig($this->getFormName().'_captcha_secured') == 'Y');
return $isSecured;
}