Permalink
Browse files

MINOR Replaced calls to deprecated FormField->Name() with getName()

  • Loading branch information...
1 parent 6e2eaed commit 96d18efa5852836a611782f73858558f85399c04 @chillu chillu committed Oct 29, 2011
View
4 admin/code/MemberTableField.php
@@ -65,9 +65,9 @@ function __construct($controller, $name, $group = null, $members = null, $hidePa
$this->group = $group;
$members = $group->Members();
- } elseif(isset($_REQUEST['ctf'][$this->Name()]["ID"]) && is_numeric($_REQUEST['ctf'][$this->Name()]["ID"])) {
+ } elseif(isset($_REQUEST['ctf'][$this->getName()]["ID"]) && is_numeric($_REQUEST['ctf'][$this->getName()]["ID"])) {
throw new Exception("Is this still being used? It's a hack and we should remove it.");
- $group = DataObject::get_by_id('Group', $_REQUEST['ctf'][$this->Name()]["ID"]);
+ $group = DataObject::get_by_id('Group', $_REQUEST['ctf'][$this->getName()]["ID"]);
$this->group = $group;
$members = $group->Members();
} else {
View
2 forms/AjaxUniqueTextField.php
@@ -43,7 +43,7 @@ function Field() {
'type' => 'text',
'class' => 'text' . ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(),
- 'name' => $this->Name(),
+ 'name' => $this->getName(),
'value' => $this->Value(),
'tabindex' => $this->getTabIndex(),
'maxlength' => ($this->maxLength) ? $this->maxLength : null
View
2 forms/ComplexTableField.php
@@ -254,7 +254,7 @@ function Items() {
return null;
}
- $pageStart = (isset($_REQUEST['ctf'][$this->Name()]['start']) && is_numeric($_REQUEST['ctf'][$this->Name()]['start'])) ? $_REQUEST['ctf'][$this->Name()]['start'] : 0;
+ $pageStart = (isset($_REQUEST['ctf'][$this->getName()]['start']) && is_numeric($_REQUEST['ctf'][$this->getName()]['start'])) ? $_REQUEST['ctf'][$this->getName()]['start'] : 0;
$output = new ArrayList();
foreach($sourceItems as $pageIndex=>$item) {
View
2 forms/CompositeField.php
@@ -115,7 +115,7 @@ function SmallFieldHolder() {//return $this->FieldHolder();
$className = ($this->columnCount) ? "field CompositeField {$this->extraClass()} multicolumn" : "field CompositeField {$this->extraClass()}";
$content = "<div class=\"$className\"$idAtt>";
- foreach($fs as $subfield) {//echo ' subf'.$subfield->Name();
+ foreach($fs as $subfield) {//echo ' subf'.$subfield->getName();
if($this->columnCount) {
$className = "column{$this->columnCount}";
if(!next($fs)) $className .= " lastcolumn";
View
4 forms/FieldGroup.php
@@ -75,8 +75,8 @@ function Name(){
$compositeTitle = '';
$count = 0;
foreach($fs as $subfield){
- $compositeTitle .= $subfield->Name();
- if($subfield->Name()) $count++;
+ $compositeTitle .= $subfield->getName();
+ if($subfield->getName()) $count++;
}
if($count == 1) $compositeTitle .= 'Group';
return ereg_replace("[^a-zA-Z0-9]+","",$compositeTitle);
View
2 forms/FileField.php
@@ -158,7 +158,7 @@ public function saveInto(DataObject $record) {
}
public function Value() {
- return $_FILES[$this->Name()];
+ return $_FILES[$this->getName()];
}
/**
View
16 forms/FileIFrameField.php
@@ -48,7 +48,7 @@ function getCanUploadNewFile() {
*/
public function dataClass() {
if($this->form && $this->form->getRecord()) {
- $class = $this->form->getRecord()->has_one($this->Name());
+ $class = $this->form->getRecord()->has_one($this->getName());
return ($class) ? $class : 'File';
} else {
return 'File';
@@ -76,7 +76,7 @@ public function Field() {
return $this->createTag (
'iframe',
array (
- 'name' => $this->Name() . '_iframe',
+ 'name' => $this->getName() . '_iframe',
'src' => Controller::join_links($this->Link(), $iframe),
'style' => 'height: 152px; width: 100%; border: none;'
)
@@ -85,7 +85,7 @@ public function Field() {
array (
'type' => 'hidden',
'id' => $this->ID(),
- 'name' => $this->Name() . 'ID',
+ 'name' => $this->getName() . 'ID',
'value' => $this->attrValue()
)
);
@@ -104,7 +104,7 @@ public function Field() {
* @return File|null
*/
public function AttachedFile() {
- return $this->form->getRecord() ? $this->form->getRecord()->{$this->Name()}() : null;
+ return $this->form->getRecord() ? $this->form->getRecord()->{$this->getName()}() : null;
}
/**
@@ -196,7 +196,7 @@ public function save($data, $form) {
return;
}
- $this->form->getRecord()->{$this->Name() . 'ID'} = $fileObject->ID;
+ $this->form->getRecord()->{$this->getName() . 'ID'} = $fileObject->ID;
$fileObject->OwnerID = (Member::currentUser() ? Member::currentUser()->ID : 0);
$fileObject->write();
@@ -212,7 +212,7 @@ public function save($data, $form) {
return;
}
- $this->form->getRecord()->{$this->Name() . 'ID'} = $fileObject->ID;
+ $this->form->getRecord()->{$this->getName() . 'ID'} = $fileObject->ID;
if(!$fileObject instanceof $desiredClass) {
$fileObject->ClassName = $desiredClass;
@@ -248,15 +248,15 @@ public function DeleteFileForm() {
public function delete($data, $form) {
// delete the actual file, or just un-attach it?
if(isset($data['DeleteFile']) && $data['DeleteFile']) {
- $file = DataObject::get_by_id('File', $this->form->getRecord()->{$this->Name() . 'ID'});
+ $file = DataObject::get_by_id('File', $this->form->getRecord()->{$this->getName() . 'ID'});
if($file) {
$file->delete();
}
}
// then un-attach file from this record
- $this->form->getRecord()->{$this->Name() . 'ID'} = 0;
+ $this->form->getRecord()->{$this->getName() . 'ID'} = 0;
$this->form->getRecord()->write();
Director::redirectBack();
View
4 forms/GridFieldPresenter.php
@@ -94,8 +94,8 @@ public function setTemplate($template){
*
* @return string
*/
- public function Name() {
- return $this->getGridField()->Name();
+ public function getName() {
+ return $this->getGridField()->getName();
}
/**
View
2 forms/HasManyComplexTableField.php
@@ -139,7 +139,7 @@ function ExtraData() {
class HasManyComplexTableField_Item extends ComplexTableField_Item {
function MarkingCheckbox() {
- $name = $this->parent->Name() . '[]';
+ $name = $this->parent->getName() . '[]';
if(!$this->parent->joinField) {
user_error("joinField not set in HasManyComplexTableField '{$this->parent->name}'", E_USER_WARNING);
View
2 forms/HasOneComplexTableField.php
@@ -85,7 +85,7 @@ function ExtraData() {
class HasOneComplexTableField_Item extends ComplexTableField_Item {
function MarkingCheckbox() {
- $name = $this->parent->Name() . '[]';
+ $name = $this->parent->getName() . '[]';
$isOneToOne = $this->parent->isOneToOne;
$joinVal = $this->parent->getControllerJoinID();
View
2 forms/ManyManyComplexTableField.php
@@ -92,7 +92,7 @@ function getParentIdName($parentClass, $childClass) {
class ManyManyComplexTableField_Item extends ComplexTableField_Item {
function MarkingCheckbox() {
- $name = $this->parent->Name() . '[]';
+ $name = $this->parent->getName() . '[]';
if($this->parent->IsReadOnly)
return "<input class=\"checkbox\" type=\"checkbox\" name=\"$name\" value=\"{$this->item->ID}\" disabled=\"disabled\"/>";
View
12 forms/TableField.php
@@ -498,7 +498,7 @@ function jsValidation() {
if($items && $this->requiredFields && $items->count()) {
foreach ($this->requiredFields as $field) {
foreach($items as $item){
- $cellName = $this->Name().'['.$item->ID.']['.$field.']';
+ $cellName = $this->getName().'['.$item->ID.']['.$field.']';
$js .= "\n";
if($fields->dataFieldByName($cellName)) {
$js .= <<<JS
@@ -550,8 +550,8 @@ function validate($validator) {
if($this->requiredFields&&$sourceItemsNew&&$sourceItemsNew->count()) {
foreach ($this->requiredFields as $field) {
foreach($sourceItemsNew as $item){
- $cellName = $this->Name().'['.$item->ID.']['.$field.']';
- $cName = $this->Name().'[new]['.$field.'][]';
+ $cellName = $this->getName().'['.$item->ID.']['.$field.']';
+ $cName = $this->getName().'[new]['.$field.'][]';
if($fieldObj = $fields->dataFieldByName($cellName)) {
if(!trim($fieldObj->Value())){
@@ -638,7 +638,7 @@ function createFields() {
$origFieldName = $field->getName();
// set unique fieldname with id
- $combinedFieldName = $this->parent->Name() . "[" . $this->ID() . "][" . $origFieldName . "]";
+ $combinedFieldName = $this->parent->getName() . "[" . $this->ID() . "][" . $origFieldName . "]";
// ensure to set field to nested array notation
// if its an unsaved row, or the "add row" which is present by default
if($this->isAddRow || $this->ID() == 'new') $combinedFieldName .= '[]';
@@ -703,7 +703,7 @@ function createFields() {
} else {
$shortFieldName = $fieldName;
}
- $combinedFieldName = $this->parent->Name() . "[new][" . $shortFieldName . "][]";
+ $combinedFieldName = $this->parent->getName() . "[new][" . $shortFieldName . "][]";
$fieldType = $this->fieldTypes[$fieldName];
if(isset($fieldType->class) && is_subclass_of($fieldType, 'FormField')) {
$field = clone $fieldType; // we can't use the same instance all over, as we change names
@@ -731,7 +731,7 @@ function ExtraData() {
$id = ($this->item->ID) ? $this->item->ID : "new";
if($this->parent->getExtraData()) {
foreach($this->parent->getExtraData() as $fieldName=>$fieldValue) {
- $name = $this->parent->Name() . "[" . $id . "][" . $fieldName . "]";
+ $name = $this->parent->getName() . "[" . $id . "][" . $fieldName . "]";
if($this->isAddRow) $name .= '[]';
$field = new HiddenField($name, null, $fieldValue);
$content .= $field->FieldHolder() . "\n";
View
102 forms/TableListField.php
@@ -302,27 +302,27 @@ function FieldHolder() {
function Headings() {
$headings = array();
foreach($this->fieldList as $fieldName => $fieldTitle) {
- $isSorted = (isset($_REQUEST['ctf'][$this->Name()]['sort']) && $fieldName == $_REQUEST['ctf'][$this->Name()]['sort']);
+ $isSorted = (isset($_REQUEST['ctf'][$this->getName()]['sort']) && $fieldName == $_REQUEST['ctf'][$this->getName()]['sort']);
// we can't allow sorting with partial summaries (groupByField)
$isSortable = ($this->form && $this->isFieldSortable($fieldName) && !$this->groupByField);
// sorting links (only if we have a form to refresh with)
if($this->form) {
$sortLink = $this->Link();
- $sortLink = HTTP::setGetVar("ctf[{$this->Name()}][sort]", $fieldName, $sortLink,'&');
+ $sortLink = HTTP::setGetVar("ctf[{$this->getName()}][sort]", $fieldName, $sortLink,'&');
// Apply sort direction to the current sort field
- if(!empty($_REQUEST['ctf'][$this->Name()]['sort']) && ($_REQUEST['ctf'][$this->Name()]['sort'] == $fieldName)) {
- $dir = isset($_REQUEST['ctf'][$this->Name()]['dir']) ? $_REQUEST['ctf'][$this->Name()]['dir'] : null;
+ if(!empty($_REQUEST['ctf'][$this->getName()]['sort']) && ($_REQUEST['ctf'][$this->getName()]['sort'] == $fieldName)) {
+ $dir = isset($_REQUEST['ctf'][$this->getName()]['dir']) ? $_REQUEST['ctf'][$this->getName()]['dir'] : null;
$dir = trim(strtolower($dir));
$newDir = ($dir == 'desc') ? null : 'desc';
- $sortLink = HTTP::setGetVar("ctf[{$this->Name()}][dir]", Convert::raw2xml($newDir), $sortLink,'&');
+ $sortLink = HTTP::setGetVar("ctf[{$this->getName()}][dir]", Convert::raw2xml($newDir), $sortLink,'&');
}
- if(isset($_REQUEST['ctf'][$this->Name()]['search']) && is_array($_REQUEST['ctf'][$this->Name()]['search'])) {
- foreach($_REQUEST['ctf'][$this->Name()]['search'] as $parameter => $value) {
+ if(isset($_REQUEST['ctf'][$this->getName()]['search']) && is_array($_REQUEST['ctf'][$this->getName()]['search'])) {
+ foreach($_REQUEST['ctf'][$this->getName()]['search'] as $parameter => $value) {
$XML_search = Convert::raw2xml($value);
- $sortLink = HTTP::setGetVar("ctf[{$this->Name()}][search][$parameter]", $XML_search, $sortLink,'&');
+ $sortLink = HTTP::setGetVar("ctf[{$this->getName()}][search][$parameter]", $XML_search, $sortLink,'&');
}
}
} else {
@@ -335,7 +335,7 @@ function Headings() {
"IsSortable" => $isSortable,
"SortLink" => $sortLink,
"SortBy" => $isSorted,
- "SortDirection" => (isset($_REQUEST['ctf'][$this->Name()]['dir'])) ? $_REQUEST['ctf'][$this->Name()]['dir'] : null
+ "SortDirection" => (isset($_REQUEST['ctf'][$this->getName()]['dir'])) ? $_REQUEST['ctf'][$this->getName()]['dir'] : null
));
}
return new ArrayList($headings);
@@ -411,8 +411,8 @@ function sourceItems() {
$items = clone $this->getDataList();
// TODO: Sorting could be implemented on regular SS_Lists.
- if(method_exists($items,'canSortBy') && isset($_REQUEST['ctf'][$this->Name()]['sort'])) {
- $sort = $_REQUEST['ctf'][$this->Name()]['sort'];
+ if(method_exists($items,'canSortBy') && isset($_REQUEST['ctf'][$this->getName()]['sort'])) {
+ $sort = $_REQUEST['ctf'][$this->getName()]['sort'];
// TODO: sort direction
if($items->canSortBy($sort)) $items = $items->sort($sort);
}
@@ -421,8 +421,8 @@ function sourceItems() {
// To disable pagination, set $this->showPagination to false.
if($this->showPagination && $this->pageSize) {
$SQL_limit = (int)$this->pageSize;
- if(isset($_REQUEST['ctf'][$this->Name()]['start']) && is_numeric($_REQUEST['ctf'][$this->Name()]['start'])) {
- $SQL_start = (isset($_REQUEST['ctf'][$this->Name()]['start'])) ? intval($_REQUEST['ctf'][$this->Name()]['start']) : "0";
+ if(isset($_REQUEST['ctf'][$this->getName()]['start']) && is_numeric($_REQUEST['ctf'][$this->getName()]['start'])) {
+ $SQL_start = (isset($_REQUEST['ctf'][$this->getName()]['start'])) ? intval($_REQUEST['ctf'][$this->getName()]['start']) : "0";
} else {
$SQL_start = 0;
}
@@ -739,7 +739,7 @@ function PageSize() {
}
function ListStart() {
- return $_REQUEST['ctf'][$this->Name()]['start'];
+ return $_REQUEST['ctf'][$this->getName()]['start'];
}
/**
@@ -761,44 +761,44 @@ function getExtraLinkParams(){
function FirstLink() {
$start = 0;
- if(!isset($_REQUEST['ctf'][$this->Name()]['start']) || !is_numeric($_REQUEST['ctf'][$this->Name()]['start']) || $_REQUEST['ctf'][$this->Name()]['start'] == 0) {
+ if(!isset($_REQUEST['ctf'][$this->getName()]['start']) || !is_numeric($_REQUEST['ctf'][$this->getName()]['start']) || $_REQUEST['ctf'][$this->getName()]['start'] == 0) {
return null;
}
$baseLink = ($this->paginationBaseLink) ? $this->paginationBaseLink : $this->Link();
- $link = Controller::join_links($baseLink, "?ctf[{$this->Name()}][start]={$start}");
+ $link = Controller::join_links($baseLink, "?ctf[{$this->getName()}][start]={$start}");
if($this->extraLinkParams) $link .= "&" . http_build_query($this->extraLinkParams);
// preserve sort options
- if(isset($_REQUEST['ctf'][$this->Name()]['sort'])) {
- $link .= "&ctf[{$this->Name()}][sort]=" . $_REQUEST['ctf'][$this->Name()]['sort'];
+ if(isset($_REQUEST['ctf'][$this->getName()]['sort'])) {
+ $link .= "&ctf[{$this->getName()}][sort]=" . $_REQUEST['ctf'][$this->getName()]['sort'];
// direction
- if(isset($_REQUEST['ctf'][$this->Name()]['dir'])) {
- $link .= "&ctf[{$this->Name()}][dir]=" . $_REQUEST['ctf'][$this->Name()]['dir'];
+ if(isset($_REQUEST['ctf'][$this->getName()]['dir'])) {
+ $link .= "&ctf[{$this->getName()}][dir]=" . $_REQUEST['ctf'][$this->getName()]['dir'];
}
}
return $link;
}
function PrevLink() {
- $currentStart = isset($_REQUEST['ctf'][$this->Name()]['start']) ? $_REQUEST['ctf'][$this->Name()]['start'] : 0;
+ $currentStart = isset($_REQUEST['ctf'][$this->getName()]['start']) ? $_REQUEST['ctf'][$this->getName()]['start'] : 0;
if($currentStart == 0) {
return null;
}
- $start = ($_REQUEST['ctf'][$this->Name()]['start'] - $this->pageSize < 0) ? 0 : $_REQUEST['ctf'][$this->Name()]['start'] - $this->pageSize;
+ $start = ($_REQUEST['ctf'][$this->getName()]['start'] - $this->pageSize < 0) ? 0 : $_REQUEST['ctf'][$this->getName()]['start'] - $this->pageSize;
$baseLink = ($this->paginationBaseLink) ? $this->paginationBaseLink : $this->Link();
- $link = Controller::join_links($baseLink, "?ctf[{$this->Name()}][start]={$start}");
+ $link = Controller::join_links($baseLink, "?ctf[{$this->getName()}][start]={$start}");
if($this->extraLinkParams) $link .= "&" . http_build_query($this->extraLinkParams);
// preserve sort options
- if(isset($_REQUEST['ctf'][$this->Name()]['sort'])) {
- $link .= "&ctf[{$this->Name()}][sort]=" . $_REQUEST['ctf'][$this->Name()]['sort'];
+ if(isset($_REQUEST['ctf'][$this->getName()]['sort'])) {
+ $link .= "&ctf[{$this->getName()}][sort]=" . $_REQUEST['ctf'][$this->getName()]['sort'];
// direction
- if(isset($_REQUEST['ctf'][$this->Name()]['dir'])) {
- $link .= "&ctf[{$this->Name()}][dir]=" . $_REQUEST['ctf'][$this->Name()]['dir'];
+ if(isset($_REQUEST['ctf'][$this->getName()]['dir'])) {
+ $link .= "&ctf[{$this->getName()}][dir]=" . $_REQUEST['ctf'][$this->getName()]['dir'];
}
}
@@ -807,21 +807,21 @@ function PrevLink() {
function NextLink() {
- $currentStart = isset($_REQUEST['ctf'][$this->Name()]['start']) ? $_REQUEST['ctf'][$this->Name()]['start'] : 0;
+ $currentStart = isset($_REQUEST['ctf'][$this->getName()]['start']) ? $_REQUEST['ctf'][$this->getName()]['start'] : 0;
$start = ($currentStart + $this->pageSize < $this->TotalCount()) ? $currentStart + $this->pageSize : $this->TotalCount() % $this->pageSize > 0;
if($currentStart >= $start-1) {
return null;
}
$baseLink = ($this->paginationBaseLink) ? $this->paginationBaseLink : $this->Link();
- $link = Controller::join_links($baseLink, "?ctf[{$this->Name()}][start]={$start}");
+ $link = Controller::join_links($baseLink, "?ctf[{$this->getName()}][start]={$start}");
if($this->extraLinkParams) $link .= "&" . http_build_query($this->extraLinkParams);
// preserve sort options
- if(isset($_REQUEST['ctf'][$this->Name()]['sort'])) {
- $link .= "&ctf[{$this->Name()}][sort]=" . $_REQUEST['ctf'][$this->Name()]['sort'];
+ if(isset($_REQUEST['ctf'][$this->getName()]['sort'])) {
+ $link .= "&ctf[{$this->getName()}][sort]=" . $_REQUEST['ctf'][$this->getName()]['sort'];
// direction
- if(isset($_REQUEST['ctf'][$this->Name()]['dir'])) {
- $link .= "&ctf[{$this->Name()}][dir]=" . $_REQUEST['ctf'][$this->Name()]['dir'];
+ if(isset($_REQUEST['ctf'][$this->getName()]['dir'])) {
+ $link .= "&ctf[{$this->getName()}][dir]=" . $_REQUEST['ctf'][$this->getName()]['dir'];
}
}
@@ -832,20 +832,20 @@ function LastLink() {
$pageSize = ($this->TotalCount() % $this->pageSize > 0) ? $this->TotalCount() % $this->pageSize : $this->pageSize;
$start = $this->TotalCount() - $pageSize;
// Check if there is only one page, or if we are on last page
- if($this->TotalCount() <= $pageSize || (isset($_REQUEST['ctf'][$this->Name()]['start']) && $_REQUEST['ctf'][$this->Name()]['start'] >= $start)) {
+ if($this->TotalCount() <= $pageSize || (isset($_REQUEST['ctf'][$this->getName()]['start']) && $_REQUEST['ctf'][$this->getName()]['start'] >= $start)) {
return null;
}
$baseLink = ($this->paginationBaseLink) ? $this->paginationBaseLink : $this->Link();
- $link = Controller::join_links($baseLink, "?ctf[{$this->Name()}][start]={$start}");
+ $link = Controller::join_links($baseLink, "?ctf[{$this->getName()}][start]={$start}");
if($this->extraLinkParams) $link .= "&" . http_build_query($this->extraLinkParams);
// preserve sort options
- if(isset($_REQUEST['ctf'][$this->Name()]['sort'])) {
- $link .= "&ctf[{$this->Name()}][sort]=" . $_REQUEST['ctf'][$this->Name()]['sort'];
+ if(isset($_REQUEST['ctf'][$this->getName()]['sort'])) {
+ $link .= "&ctf[{$this->getName()}][sort]=" . $_REQUEST['ctf'][$this->getName()]['sort'];
// direction
- if(isset($_REQUEST['ctf'][$this->Name()]['dir'])) {
- $link .= "&ctf[{$this->Name()}][dir]=" . $_REQUEST['ctf'][$this->Name()]['dir'];
+ if(isset($_REQUEST['ctf'][$this->getName()]['dir'])) {
+ $link .= "&ctf[{$this->getName()}][dir]=" . $_REQUEST['ctf'][$this->getName()]['dir'];
}
}
@@ -854,12 +854,12 @@ function LastLink() {
function FirstItem() {
if ($this->TotalCount() < 1) return 0;
- return isset($_REQUEST['ctf'][$this->Name()]['start']) ? $_REQUEST['ctf'][$this->Name()]['start'] + 1 : 1;
+ return isset($_REQUEST['ctf'][$this->getName()]['start']) ? $_REQUEST['ctf'][$this->getName()]['start'] + 1 : 1;
}
function LastItem() {
- if(isset($_REQUEST['ctf'][$this->Name()]['start'])) {
- return $_REQUEST['ctf'][$this->Name()]['start'] + min($this->pageSize, $this->TotalCount() - $_REQUEST['ctf'][$this->Name()]['start']);
+ if(isset($_REQUEST['ctf'][$this->getName()]['start'])) {
+ return $_REQUEST['ctf'][$this->getName()]['start'] + min($this->pageSize, $this->TotalCount() - $_REQUEST['ctf'][$this->getName()]['start']);
} else {
return min($this->pageSize, $this->TotalCount());
}
@@ -1053,8 +1053,8 @@ function printall() {
function PrintLink() {
$link = Controller::join_links($this->Link(), 'printall');
- if(isset($_REQUEST['ctf'][$this->Name()]['sort'])) {
- $link = HTTP::setGetVar("ctf[{$this->Name()}][sort]",Convert::raw2xml($_REQUEST['ctf'][$this->Name()]['sort']), $link);
+ if(isset($_REQUEST['ctf'][$this->getName()]['sort'])) {
+ $link = HTTP::setGetVar("ctf[{$this->getName()}][sort]",Convert::raw2xml($_REQUEST['ctf'][$this->getName()]['sort']), $link);
}
return $link;
}
@@ -1131,19 +1131,19 @@ function Title() {
// adding this to TODO probably add a method to the classes
// to return they're translated string
// added by ruibarreiros @ 27/11/2007
- return $this->sourceClass() ? singleton($this->sourceClass())->singular_name() : $this->Name();
+ return $this->sourceClass() ? singleton($this->sourceClass())->singular_name() : $this->getName();
}
function NameSingular() {
// same as Title()
// added by ruibarreiros @ 27/11/2007
- return $this->sourceClass() ? singleton($this->sourceClass())->singular_name() : $this->Name();
+ return $this->sourceClass() ? singleton($this->sourceClass())->singular_name() : $this->getName();
}
function NamePlural() {
// same as Title()
// added by ruibarreiros @ 27/11/2007
- return $this->sourceClass() ? singleton($this->sourceClass())->plural_name() : $this->Name();
+ return $this->sourceClass() ? singleton($this->sourceClass())->plural_name() : $this->getName();
}
function setTemplate($template) {
@@ -1153,9 +1153,9 @@ function setTemplate($template) {
function CurrentLink() {
$link = $this->Link();
- if(isset($_REQUEST['ctf'][$this->Name()]['start']) && is_numeric($_REQUEST['ctf'][$this->Name()]['start'])) {
- $start = ($_REQUEST['ctf'][$this->Name()]['start'] < 0) ? 0 : $_REQUEST['ctf'][$this->Name()]['start'];
- $link = Controller::join_links($link, "?ctf[{$this->Name()}][start]={$start}");
+ if(isset($_REQUEST['ctf'][$this->getName()]['start']) && is_numeric($_REQUEST['ctf'][$this->getName()]['start'])) {
+ $start = ($_REQUEST['ctf'][$this->getName()]['start'] < 0) ? 0 : $_REQUEST['ctf'][$this->getName()]['start'];
+ $link = Controller::join_links($link, "?ctf[{$this->getName()}][start]={$start}");
}
if($this->extraLinkParams) $link .= "&" . http_build_query($this->extraLinkParams);
@@ -1461,7 +1461,7 @@ function DeleteLink() {
}
function MarkingCheckbox() {
- $name = $this->parent->Name() . '[]';
+ $name = $this->parent->getName() . '[]';
if($this->parent->isReadonly())
return "<input class=\"checkbox\" type=\"checkbox\" name=\"$name\" value=\"{$this->item->ID}\" disabled=\"disabled\" />";
View
2 forms/TreeDropdownField.php
@@ -239,7 +239,7 @@ public function tree(SS_HTTPRequest $request) {
}
}
- $eval = '"<li id=\"selector-' . $this->Name() . '-{$child->' . $this->keyField . '}\" data-id=\"$child->' . $this->keyField . '\" class=\"class-$child->class"' .
+ $eval = '"<li id=\"selector-' . $this->getName() . '-{$child->' . $this->keyField . '}\" data-id=\"$child->' . $this->keyField . '\" class=\"class-$child->class"' .
' . $child->markingClasses() . "\"><a rel=\"$child->ID\">" . $child->' . $this->labelField . ' . "</a>"';
if($isSubTree) {
View
2 security/Member.php
@@ -1493,7 +1493,7 @@ function setByCheckboxSetField(CheckboxSetField $checkboxsetfield) {
} else {
USER_ERROR("Member::setByCheckboxSetField() - No source items could be found for checkboxsetfield " .
- $checkboxsetfield->Name(), E_USER_WARNING);
+ $checkboxsetfield->getName(), E_USER_WARNING);
}
}
View
6 tests/forms/NullableFieldTests.php
@@ -13,7 +13,7 @@ class NullableFieldTests extends SapphireTest {
*/
function testWithContent() {
$a = new NullableField(new TextField("Field1", "Field 1", "abc"));
- $this->assertEquals("Field1", $a->Name());
+ $this->assertEquals("Field1", $a->getName());
$this->assertEquals("Field 1", $a->Title());
$this->assertSame("abc", $a->Value());
$this->assertSame("abc", $a->dataValue());
@@ -34,7 +34,7 @@ function testWithContent() {
*/
function testWithEmpty() {
$a = new NullableField(new TextField("Field1", "Field 1", ""));
- $this->assertEquals("Field1", $a->Name());
+ $this->assertEquals("Field1", $a->getName());
$this->assertEquals("Field 1", $a->Title());
$this->assertSame("", $a->Value());
$this->assertSame("", $a->dataValue());
@@ -55,7 +55,7 @@ function testWithEmpty() {
*/
function testWithNull() {
$a = new NullableField(new TextField("Field1", "Field 1", null));
- $this->assertEquals("Field1", $a->Name());
+ $this->assertEquals("Field1", $a->getName());
$this->assertEquals("Field 1", $a->Title());
$this->assertSame(null, $a->Value());
$this->assertSame(null, $a->dataValue());

0 comments on commit 96d18ef

Please sign in to comment.