API CHANGE: removed deprecated extend calls (r93632). API CHANGE: removed fieldExists(). Use hasField() (r93633). API CHANGE removed listOfFields() (r93647). API CHANGE: removed Tag() and URL() from Image. Use getTag() and getURL(). BUGFIX: updated Image.php to use getTag() (r93639, r93646). API CHANGE: removed val(). Use XML_val() (r93650). API CHANGE: removed $add_action. Use singlar_name or lang tables (r93658). API CHANGE: removed ConfirmedFormAction (r93674). API CHANGE: removed ajax_render on CTF (r93679).

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@93685 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2009-11-26 23:09:05 +00:00 committed by Sam Minnee
parent d93ee14be1
commit eb64eec534
10 changed files with 8 additions and 203 deletions

View File

@ -752,17 +752,6 @@ class ViewableData extends Object implements IteratorAggregate {
public function Top() {
return SSViewer::topLevel();
}
// DEPRECATED ------------------------------------------------------------------------------------------------------
/**
* @deprecated 2.3 use {@link ViewableData::XML_val()}
* @todo this cannot throw an error yet, as alot of core classes still use it
*/
public function val($field, $arguments = null) {
return $this->XML_val($field, $arguments);
}
}
/**

View File

@ -530,10 +530,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
* Get the translated user friendly singular name of this DataObject
* same as singular_name() but runs it through the translating function
*
* NOTE:
* It uses as default text if no translation found the $add_action when
* defined or else the default text is singular_name()
*
* Translating string is in the form:
* $this->class.SINGULARNAME
* Example:
@ -823,10 +819,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
*/
protected function onBeforeWrite() {
$this->brokenOnWrite = false;
// DEPRECATED 2.3: use onBeforeWrite()
$dummy = null;
$this->extend('augmentBeforeWrite', $dummy);
$dummy = null;
$this->extend('onBeforeWrite', $dummy);
@ -841,10 +833,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
* @uses DataObjectDecorator->onAfterWrite()
*/
protected function onAfterWrite() {
// DEPRECATED 2.3: use onAfterWrite()
$dummy = null;
$this->extend('augmentAfterWrite', $dummy);
$dummy = null;
$this->extend('onAfterWrite', $dummy);
}
@ -902,9 +890,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
}
}
// DEPRECATED 2.3: use populateDefaults()
$this->extend('augmentPopulateDefaults');
$this->extend('populateDefaults');
}
@ -2332,16 +2317,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
return $val;
}
/**
* @deprecated 2.3 (For external use) Please use hasField(), hasDatabaseField(), hasOwnTableDatabaseField() instead
*
* @param string $field Name of the field
* @return string The field type of the given field
*/
public function fieldExists($field) {
return $this->hasOwnTableDatabaseField($field);
}
/**
* Return the DBField object that represents the given field.
* This works similarly to obj() with 2 key differences:
@ -2575,24 +2550,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
return $query;
}
/**
* Get a bunch of fields in an HTML LI, like this:
* - name: value
* - name: value
* - name: value
*
* @deprecated 2.3 Use custom code
* @return string The fields as an HTML unordered list
*/
function listOfFields() {
$fields = func_get_args();
$result = "<ul>\n";
foreach($fields as $field)
$result .= "<li><b>$field:</b> " . $this->$field . "</li>\n";
$result .= "</ul>";
return $result;
}
/**
* Return all objects matching the filter
* sub-classes are automatically selected and included
@ -2915,9 +2872,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
DB::alteration_message("Added default records to $className table","created");
}
}
// DEPRECATED 2.3: Use requireDefaultRecords()
$this->extend('augmentDefaultRecords', $dummy);
// Let any extentions make their own database default data
$this->extend('requireDefaultRecords', $dummy);

View File

@ -99,7 +99,7 @@ class Image extends File {
*/
function getTag() {
if(file_exists(Director::baseFolder()."/".$this->Filename)) {
$url = $this->URL();
$url = $this->getURL();
$title = ($this->Title) ? $this->Title : $this->Filename;
if ($this->Title) {
@ -120,7 +120,7 @@ class Image extends File {
* @return string
*/
function forTemplate() {
return $this->Tag();
return $this->getTag();
}
/**
@ -441,26 +441,6 @@ class Image extends File {
return self::ORIENTATION_SQUARE;
}
}
// ###################
// DEPRECATED
// ###################
/**
* @deprecated Use getTag() instead
*/
function Tag() {
return $this->getTag();
}
/**
* @deprecated Use getURL() instead
*/
function URL() {
return $this->getURL();
}
}
/**

View File

@ -7,8 +7,6 @@
*/
class RedirectorPage extends Page {
static $add_action = "Redirector to another page";
static $icon = array("cms/images/treeicons/page-shortcut","file");
static $db = array(

View File

@ -135,15 +135,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
static $default_sort = "Sort";
/**
* The text shown in the create page dropdown. If
* this is not set, default to "Create a ClassName".
*
* @deprecated 2.3 Use "<myclassname>.TITLE" in the i18n language tables instead
* @var string
*/
static $add_action = null;
/**
* If this is false, the class cannot be created in the CMS.
* @var boolean
@ -667,10 +658,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
return $this->$method($member);
}
// DEPRECATED 2.3: Use can()
$results = $this->extend('alternateCan', $member);
if($results && is_array($results)) if(!min($results)) return false;
$results = $this->extend('can', $member);
if($results && is_array($results)) if(!min($results)) return false;
@ -701,10 +688,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if($member && Permission::checkMember($member, "ADMIN")) return true;
// DEPRECATED 2.3: use canAddChildren() instead
$results = $this->extend('alternateCanAddChildren', $member);
if($results && is_array($results)) if(!min($results)) return false;
$results = $this->extend('canAddChildren', $member);
if($results && is_array($results)) if(!min($results)) return false;
@ -736,10 +719,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// admin override
if($member && Permission::checkMember($member, array("ADMIN", "SITETREE_VIEW_ALL"))) return true;
// DEPRECATED 2.3: use canView() instead
$results = $this->extend('alternateCanView', $member);
if($results && is_array($results)) if(!min($results)) return false;
// decorated access checks
$results = $this->extend('canView', $member);
if($results && is_array($results)) if(!min($results)) return false;
@ -795,10 +774,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
return true;
}
// DEPRECATED 2.3: use canDelete() instead
$results = $this->extend('alternateCanDelete', $memberID);
if($results && is_array($results)) if(!min($results)) return false;
// decorated access checks
$results = $this->extend('canDelete', $memberID);
if($results && is_array($results)) if(!min($results)) return false;
@ -839,10 +814,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if($member && Permission::checkMember($member, "ADMIN")) return true;
// DEPRECATED 2.3: use canCreate() instead
$results = $this->extend('alternateCanCreate', $member);
if($results && is_array($results)) if(!min($results)) return false;
// decorated permission checks
$results = $this->extend('canCreate', $member);
if($results && is_array($results)) if(!min($results)) return false;
@ -875,10 +846,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
else $memberID = Member::currentUserID();
if($memberID && Permission::checkMember($memberID, array("ADMIN", "SITETREE_EDIT_ALL"))) return true;
// DEPRECATED 2.3: use canEdit() instead
$results = $this->extend('alternateCanEdit', $memberID);
if($results && is_array($results)) if(!min($results)) return false;
// decorated access checks
$results = $this->extend('canEdit', $memberID);
@ -914,10 +881,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if($member && Permission::checkMember($member, "ADMIN")) return true;
// DEPRECATED 2.3: use canPublish() instead
$results = $this->extend('alternateCanPublish', $member);
if($results && is_array($results)) if(!min($results)) return false;
// If we have a result, then that means at least one decorator specified alternateCanPublish
// Allow the permission check only if *all* voting decorators allow it.
$results = $this->extend('canPublish', $member);
@ -1187,9 +1150,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$currentLang = ($this->hasExtension('Translatable')) ? Translatable::get_current_locale() : i18n::get_locale();
$tags .= "<meta http-equiv=\"Content-Language\" content=\"". i18n::convert_rfc1766($currentLang) ."\"/>\n";
// DEPRECATED 2.3: Use MetaTags
$this->extend('updateMetaTags', $tags);
$this->extend('MetaTags', $tags);
return $tags;
@ -2352,10 +2312,13 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
);
}
/**
* Return the translated Singular name
*
* @return String
*/
function i18n_singular_name() {
$addAction = $this->stat('add_action');
$name = (!empty($addAction)) ? $addAction : $this->singular_name();
return _t($this->class.'.SINGULARNAME', $name);
return _t($this->class.'.SINGULARNAME', $this->singular_name());
}
/**

View File

@ -6,8 +6,6 @@
* @package cms
*/
class VirtualPage extends Page {
static $add_action = "Virtual page (another page's content)";
static $icon = array("cms/images/treeicons/page-shortcut-gold","file");

View File

@ -318,18 +318,6 @@ JS;
function Title() {
return $this->addTitle ? $this->addTitle : parent::Title();
}
/**
* Returns the content of this formfield without surrounding layout. Triggered by Javascript
* to update content after a DetailForm-save-action.
*
* @deprecated Use the field link itself, instead - Form/fields/TableFieldName
* @return String
*/
function ajax_render() {
user_error("Deprecated; access the field's root link instead", E_USER_NOTICE);
return $this->renderWith($this->template);
}
/**
* Calculates the number of columns needed for colspans

View File

@ -1,49 +0,0 @@
<?php
/**
* Action button with confirmation text.
* These button are useful for things like delete buttons.
*
* @deprecated 2.3 Instead of using ConfirmedFormAction, just
* apply a simple javascript event handler to your standard
* FormAction form fields.
*
* @package forms
* @subpackage actions
*/
class ConfirmedFormAction extends FormAction {
protected $confirmation;
/**
* Create a new action button.
* @param action The method to call when the button is clicked
* @param title The label on the button
* @param confirmation The message to display in the confirmation box
* @param form The parent form, auto-set when the field is placed inside a form
*/
function __construct($action, $title = "", $confirmation = null, $form = null) {
if($confirmation) {
$this->confirmation = $confirmation;
} else {
$this->confirmation = _t('ConfirmedFormAction.CONFIRMATION', "Are you sure?", PR_MEDIUM, 'Confirmation popup before executing the form action');
}
parent::__construct($action, $title, $form);
}
function Field() {
$attributes = array(
'type' => 'submit',
'class' => ($this->extraClass() ? $this->extraClass() : ''),
'id' => $this->id(),
'name' => $this->Name(),
'value' => $this->attrTitle(),
'tabindex' => $this->getTabIndex(),
'onclick' => "return confirm('$this->confirmation');"
);
return $this->createTag('input', $attributes);
}
}
?>

View File

@ -336,10 +336,6 @@ class Group extends DataObject {
public function canEdit($member = null) {
if(!$member || !(is_a($member, 'Member')) || is_numeric($member)) $member = Member::currentUser();
// DEPRECATED 2.3: use canView() instead
$results = $this->extend('alternateCanView', $member);
if($results && is_array($results)) if(!min($results)) return false;
// decorated access checks
$results = $this->extend('canEdit', $member);
if($results && is_array($results)) if(!min($results)) return false;
@ -370,10 +366,6 @@ class Group extends DataObject {
public function canView($member = null) {
if(!$member || !(is_a($member, 'Member')) || is_numeric($member)) $member = Member::currentUser();
// DEPRECATED 2.3: use canView() instead
$results = $this->extend('alternateCanView', $member);
if($results && is_array($results)) if(!min($results)) return false;
// decorated access checks
$results = $this->extend('canView', $member);
if($results && is_array($results)) if(!min($results)) return false;

View File

@ -1415,14 +1415,6 @@ class Member_SignupEmail extends Email {
</ul>
';
}
function MemberData() {
return $this->template_data->listOfFields(
"FirstName", "Surname", "Email",
"Phone", "Mobile", "Street",
"Suburb", "City", "Postcode"
);
}
}