BUG Fixed incorrect static member declaration

- Changed configurable static variables to private as per recent API updates to 3.1
- Use of statics as configurable variables replaced with config api usage
This commit is contained in:
Damian Mooyman 2013-04-10 11:35:58 +12:00
parent fc83164b46
commit a0f48d636e
2 changed files with 7 additions and 7 deletions

View File

@ -9,17 +9,17 @@ class UserDefinedForm extends Page {
/** /**
* @var string * @var string
*/ */
public static $description = 'Adds a customizable form.'; private static $description = 'Adds a customizable form.';
/** /**
* @var string Required Identifier * @var string Required Identifier
*/ */
public static $required_identifier = null; private static $required_identifier = null;
/** /**
* @var array Fields on the user defined form page. * @var array Fields on the user defined form page.
*/ */
public static $db = array( private static $db = array(
"SubmitButtonText" => "Varchar", "SubmitButtonText" => "Varchar",
"OnCompleteMessage" => "HTMLText", "OnCompleteMessage" => "HTMLText",
"ShowClearButton" => "Boolean", "ShowClearButton" => "Boolean",
@ -31,7 +31,7 @@ class UserDefinedForm extends Page {
/** /**
* @var array Default values of variables when this page is created * @var array Default values of variables when this page is created
*/ */
public static $defaults = array( private static $defaults = array(
'Content' => '$UserDefinedForm', 'Content' => '$UserDefinedForm',
'DisableSaveSubmissions' => 0, 'DisableSaveSubmissions' => 0,
'OnCompleteMessage' => '<p>Thanks, we\'ve received your submission.</p>' 'OnCompleteMessage' => '<p>Thanks, we\'ve received your submission.</p>'
@ -40,7 +40,7 @@ class UserDefinedForm extends Page {
/** /**
* @var array * @var array
*/ */
public static $has_many = array( private static $has_many = array(
"Fields" => "EditableFormField", "Fields" => "EditableFormField",
"Submissions" => "SubmittedForm", "Submissions" => "SubmittedForm",
"EmailRecipients" => "UserDefinedForm_EmailRecipient" "EmailRecipients" => "UserDefinedForm_EmailRecipient"
@ -477,7 +477,7 @@ class UserDefinedForm_Controller extends Page_Controller {
if($editableField->Required) { if($editableField->Required) {
$field->addExtraClass('requiredField'); $field->addExtraClass('requiredField');
if($identifier = UserDefinedForm::$required_identifier) { if($identifier = UserDefinedForm::config()->required_identifier) {
$title = $field->Title() ." <span class='required-identifier'>". $identifier . "</span>"; $title = $field->Title() ." <span class='required-identifier'>". $identifier . "</span>";
$field->setTitle($title); $field->setTitle($title);

View File

@ -97,7 +97,7 @@ class UserDefinedFormControllerTest extends FunctionalTest {
$requiredForm = $this->objFromFixture('UserDefinedForm', 'validation-form'); $requiredForm = $this->objFromFixture('UserDefinedForm', 'validation-form');
$controller = new UserDefinedFormControllerTest_Controller($requiredForm); $controller = new UserDefinedFormControllerTest_Controller($requiredForm);
UserDefinedForm::$required_identifier = "*"; UserDefinedForm::config()->required_identifier = "*";
$fields = $controller->getFormFields(); $fields = $controller->getFormFields();