diff --git a/admin/code/LeftAndMainDecorator.php b/admin/code/LeftAndMainDecorator.php deleted file mode 100644 index 59169bb9d..000000000 --- a/admin/code/LeftAndMainDecorator.php +++ /dev/null @@ -1,14 +0,0 @@ -param() - */ - public static function urlParam($name) { - Deprecation::notice('3.0', 'Use SS_HTTPRequest->param() instead.'); - if(isset(Director::$urlParams[$name])) return Director::$urlParams[$name]; - } - - /** - * Returns an array of urlParams. - * - * @deprecated 3.0 Use SS_HTTPRequest->params() - */ - public static function urlParams() { - Deprecation::notice('3.0', 'Use SS_HTTPRequest->params() instead.'); - return Director::$urlParams; - } /** * Set url parameters (should only be called internally by RequestHandler->handleRequest()). @@ -420,55 +400,6 @@ class Director implements TemplateGlobalProvider { ? 'https://' : 'http://'; } - /** - * Redirect to another page. - * @deprecated 2.5 Use Controller->redirect() - * - $url can be an absolute URL - * - or it can be a URL relative to the "site base" - * - if it is just a word without an slashes, then it redirects to another action on the current controller. - */ - public static function redirect($url, $code=302) { - Deprecation::notice('2.5', 'Use Controller->redirect() instead.'); - Controller::curr()->redirect($url, $code); - } - - /** - * Tests whether a redirection has been requested. - * @deprecated 2.5 Use Controller->redirectedTo() instead - * @return string If redirect() has been called, it will return the URL redirected to. Otherwise, it will - * return null; - */ - public static function redirected_to() { - Deprecation::notice('2.5', 'Use Controller->redirectedTo() instead.'); - return Controller::curr()->redirectedTo(); - } - - /** - * Sets the HTTP status code - * @deprecated 2.5 Use Controller->getResponse()->setStatusCode() instead - */ - public static function set_status_code($code) { - Deprecation::notice('2.5', 'Use Controller->getResponse()->setStatusCode() instead'); - return Controller::curr()->getResponse()->setStatusCode($code); - } - - /** - * Returns the current HTTP status code - * @deprecated 2.5 Use Controller->getResponse()->getStatusCode() instead - */ - public static function get_status_code() { - Deprecation::notice('2.5', 'Use Controller->getResponse()->getStatusCode() instead'); - return Controller::curr()->getResponse()->getStatusCode(); - } - - /** - * @deprecated 2.5 Use Controller->redirectBack() - */ - public static function redirectBack() { - Deprecation::notice('2.5', 'Use Controller->redirectBack() instead.'); - Controller::curr()->redirectBack(); - } - /** * Returns the root URL for the site. * It will be automatically calculated unless it is overridden with {@link setBaseURL()}. @@ -878,38 +809,6 @@ class Director implements TemplateGlobalProvider { } } - /** - * Specify HTTP_HOST values that are development environments. - * For information about environment types, see {@link Director::set_environment_type()}. - * - * CAUTION: Domain information can easily be spoofed in HTTP requests, - * we recommend to set this mode via {@link Director::set_environment_type()} - * or an _ss_environment.php instead. - * - * @deprecated 3.0 Use Director::set_environment_type() or an _ss_environment.php instead. - * @param $servers array An array of HTTP_HOST values that should be treated as development environments. - */ - public static function set_dev_servers($servers) { - Deprecation::notice('3.0', 'Use Director::set_environment_type() or an _ss_environment.php instead.'); - Director::$dev_servers = $servers; - } - - /** - * Specify HTTP_HOST values that are test environments. - * For information about environment types, see {@link Director::set_environment_type()}. - * - * CAUTION: Domain information can easily be spoofed in HTTP requests, - * we recommend to set this mode via {@link Director::set_environment_type()} - * or an _ss_environment.php instead. - * - * @deprecated 3.0 Use Director::set_environment_type() or an _ss_environment.php instead. - * @param $servers array An array of HTTP_HOST values that should be treated as test environments. - */ - public static function set_test_servers($servers) { - Deprecation::notice('3.0', 'Use Director::set_environment_type() or an _ss_environment.php instead.'); - Director::$test_servers = $servers; - } - /* * This function will return true if the site is in a live environment. * For information about environment types, see {@link Director::set_environment_type()}. diff --git a/control/RequestHandler.php b/control/RequestHandler.php index 92fd7df9a..e36612f7c 100644 --- a/control/RequestHandler.php +++ b/control/RequestHandler.php @@ -364,14 +364,6 @@ class RequestHandler extends ViewableData { throw new SS_HTTPResponse_Exception($errorMessage, $errorCode); } - /** - * @deprecated 3.0 Use SS_HTTPRequest->isAjax() instead (through Controller->getRequest()) - */ - public function isAjax() { - Deprecation::notice('3.0', 'Use SS_HTTPRequest->isAjax() instead (through Controller->getRequest())'); - return $this->request->isAjax(); - } - /** * Returns the SS_HTTPRequest object that this controller is using. * Returns a placeholder {@link NullHTTPRequest} object unless diff --git a/core/ClassInfo.php b/core/ClassInfo.php index da580d171..5a25a4a5d 100644 --- a/core/ClassInfo.php +++ b/core/ClassInfo.php @@ -183,14 +183,6 @@ class ClassInfo { return in_array($className, SS_ClassLoader::instance()->getManifest()->getImplementorsOf($interfaceName)); } - /** - * @deprecated 3.0 Please use is_subclass_of. - */ - public static function is_subclass_of($class, $parent) { - Deprecation::notice('3.0', 'Use is_subclass_of() instead.'); - return is_subclass_of($class, $parent); - } - /** * Get all classes contained in a file. * @uses ManifestBuilder diff --git a/core/Core.php b/core/Core.php index ec24ea678..6c7ad0ae6 100644 --- a/core/Core.php +++ b/core/Core.php @@ -304,19 +304,6 @@ Debug::loadErrorHandlers(); /////////////////////////////////////////////////////////////////////////////// // HELPER FUNCTIONS -function getSysTempDir() { - Deprecation::notice(3.0, 'Please use PHP function get_sys_temp_dir() instead.'); - return sys_get_temp_dir(); -} - -/** - * @deprecated 3.0 Please use {@link SS_ClassManifest::getItemPath()}. - */ -function getClassFile($className) { - Deprecation::notice('3.0', 'Use SS_ClassManifest::getItemPath() instead.'); - return SS_ClassLoader::instance()->getManifest()->getItemPath($className); -} - /** * Creates a class instance by the "singleton" design pattern. * It will always return the same instance for this class, diff --git a/core/PaginatedList.php b/core/PaginatedList.php index 6aaa8c7c6..20930540a 100644 --- a/core/PaginatedList.php +++ b/core/PaginatedList.php @@ -417,29 +417,4 @@ class PaginatedList extends SS_ListDecorator { } } - // DEPRECATED -------------------------------------------------------------- - - /** - * @deprecated 3.0 Use individual getter methods. - */ - public function getPageLimits() { - Deprecation::notice('3.0', 'Use getPageStart, getPageLength, or getTotalItems instead.'); - return array( - 'pageStart' => $this->getPageStart(), - 'pageLength' => $this->pageLength, - 'totalSize' => $this->getTotalItems(), - ); - } - - /** - * @deprecated 3.0 Use individual setter methods. - */ - public function setPageLimits($pageStart, $pageLength, $totalSize) { - Deprecation::notice('3.0', 'Use setPageStart, setPageLength, or setTotalItems instead.'); - $this->setPageStart($pageStart); - $this->setPageLength($pageLength); - $this->setTotalSize($totalSize); - return $this; - } - } diff --git a/css/FileIFrameField.css b/css/FileIFrameField.css deleted file mode 100644 index 446270428..000000000 --- a/css/FileIFrameField.css +++ /dev/null @@ -1,58 +0,0 @@ -/* -typography.css has been removed from framework, why shall we still has this? a dynamic typographp.css should be used by -server side call, like Requirements::css(); -@import url("typography.css"); -*/ -html, body { padding: 0; margin: 0; border-style: none; height: 100%; overflow: hidden; } - -form { margin: 0; padding: 0; } - -h2 { margin: 0; font-size: 1.4em; } - -/** Selection Groups */ -.SelectionGroup { padding: 0; margin: 10px 0 0 0; } - -.SelectionGroup li { list-style-type: none; margin: 0 0 4px; } - -.SelectionGroup li label { font-size: 11px; } - -.SelectionGroup li input.selector { width: 20px; margin-top: 0; } - -.SelectionGroup li div.field { display: none; } - -.SelectionGroup li.selected div.field { display: block; margin-left: 30px; margin-bottom: 1em; margin-top: 4px; } - -.mainblock .SelectionGroup li.selected div.field { margin-left: 27px; margin-bottom: 4px; } - -.SelectionGroup li.selected label.selector { font-weight: bold; } - -/** TreeDropdownField stying */ -.SelectionGroup div.TreeDropdownField { width: 241px; padding: 0; } - -html > body div.TreeDropdownField { position: relative; } - -.SelectionGroup div.TreeDropdownField span.items { display: block; height: 100%; border: 1px #7f9db9 solid; cursor: pointer; width: 214px; float: left; padding-top: 2px; padding-bottom: 2px; background-color: white; } - -.SelectionGroup div.TreeDropdownField div.tree_holder { clear: left; cursor: default; border: 1px black solid; margin: 0; height: 180px; overflow: auto; background-color: white; /** HACK IE6, see http://www.hedgerwow.com/360/bugs/css-select-free.html */ position: absolute; z-index: 10; width: 238px; /*must have for any value*/ } - -html > body div.TreeDropdownField div.tree_holder { top: 20px; left: 0px; z-index: 1000; } - -/** HACK IE6, see http://www.hedgerwow.com/360/bugs/css-select-free.html */ -.SelectionGroup div.TreeDropdownField div.tree_holder iframe { display: none; /* IE5*/ display/**/: block; /* IE5*/ position: absolute; top: 0; left: 0; z-index: -1; filter: mask(); width: 180px; /*must have for any big value*/ height: 200px; border: 0; } - -div.TreeDropdownField a.editLink { border-width: 1px 1px 1px 0; background: url(../images/TreeDropdownField_button.gif) left top no-repeat; width: 19px; height: 21px; margin: 0; padding: 0; float: left; clear: right; z-index: 0; overflow: hidden; } - -/* added block/width so tree values don't disappear in ie7 */ -.SelectionGroup div.TreeDropdownField ul.tree li { display: block; width: 100%; } - -.Actions { text-align: right; margin: 0; position: absolute; right: 5px; bottom: 5px; } - -.mainblock { float: left; border: 1px solid #ccc; padding: 5px; margin-right: 5px; height: 140px; position: relative; } - -.mainblock.editform { width: 275px; } - -.mainblock.attached { position: absolute; left: 270px; width: 100px; } - -.mainblock form fieldset { border: none; } - -.mainblock form div.Actions input { font-size: 11px; } diff --git a/dev/Debug.php b/dev/Debug.php index c23719e00..b1957966d 100644 --- a/dev/Debug.php +++ b/dev/Debug.php @@ -82,7 +82,17 @@ class Debug { } } - + + public static function caller() { + $bt = debug_backtrace(); + $caller = $bt[2]; + $caller['line'] = $bt[1]['line']; + $caller['file'] = $bt[1]['file']; + if(!isset($caller['class'])) $caller['class'] = ''; + if(!isset($caller['type'])) $caller['type'] = ''; + return $caller; + } + /** * Close out the show dumper * @@ -447,168 +457,6 @@ class Debug { } echo ''; } - - /** - * Dispatch an email notification message when an error is triggered. - * @deprecated 2.5 - * To create error logs by email, use this code instead: - * - * $emailWriter = new SS_LogEmailWriter('my@email.com'); - * SS_Log::add_writer($emailWriter, SS_Log::ERR); - * - * - * @param string $emailAddress - * @param string $errno - * @param string $errstr - * @param string $errfile - * @param int $errline - * @param string $errcontext - * @param string $errorType "warning" or "error" - * @return boolean - */ - public static function emailError($emailAddress, $errno, $errstr, $errfile, $errline, $errcontext, - $errorType = "Error") { - - Deprecation::notice('2.5', - 'Use SS_Log instead. See the class documentation in SS_Log.php for more information.'); - $priority = ($errorType == 'Error') ? SS_Log::ERR : SS_Log::WARN; - $writer = new SS_LogEmailWriter($emailAddress); - SS_Log::add_writer($writer, $priority); - SS_Log::log( - array( - 'errno' => $errno, - 'errstr' => $errstr, - 'errfile' => $errfile, - 'errline' => $errline, - 'errcontext' => $errcontext - ), - $priority - ); - SS_Log::remove_writer($writer); - } - - /** - * Log the given error, if self::$log_errors is set. - * Uses the native error_log() funtion in PHP. - * - * Format: [d-M-Y h:i:s] at line : - * - * @todo Detect script path for CLI errors - * @todo Log detailed errors to full file - * @deprecated 2.5 See SS_Log on setting up error file logging - */ - protected static function log_error_if_necessary($errno, $errstr, $errfile, $errline, $errcontext, $errtype) { - Deprecation::notice('2.5', - 'Use SS_Log instead. See the class documentation in SS_Log.php for more information.'); - $priority = ($errtype == 'Error') ? SS_Log::ERR : SS_Log::WARN; - $writer = new SS_LogFileWriter('../' . self::$log_errors_to); - SS_Log::add_writer($writer, $priority); - SS_Log::log( - array( - 'errno' => $errno, - 'errstr' => $errstr, - 'errfile' => $errfile, - 'errline' => $errline, - 'errcontext' => $errcontext - ), - $priority - ); - SS_Log::remove_writer($writer); - } - - /** - * @param string $server IP-Address or domain - * @deprecated 2.5 See SS_Log on setting up error email notification - */ - public static function set_custom_smtp_server($server) { - self::$custom_smtp_server = $server; - } - - /** - * @return string - * @deprecated 2.5 See SS_Log on setting up error email notification - */ - public static function get_custom_smtp_server() { - return self::$custom_smtp_server; - } - - /** - * Send errors to the given email address. - * Can be used like so: - * if(Director::isLive()) Debug::send_errors_to("sam@silverstripe.com"); - * - * @deprecated 2.5 See SS_Log on setting up error email notification - * - * @param string $emailAddress The email address to send errors to - * @param string $sendWarnings Set to true to send warnings as well as errors (Default: false) - */ - public static function send_errors_to($emailAddress, $sendWarnings = false) { - Deprecation::notice('2.5', 'Use SS_Log instead. See SS_Log on setting up error email notification.'); - self::$send_errors_to = $emailAddress; - self::$send_warnings_to = $sendWarnings ? $emailAddress : null; - } - - /** - * @return string - * @deprecated 2.5 See SS_Log on setting up error email notification - */ - public static function get_send_errors_to() { - Deprecation::notice('2.5', 'Use SS_Log instead. See SS_Log on setting up error email notification.'); - return self::$send_errors_to; - } - - /** - * @param string $emailAddress - * @deprecated 2.5 See SS_Log on setting up error email notification - */ - public static function send_warnings_to($emailAddress) { - Deprecation::notice('2.5', 'Use SS_Log instead. See SS_Log on setting up error email notification.'); - self::$send_warnings_to = $emailAddress; - } - - /** - * @return string - * @deprecated 2.5 See SS_Log on setting up error email notification - */ - public static function get_send_warnings_to() { - Deprecation::notice('2.5', 'Use SS_Log instead. See SS_Log on setting up error email notification.'); - return self::$send_warnings_to; - } - - /** - * Call this to enable logging of errors. - * @deprecated 2.5 See SS_Log on setting up error file logging - */ - public static function log_errors_to($logFile = ".sserrors") { - Deprecation::notice('2.5', 'Use SS_Log instead. See SS_Log on setting up error file logging.'); - self::$log_errors_to = $logFile; - } - - public static function caller() { - $bt = debug_backtrace(); - $caller = $bt[2]; - $caller['line'] = $bt[1]['line']; - $caller['file'] = $bt[1]['file']; - if(!isset($caller['class'])) $caller['class'] = ''; - if(!isset($caller['type'])) $caller['type'] = ''; - return $caller; - } - - /** - * @deprecated 2.5 Please use {@link SS_Backtrace::backtrace()} - */ - public static function backtrace($returnVal = false, $ignoreAjax = false) { - Deprecation::notice('2.5', 'Use SS_Backtrace::backtrace instead.'); - return SS_Backtrace::backtrace($returnVal, $ignoreAjax); - } - - /** - * @deprecated 2.5 Please use {@link SS_Backtrace::get_rendered_backtrace()} - */ - public static function get_rendered_backtrace($bt, $plainText = false) { - Deprecation::notice('2.5', 'Use SS_Backtrace::get_rendered_backtrace() instead.'); - return SS_Backtrace::get_rendered_backtrace($bt, $plainText); - } /** * Check if the user has permissions to run URL debug tools, diff --git a/filesystem/File.php b/filesystem/File.php index 9d6b4b171..68da17445 100644 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -234,14 +234,6 @@ class File extends DataObject { return $this->Filename; } - /** - * @deprecated 3.0 Use getTreeTitle() - */ - public function TreeTitle() { - Deprecation::notice('3.0', 'Use getTreeTitle() instead.'); - return $this->getTreeTitle(); - } - /** * @return string */ diff --git a/filesystem/Upload.php b/filesystem/Upload.php index ca87a8627..99e5bad0f 100644 --- a/filesystem/Upload.php +++ b/filesystem/Upload.php @@ -221,88 +221,6 @@ class Upload extends Controller { $this->file = $file; } - /** - * Get maximum file size for all or specified file extension. - * - * @deprecated 2.5 Please use Upload_Validator::getAllowedMaxFileSize() instead - * - * @param string $ext - * @return int Filesize in bytes - */ - public function getAllowedMaxFileSize($ext = null) { - Deprecation::notice('2.5', 'Use Upload_Validator::getAllowedMaxFileSize() instead.'); - return $this->validator->getAllowedMaxFileSize($ext); - } - - /** - * Set filesize maximums (in bytes). - * Automatically converts extensions to lowercase - * for easier matching. - * - * Example: - * - * array('*' => 200, 'jpg' => 1000) - * - * - * @deprecated 2.5 Please use Upload_Validator::setAllowedMaxFileSize() instead - * - * @param array|int $rules - */ - public function setAllowedMaxFileSize($rules) { - Deprecation::notice('2.5', 'Use Upload_Validator::setAllowedMaxFileSize() instead.'); - $this->validator->setAllowedMaxFileSize($rules); - } - - /** - * @deprecated 2.5 Please use Upload_Validator::getAllowedExtensions() instead - * @return array - */ - public function getAllowedExtensions() { - Deprecation::notice('2.5', 'Use Upload_Validator::getAllowedExtensions() instead.'); - return $this->validator->getAllowedExtensions(); - } - - /** - * @deprecated 2.5 Please use Upload_Validator::setAllowedExtensions() instead - * @param array $rules - */ - public function setAllowedExtensions($rules) { - Deprecation::notice('2.5', 'Use Upload_Validator::setAllowedExtensions() instead.'); - $this->validator->setAllowedExtensions($rules); - } - - /** - * Determines if the bytesize of an uploaded - * file is valid - can be defined on an - * extension-by-extension basis in {$allowedMaxFileSize} - * - * @deprecated 2.5 Please use Upload_Validator::isValidExtension() instead - * - * @param array $tmpFile - * @return boolean - */ - public function isValidSize($tmpFile) { - Deprecation::notice('2.5', 'Use Upload_Validator::isValidSize() instead.'); - $validator = new Upload_Validator(); - $validator->setTmpFile($tmpFile); - return $validator->isValidSize(); - } - - /** - * Determines if the temporary file has a valid extension - * - * @deprecated 2.5 Please use Upload_Validator::isValidExtension() instead - * - * @param array $tmpFile - * @return boolean - */ - public function isValidExtension($tmpFile) { - Deprecation::notice('2.5', 'Use Upload_Validator::isValidExtension() instead.'); - $validator = new Upload_Validator(); - $validator->setTmpFile($tmpFile); - return $validator->isValidExtension(); - } - /** * Clear out all errors (mostly set by {loadUploaded()}) */ diff --git a/forms/AjaxUniqueTextField.php b/forms/AjaxUniqueTextField.php index 952f507f5..d41fed224 100644 --- a/forms/AjaxUniqueTextField.php +++ b/forms/AjaxUniqueTextField.php @@ -52,7 +52,7 @@ class AjaxUniqueTextField extends TextField { 'maxlength' => ($this->maxLength) ? $this->maxLength : null ); - return $this->createTag('input', $attributes); + return FormField::create_tag('input', $attributes); } public function validate( $validator ) { diff --git a/forms/ComplexTableField.php b/forms/ComplexTableField.php index 3ec2deb1a..2cbc9ff81 100644 --- a/forms/ComplexTableField.php +++ b/forms/ComplexTableField.php @@ -21,7 +21,7 @@ * - childID Identifier of the database-record (the targeted table is determined by the $sourceClass * parameter) * - * @deprecated 3.0 Use GridField with GridFieldConfig_RecordEditor + * @deprecated 3.1 Use GridField with GridFieldConfig_RecordEditor * * @todo Control width/height of popup by constructor (hardcoded at the moment) * @package forms @@ -453,7 +453,7 @@ JS; } /** - * @deprecated 3.0 + * @deprecated 3.1 */ public function setRelationAutoSetting($value) { Deprecation::notice('3.0', 'Manipulate the DataList instead.'); diff --git a/forms/CompositeField.php b/forms/CompositeField.php index 37923a7f8..1887b5b53 100644 --- a/forms/CompositeField.php +++ b/forms/CompositeField.php @@ -69,14 +69,6 @@ class CompositeField extends FormField { return $this->children; } - /** - * @deprecated 3.0 Please use {@link FieldList()}. - */ - public function FieldSet() { - Deprecation::notice('3.0', 'Use FieldList() instead.'); - return $this->FieldList(); - } - public function setID($id) { $this->id = $id; return $this; diff --git a/forms/FieldSet.php b/forms/FieldSet.php deleted file mode 100644 index 307015c87..000000000 --- a/forms/FieldSet.php +++ /dev/null @@ -1,17 +0,0 @@ - 1 ? func_get_args(): $items); - } -} diff --git a/forms/FileField.php b/forms/FileField.php index 6b1b8d210..95ffc1d98 100644 --- a/forms/FileField.php +++ b/forms/FileField.php @@ -43,30 +43,6 @@ */ class FileField extends FormField { - /** - * Restrict filesize for either all filetypes - * or a specific extension, with extension-name - * as array-key and the size-restriction in bytes as array-value. - * - * @deprecated 2.5 - * @var array - */ - public $allowedMaxFileSize = array(); - - /** - * @var array Collection of extensions. - * Extension-names are treated case-insensitive. - * - * Example: - * - * array("jpg","GIF") - * - * - * @deprecated 2.5 - * @var array - */ - public $allowedExtensions = array(); - /** * Flag to automatically determine and save a has_one-relationship * on the saved record (e.g. a "Player" has_one "PlayerImage" would @@ -102,14 +78,6 @@ class FileField extends FormField { * @param int $value The value of the field. */ public function __construct($name, $title = null, $value = null) { - if(count(func_get_args()) > 3) { - Deprecation::notice( - '3.0', - 'Use setRightTitle() and setFolderName() instead of constructor arguments', - Deprecation::SCOPE_GLOBAL - ); - } - $this->upload = new Upload(); parent::__construct($name, $title, $value); @@ -223,4 +191,4 @@ class FileField extends FormField { $this->upload = $upload; } -} \ No newline at end of file +} diff --git a/forms/FileIFrameField.php b/forms/FileIFrameField.php deleted file mode 100644 index 7e122de9f..000000000 --- a/forms/FileIFrameField.php +++ /dev/null @@ -1,277 +0,0 @@ -canUploadNewFile = $can; - } - - /** - * @return boolean - */ - public function getCanUploadNewFile() { - return $this->canUploadNewFile; - } - - /** - * The data class that this field is editing. - * @return string Class name - */ - public function dataClass() { - if($this->form && $this->form->getRecord()) { - $class = $this->form->getRecord()->has_one($this->getName()); - return ($class) ? $class : 'File'; - } else { - return 'File'; - } - } - - /** - * @return string - */ - public function Field($properties = array()) { - Deprecation::notice('3.0', 'Use UploadField'); - - Requirements::css(FRAMEWORK_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css'); - Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang'); - Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js'); - Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-ui/jquery-ui.js'); - - - if($this->form->getRecord() && $this->form->getRecord()->exists()) { - $record = $this->form->getRecord(); - if(class_exists('Translatable') && SiteTree::has_extension('Translatable') && $record->Locale){ - $iframe = "iframe?locale=".$record->Locale; - }else{ - $iframe = "iframe"; - } - - return $this->createTag ( - 'iframe', - array ( - 'name' => $this->getName() . '_iframe', - 'src' => Controller::join_links($this->Link(), $iframe), - 'style' => 'height: 152px; width: 100%; border: none;' - ) - ) . $this->createTag ( - 'input', - array ( - 'type' => 'hidden', - 'id' => $this->ID(), - 'name' => $this->getName() . 'ID', - 'value' => $this->attrValue() - ) - ); - } else { - return _t( - 'FileIFrameField.ATTACHONCESAVED', - '{type}s can be attached once you have saved the record for the first time.', - array('type' => $this->FileTypeName()) - ); - } - } - - /** - * Attempt to retreive a File object that has already been attached to this forms data record - * - * @return File|null - */ - public function AttachedFile() { - return $this->form->getRecord() ? $this->form->getRecord()->{$this->getName()}() : null; - } - - /** - * @return string - */ - public function iframe() { - // clear the requirements added by any parent controllers - Requirements::clear(); - Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang'); - Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); - Requirements::javascript(FRAMEWORK_DIR . '/javascript/FileIFrameField.js'); - - Requirements::css(FRAMEWORK_DIR . '/css/FileIFrameField.css'); - - return $this->renderWith('FileIframeField_iframe'); - } - - /** - * @return Form - */ - public function EditFileForm() { - $uploadFile = _t('FileIFrameField.FROMCOMPUTER', 'From your Computer'); - $selectFile = _t('FileIFrameField.FROMFILESTORE', 'From the File Store'); - - if($this->AttachedFile() && $this->AttachedFile()->ID) { - $title = _t('FileIFrameField.REPLACE', 'Replace {type}', array('type' => $this->FileTypeName())); - } else { - $title = _t('FileIFrameField.ATTACH', 'Attach {type}', array('type' => $this->FileTypeName())); - } - - $fileSources = array(); - - if(singleton($this->dataClass())->canCreate()) { - if($this->canUploadNewFile) { - $fileSources["new//$uploadFile"] = new FileField('Upload', ''); - } - } - - $fileSources["existing//$selectFile"] = new TreeDropdownField('ExistingFile', '', 'File'); - - $fields = new FieldList ( - new HeaderField('EditFileHeader', $title), - new SelectionGroup('FileSource', $fileSources) - ); - - // locale needs to be passed through from the iframe source - if(isset($_GET['locale'])) { - $fields->push(new HiddenField('locale', '', $_GET['locale'])); - } - - return new Form ( - $this, - 'EditFileForm', - $fields, - new FieldList( - new FormAction('save', $title) - ) - ); - } - - public function save($data, $form) { - // check the user has entered all the required information - if ( - !isset($data['FileSource']) - || ($data['FileSource'] == 'new' && (!isset($_FILES['Upload']) || !$_FILES['Upload'])) - || ($data['FileSource'] == 'existing' && (!isset($data['ExistingFile']) || !$data['ExistingFile'])) - ) { - $form->sessionMessage(_t('FileIFrameField.NOSOURCE', 'Please select a source file to attach'), 'required'); - $form->getController()->redirectBack(); - return; - } - - $desiredClass = $this->dataClass(); - $controller = $this->form->getController(); - - // upload a new file - if($data['FileSource'] == 'new') { - $fileObject = Object::create($desiredClass); - - try { - $this->upload->loadIntoFile($_FILES['Upload'], $fileObject, $this->folderName); - } catch (Exception $e){ - $form->sessionMessage(_t('FileIFrameField.DISALLOWEDFILETYPE', - 'This filetype is not allowed to be uploaded'), 'bad'); - $controller->redirectBack(); - return; - } - - if($this->upload->isError()) { - $controller->redirectBack(); - return; - } - - $this->form->getRecord()->{$this->getName() . 'ID'} = $fileObject->ID; - - $fileObject->write(); - } - - // attach an existing file from the assets store - if($data['FileSource'] == 'existing') { - $fileObject = DataObject::get_by_id('File', $data['ExistingFile']); - - // dont allow the user to attach a folder by default - if(!$fileObject || ($fileObject instanceof Folder && $desiredClass != 'Folder')) { - $controller->redirectBack(); - return; - } - - $this->form->getRecord()->{$this->getName() . 'ID'} = $fileObject->ID; - - if(!$fileObject instanceof $desiredClass) { - $fileObject->ClassName = $desiredClass; - $fileObject->write(); - } - } - - $this->form->getRecord()->write(); - $controller->redirectBack(); - } - - /** - * @return Form - */ - public function DeleteFileForm() { - $form = new Form ( - $this, - 'DeleteFileForm', - new FieldList ( - new HiddenField('DeleteFile', null, false) - ), - new FieldList ( - $deleteButton = new FormAction ( - 'delete', _t('FileIFrameField.DELETE', 'Delete {type}', array('type' => $this->FileTypeName())) - ) - ) - ); - - $deleteButton->addExtraClass('delete'); - return $form; - } - - 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->getName() . 'ID'}); - - if($file) { - $file->delete(); - } - } - - // then un-attach file from this record - $this->form->getRecord()->{$this->getName() . 'ID'} = 0; - $this->form->getRecord()->write(); - - $this->form->getController()->redirectBack(); - } - - /** - * Get the type of file this field is used to attach (e.g. File, Image) - * - * @return string - */ - public function FileTypeName() { - return _t('FileIFrameField.FILE', 'File'); - } - -} diff --git a/forms/Form.php b/forms/Form.php index c93d1e453..5c451f7e2 100644 --- a/forms/Form.php +++ b/forms/Form.php @@ -575,24 +575,6 @@ class Form extends RequestHandler { return $this; } - /** - * Get a named field from this form's fields. - * It will traverse into composite fields for you, to find the field you want. - * It will only return a data field. - * - * @deprecated 3.0 Use Fields() and FieldList API instead - * @return FormField - */ - public function dataFieldByName($name) { - Deprecation::notice('3.0', 'Use Fields() and FieldList API instead'); - - foreach($this->getExtraFields() as $field) { - if(!$this->fields->dataFieldByName($field->getName())) $this->fields->push($field); - } - - return $this->fields->dataFieldByName($name); - } - /** * Return the form's action buttons - used by the templates * @@ -620,18 +602,6 @@ class Form extends RequestHandler { return $this; } - /** - * Unset the form's action button by its name. - * - * @deprecated 3.0 Use Actions() and FieldList API instead - * @param string $name - */ - public function unsetActionByName($name) { - Deprecation::notice('3.0', 'Use Actions() and FieldList API instead'); - - $this->actions->removeByName($name); - } - /** * @param String * @param String @@ -667,34 +637,6 @@ class Form extends RequestHandler { return $attrs; } - /** - * Unset the form's dataField by its name - * - * @deprecated 3.0 Use Fields() and FieldList API instead - */ - public function unsetDataFieldByName($fieldName){ - Deprecation::notice('3.0', 'Use Fields() and FieldList API instead'); - - foreach($this->Fields()->dataFields() as $child) { - if(is_object($child) && ($child->getName() == $fieldName || $child->Title() == $fieldName)) { - $child = null; - } - } - } - - /** - * Remove a field from the given tab. - * - * @deprecated 3.0 Use Fields() and FieldList API instead - */ - public function unsetFieldFromTab($tabName, $fieldName) { - Deprecation::notice('3.0', 'Use Fields() and FieldList API instead'); - - // Find the tab - $tab = $this->Fields()->findOrMakeTab($tabName); - $tab->removeByName($fieldName); - } - /** * Return the attributes of the form tag - used by the templates. * @@ -806,14 +748,6 @@ class Form extends RequestHandler { return $this; } - /** - * @deprecated 3.0 Please use {@link getEncType}. - */ - public function FormEncType() { - Deprecation::notice('3.0', 'Please use Form->getEncType() instead.'); - return $this->getEncType(); - } - /** * Returns the real HTTP method for the form: * GET, POST, PUT, DELETE or HEAD. @@ -1216,25 +1150,6 @@ class Form extends RequestHandler { return $data; } - /** - * Resets a specific field to its passed default value. - * Does NOT clear out all submitted data in the form. - * - * @deprecated 3.0 Use Fields() and FieldList API instead - * @param string $fieldName - * @param mixed $fieldValue - */ - public function resetField($fieldName, $fieldValue = null) { - Deprecation::notice('3.0', 'Use Fields() and FieldList API instead'); - - $dataFields = $this->fields->dataFields(); - if($dataFields) foreach($dataFields as $field) { - if($field->getName()==$fieldName) { - $field = $field->setValue($fieldValue); - } - } - } - /** * Call the given method on the given field. * This is used by Ajax-savvy form fields. By putting '&action=callfieldmethod' to the end @@ -1380,34 +1295,6 @@ class Form extends RequestHandler { return $this; } - /** - * Disable security tokens for every form. - * Note that this doesn't apply to {@link SecurityToken} - * instances outside of the Form class, nor applies - * to existing form instances. - * - * See {@link enable_all_security_tokens()}. - * - * @deprecated 2.5 Use SecurityToken::disable() - */ - public static function disable_all_security_tokens() { - Deprecation::notice('2.5', 'Use SecurityToken::disable() instead.'); - SecurityToken::disable(); - } - - /** - * Returns true if security is enabled - that is if the security token - * should be included and checked on this form. - * - * @deprecated 2.5 Use Form->getSecurityToken()->isEnabled() - * - * @return bool - */ - public function securityTokenEnabled() { - Deprecation::notice('2.5', 'Use Form->getSecurityToken()->isEnabled() instead.'); - return $this->securityToken->isEnabled(); - } - /** * Returns the security token for this form (if any exists). * Doesn't check for {@link securityTokenEnabled()}. diff --git a/forms/FormField.php b/forms/FormField.php index a0c749259..0ec3dd06a 100644 --- a/forms/FormField.php +++ b/forms/FormField.php @@ -117,6 +117,23 @@ class FormField extends RequestHandler { return $label; } + /** + * Construct and return HTML tag. + */ + public static function create_tag($tag, $attributes, $content = null) { + $preparedAttributes = ''; + foreach($attributes as $k => $v) { + // Note: as indicated by the $k == value item here; the decisions over what to include in the attributes + // can sometimes get finicky + if(!empty($v) || $v === '0' || $k == 'value') { + $preparedAttributes .= " $k=\"" . Convert::raw2att($v) . "\""; + } + } + + if($content || $tag != 'input') return "<$tag$preparedAttributes>$content"; + else return "<$tag$preparedAttributes />"; + } + /** * Create a new field. * @param name The internal field name, passed to forms. @@ -159,14 +176,6 @@ class FormField extends RequestHandler { return $this->name; } - /** - * @deprecated 3.0 Use {@link getName()}. - */ - public function Name() { - Deprecation::notice('3.0', 'Use getName() instead.'); - return $this->getName(); - } - /** * Returns the field message, used by form validation. * Use {@link setError()} to set this property. @@ -254,30 +263,6 @@ class FormField extends RequestHandler { return $this; } - /** - * Set tabindex HTML attribute - * (defaults to none). - * - * @deprecated 3.0 Use setAttribute("tabindex") instead - * @param int $index - */ - public function setTabIndex($index) { - Deprecation::notice('3.0', 'Use setAttribute("tabindex") instead'); - $this->setAttribute($index); - return $this; - } - - /** - * Get tabindex (if previously set) - * - * @deprecated 3.0 Use getAttribute("tabindex") instead - * @return int - */ - public function getTabIndex() { - Deprecation::notice('3.0', 'Use getAttribute("tabindex") instead'); - return $this->getAttribute('tabindex'); - } - /** * Compiles all CSS-classes. Optionally includes a "nolabel"-class * if no title was set on the formfield. @@ -771,26 +756,9 @@ class FormField extends RequestHandler { return strtolower(preg_replace('/Field$/', '', $this->class)); } - /** - * Construct and return HTML tag. - * - * @deprecated 3.0 Please define your own FormField template using {@link setFieldTemplate()} - * and/or {@link renderFieldTemplate()} - * - * @todo Transform to static helper method. - */ public function createTag($tag, $attributes, $content = null) { - $preparedAttributes = ''; - foreach($attributes as $k => $v) { - // Note: as indicated by the $k == value item here; the decisions over what to include in the attributes - // can sometimes get finicky - if(!empty($v) || $v === '0' || $k == 'value') { - $preparedAttributes .= " $k=\"" . Convert::raw2att($v) . "\""; - } - } - - if($content || $tag != 'input') return "<$tag$preparedAttributes>$content"; - else return "<$tag$preparedAttributes />"; + Deprecation::notice('3.1', 'Use FormField::create_tag()'); + return self::create_tag($tag, $attributes, $content); } /** @@ -805,15 +773,6 @@ class FormField extends RequestHandler { return true; } - /** - * @deprecated 3.0 Use setDescription() - */ - public function describe($description) { - Deprecation::notice('3.0', 'Use setDescription()'); - $this->setDescription($description); - return $this; - } - /** * Describe this field, provide help text for it. * By default, renders as a "title" attribute on the form field. diff --git a/forms/GroupedDropdownField.php b/forms/GroupedDropdownField.php index 50e2ae724..3ab4bab5b 100644 --- a/forms/GroupedDropdownField.php +++ b/forms/GroupedDropdownField.php @@ -55,7 +55,7 @@ class GroupedDropdownField extends DropdownField { } } - return $this->createTag('select', $this->getAttributes(), $options); + return FormField::create_tag('select', $this->getAttributes(), $options); } public function Type() { diff --git a/forms/HasManyComplexTableField.php b/forms/HasManyComplexTableField.php index 864eee721..667c44bda 100644 --- a/forms/HasManyComplexTableField.php +++ b/forms/HasManyComplexTableField.php @@ -31,7 +31,7 @@ * * @see http://doc.silverstripe.org/tutorial/5-dataobject-relationship-management * - * @deprecated 3.0 Use GridField with GridFieldConfig_RelationEditor + * @deprecated 3.1 Use GridField with GridFieldConfig_RelationEditor * * @package forms * @subpackage fields-relational diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index 23750ae01..deee5bccd 100644 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -46,11 +46,6 @@ class HtmlEditorField extends TextareaField { * @see TextareaField::__construct() */ public function __construct($name, $title = null, $value = '') { - if(count(func_get_args()) > 3) { - Deprecation::notice('3.0', 'Use setRows() and setColumns() instead of constructor arguments', - Deprecation::SCOPE_GLOBAL); - } - parent::__construct($name, $title, $value); self::include_js(); @@ -81,11 +76,10 @@ class HtmlEditorField extends TextareaField { } } - return $this->createTag ( - 'textarea', - $this->getAttributes(), - htmlentities($value->getContent(), ENT_COMPAT, 'UTF-8') - ); + $properties['Value'] = htmlentities($value->getContent(), ENT_COMPAT, 'UTF-8'); + $obj = $this->customise($properties); + + return $obj->renderWith($this->getTemplates()); } public function getAttributes() { diff --git a/forms/ImageField.php b/forms/ImageField.php deleted file mode 100644 index b478d5344..000000000 --- a/forms/ImageField.php +++ /dev/null @@ -1,60 +0,0 @@ -Usage - * - * If you want to upload all assets from this field to a given folder you can define the folder in 2 ways. Either in - * the constructor or as a method on the field - * - * - * $myField = new ImageField("myName", "Upload image below", null, null, null, "myFolder"); - * - * - * Will upload images into the assets/myFolder folder. If that folder does not exist it will create it for you. You can - * also define it as a method - * - * - * $myField = new ImageField("myName"); - * $myField->setFolderName('myFolder'); - * - * - * @deprecated 3.0 Use UploadField with $myField->getValidator()->setAllowedExtensions(array('jpg', 'gif', 'png')); - * - * @package forms - * @subpackage fields-files - */ -class ImageField extends FileIFrameField { - - /** - * @return SimpleImageField_Disabled - */ - public function performReadonlyTransformation() { - return new SimpleImageField_Disabled($this->name, $this->title, $this->value, $this->form); - } - - /** - * @return string - */ - public function FileTypeName() { - return _t('ImageField.IMAGE', 'Image'); - } - - /** - * Adds the filter, so the dropdown displays only images and folders. - * - * @return Form - */ - public function EditFileForm() { - Deprecation::notice('3.0', 'Use UploadField', Deprecation::SCOPE_CLASS); - - $filter = create_function('$item', 'return (in_array("Folder", ClassInfo::ancestry($item->ClassName)) ||' - . ' in_array("Image", ClassInfo::ancestry($item->ClassName)));'); - - $form = parent::EditFileForm(); - $form->Fields()->dataFieldByName('ExistingFile')->setFilterFunction($filter); - - return $form; - } -} diff --git a/forms/ImageFormAction.php b/forms/ImageFormAction.php deleted file mode 100644 index 81d9e859e..000000000 --- a/forms/ImageFormAction.php +++ /dev/null @@ -1,43 +0,0 @@ -image = $image; - $this->hoverImage = $hoverImage; - $this->className = $className; - parent::__construct($action, $title, $form); - } - - public function Field($properties = array()) { - Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); - Requirements::javascript(FRAMEWORK_DIR . '/javascript/ImageFormAction.js'); - - $classClause = ''; - if($this->className) $classClause = $this->className . ' '; - if($this->hoverImage) $classClause .= 'rollover '; - return "id() . "\" type=\"image\" name=\"{$this->name}\"" - . " src=\"{$this->image}\" title=\"{$this->title}\" alt=\"{$this->title}\" />"; - } -} diff --git a/forms/ManyManyComplexTableField.php b/forms/ManyManyComplexTableField.php index fbd1e505d..c0fb9d064 100644 --- a/forms/ManyManyComplexTableField.php +++ b/forms/ManyManyComplexTableField.php @@ -30,7 +30,7 @@ * ); * * - * @deprecated 3.0 Use GridField with GridFieldConfig_RelationEditor + * @deprecated 3.1 Use GridField with GridFieldConfig_RelationEditor * * @package forms * @subpackage fields-relational diff --git a/forms/SimpleImageField.php b/forms/SimpleImageField.php deleted file mode 100644 index 56c4fce38..000000000 --- a/forms/SimpleImageField.php +++ /dev/null @@ -1,173 +0,0 @@ -Usage - * - * - * class Article extends DataObject { - * static $has_one = array('MyImage' => 'Image'); - * } - * // use in your form constructor etc. - * $myField = new SimpleImageField('MyImage'); - * - * - * Usage within a controller - * - * First add your $has_one relationship: - * - * - * static $has_one = array( - * 'FileName' => 'FileType' - * ); - * - * (i.e. Image for a FileType) - * - * Then add your Field into your form: - * - * - * function Form() { - * return new Form($this, "Form", new FieldList( - * new SimpleImageField ( - * $name = "FileTypeID", - * $title = "Upload your FileType" - * ) - * ), new FieldList( - * - * // List the action buttons here - doform executes the function 'doform' below - * new FormAction("doform", "Submit") - * - * // List the required fields here - * ), new RequiredFields( - * "FileTypeID" - * )); - * } - * // Then make sure that the file is saved into the assets area: - * function doform($data, $form) { - * $file = new File(); - * $file->loadUploaded($_FILES['FileTypeID']); - * - * // Redirect to a page thanking people for registering - * $this->redirect('thanks-for-your-submission/'); - * } - * - * - * Your file should be now in the uploads directory - * - * @package forms - * @subpackage fields-files - */ - -/** - * @deprecated 3.0 Use UploadField with $myField->getValidator()->setAllowedExtensions(array('jpg', 'gif', 'png')); - */ -class SimpleImageField extends FileField { - - public function __construct($name, $title = null, $value = null) { - Deprecation::notice('3.0', - "SimpleImageField is deprecated. Use UploadField with " - . "\$myField->getValidator()->setAllowedExtensions(array('jpg', 'gif', 'png'))", - Deprecation::SCOPE_CLASS); - - if(count(func_get_args()) > 3) { - Deprecation::notice('3.0', 'Use setRightTitle() and setFolderName() instead of constructor arguments', - Deprecation::SCOPE_GLOBAL); - } - - parent::__construct($name, $title, $value); - - $this->getValidator()->setAllowedExtensions(array('jpg','gif','png')); - } - - public function Field($properties = array()) { - if($this->form) $record = $this->form->getRecord(); - $fieldName = $this->name; - if(isset($record)&&$record) { - $imageField = $record->$fieldName(); - } else { - $imageField = ""; - } - - $html = "
"; - if($imageField && $imageField->exists()) { - $html .= '
'; - if($imageField->hasMethod('Thumbnail') && $imageField->Thumbnail()) { - $html .= "Thumbnail()->getURL()."\" />"; - } else if($imageField->CMSThumbnail()) { - $html .= "CMSThumbnail()->getURL()."\" />"; - } - $html .= '
'; - } - $html .= $this->createTag("input", - array( - "type" => "file", - "name" => $this->name, - "id" => $this->id(), - "tabindex" => $this->getAttribute('tabindex'), - 'disabled' => $this->disabled - ) - ); - $html .= $this->createTag("input", - array( - "type" => "hidden", - "name" => "MAX_FILE_SIZE", - "value" => $this->getValidator()->getAllowedMaxFileSize(), - "tabindex" => $this->getAttribute('tabindex'), - ) - ); - $html .= "
"; - - return $html; - } - - /** - * Returns a readonly version of this field - */ - public function performReadonlyTransformation() { - $field = new SimpleImageField_Disabled($this->name, $this->title, $this->value); - $field->setForm($this->form); - $field->setReadonly(true); - return $field; - } -} - -/** - * Disabled version of {@link SimpleImageField}. - * @package forms - * @subpackage fields-files - */ -class SimpleImageField_Disabled extends FormField { - - protected $disabled = true; - - protected $readonly = true; - - public function Field($properties = array()) { - $record = $this->form->getRecord(); - $fieldName = $this->name; - - $field = "
"; - if($this->value) { - // Only the case for DataDifferencer - $field .= $this->value; - } else { - if($record) $imageField = $record->$fieldName(); - if($imageField && $imageField->exists()) { - if($imageField->hasMethod('Thumbnail')) $field .= "Thumbnail()->URL."\" />"; - elseif($imageField->CMSThumbnail()) $field .= "CMSThumbnail()->URL."\" />"; - else {} // This shouldn't be called but it sometimes is for some reason, so we don't do anything - }else{ - $field .= ""; - } - } - $field .= "
"; - - return $field; - } - -} diff --git a/forms/TableListField.php b/forms/TableListField.php index 82196c021..ffee6e762 100644 --- a/forms/TableListField.php +++ b/forms/TableListField.php @@ -11,7 +11,7 @@ * All get variables are namespaced in the format ctf[MyFieldName][MyParameter] to avoid collisions * when multiple TableListFields are present in a form. * - * @deprecated 3.0 Use GridField with GridFieldConfig_RecordEditor + * @deprecated 3.1 Use GridField with GridFieldConfig_RecordEditor * * @package forms * @subpackage fields-relational diff --git a/forms/TextareaField.php b/forms/TextareaField.php index d52834af8..92863c6ca 100644 --- a/forms/TextareaField.php +++ b/forms/TextareaField.php @@ -32,21 +32,6 @@ class TextareaField extends FormField { */ protected $cols = 20; - /** - * Create a new textarea field. - * - * @param $name Field name - * @param $title Field title - * @param $value The current value - */ - public function __construct($name, $title = null, $value = '') { - if(count(func_get_args()) > 3) { - Deprecation::notice('3.0', 'Use setRows() and setColumns() instead of constructor arguments'); - } - - parent::__construct($name, $title, $value); - } - public function getAttributes() { return array_merge( parent::getAttributes(), diff --git a/forms/ToggleCompositeField.php b/forms/ToggleCompositeField.php index 7c8aaa2cb..8231c2d62 100644 --- a/forms/ToggleCompositeField.php +++ b/forms/ToggleCompositeField.php @@ -84,13 +84,5 @@ class ToggleCompositeField extends CompositeField { return $this; } - /** - * @deprecated 3.0 - */ - public function startClosed($bool) { - Deprecation::notice('3.0', 'Please use ToggleCompositeField->setStartClosed()'); - $this->setStartClosed($bool); - } - } diff --git a/forms/TreeMultiselectField.php b/forms/TreeMultiselectField.php index 6a28273ba..f651e0ad2 100644 --- a/forms/TreeMultiselectField.php +++ b/forms/TreeMultiselectField.php @@ -115,7 +115,7 @@ class TreeMultiselectField extends TreeDropdownField { $title = _t('DropdownField.CHOOSE', '(Choose)', 'start value of a dropdown'); } - return $this->createTag ( + return FormField::create_tag( 'div', array ( 'id' => "TreeDropdownField_{$this->id()}", @@ -125,7 +125,7 @@ class TreeMultiselectField extends TreeDropdownField { 'data-title' => $title, 'title' => $this->getDescription() ), - $this->createTag ( + FormField::create_tag( 'input', array ( 'id' => $this->id(), diff --git a/forms/Validator.php b/forms/Validator.php index 8a6fd9afe..f23df34bb 100644 --- a/forms/Validator.php +++ b/forms/Validator.php @@ -22,37 +22,6 @@ abstract class Validator extends Object { */ protected $errors; - /** - * @deprecated 3.0 Use custom javascript validation instead - */ - public static function set_javascript_validation_handler($handler) { - Deprecation::notice('3.0', 'Use custom javascript validation instead.'); - } - - /** - * @deprecated 3.0 Use custom javascript validation instead - */ - public static function get_javascript_validator_handler() { - Deprecation::notice('3.0', 'Use custom javascript validation instead.'); - } - - /** - * @deprecated 3.0 Use custom javascript validation instead - */ - public function setJavascriptValidationHandler($handler) { - Deprecation::notice('3.0', 'Use custom javascript validation instead.'); - } - - /** - * Gets the current javascript validation handler for this form. - * If not set, falls back to the global static {@link self::$javascript_validation_handler}. - * - * @return string - */ - public function getJavascriptValidationHandler() { - Deprecation::notice('3.0', 'Use custom javascript validation instead.'); - } - /** * @param Form $form */ diff --git a/forms/gridfield/GridField.php b/forms/gridfield/GridField.php index 16e1215af..4cbaec58e 100644 --- a/forms/gridfield/GridField.php +++ b/forms/gridfield/GridField.php @@ -339,13 +339,13 @@ class GridField extends FormField { // A return value of null means this columns should be skipped altogether. if($colContent === null) continue; $colAttributes = $this->getColumnAttributes($record, $column); - $rowContent .= $this->createTag('td', $colAttributes, $colContent); + $rowContent .= FormField::create_tag('td', $colAttributes, $colContent); } $classes = array('ss-gridfield-item'); if ($idx == 0) $classes[] = 'first'; if ($idx == $total-1) $classes[] = 'last'; $classes[] = ($idx % 2) ? 'even' : 'odd'; - $row = $this->createTag( + $row = FormField::create_tag( 'tr', array( "class" => implode(' ', $classes), @@ -361,26 +361,27 @@ class GridField extends FormField { } // Display a message when the grid field is empty - if(!(isset($content['body']) && $content['body'])) { - $content['body'] = $this->createTag( + if(!(isset($content['body']) && $content['body'])) { + $content['body'] = FormField::create_tag( 'tr', array("class" => 'ss-gridfield-item ss-gridfield-no-items'), - $this->createTag( + FormField::create_tag( 'td', array('colspan' => count($columns)), - _t('GridField.NoItemsFound', 'No items found')) + _t('GridField.NoItemsFound', 'No items found') + ) ); } // Turn into the relevant parts of a table $head = $content['header'] - ? $this->createTag('thead', array(), $content['header']) + ? FormField::create_tag('thead', array(), $content['header']) : ''; $body = $content['body'] - ? $this->createTag('tbody', array('class' => 'ss-gridfield-items'), $content['body']) + ? FormField::create_tag('tbody', array('class' => 'ss-gridfield-items'), $content['body']) : ''; $foot = $content['footer'] - ? $this->createTag('tfoot', array(), $content['footer']) + ? FormField::create_tag('tfoot', array(), $content['footer']) : ''; $this->addExtraClass('ss-gridfield field'); @@ -398,9 +399,9 @@ class GridField extends FormField { return - $this->createTag('fieldset', $attrs, + FormField::create_tag('fieldset', $attrs, $content['before'] . - $this->createTag('table', $tableAttrs, $head."\n".$foot."\n".$body) . + FormField::create_tag('table', $tableAttrs, $head."\n".$foot."\n".$body) . $content['after'] ); } diff --git a/forms/gridfield/GridFieldDeleteAction.php b/forms/gridfield/GridFieldDeleteAction.php index e5a959418..16c24a10b 100644 --- a/forms/gridfield/GridFieldDeleteAction.php +++ b/forms/gridfield/GridFieldDeleteAction.php @@ -45,7 +45,7 @@ class GridFieldDeleteAction implements GridField_ColumnProvider, GridField_Actio } /** - * Return any special attributes that will be used for FormField::createTag() + * Return any special attributes that will be used for FormField::create_tag() * * @param GridField $gridField * @param DataObject $record diff --git a/forms/gridfield/GridFieldEditButton.php b/forms/gridfield/GridFieldEditButton.php index 1bada543b..1c6836ed6 100644 --- a/forms/gridfield/GridFieldEditButton.php +++ b/forms/gridfield/GridFieldEditButton.php @@ -20,7 +20,7 @@ class GridFieldEditButton implements GridField_ColumnProvider { } /** - * Return any special attributes that will be used for FormField::createTag() + * Return any special attributes that will be used for FormField::create_tag() * * @param GridField $gridField * @param DataObject $record diff --git a/i18n/i18n.php b/i18n/i18n.php index f03b44850..ea7f000ed 100644 --- a/i18n/i18n.php +++ b/i18n/i18n.php @@ -1925,20 +1925,6 @@ class i18n extends Object implements TemplateGlobalProvider { public static function set_default_locale($locale) { self::$default_locale = $locale; } - - /** - * Include a locale file determined by module name and locale - * - * @deprecated 3.0 Use Zend_Translate instead - * - * @param string $module Module that contains the locale file - * @param string $locale Locale to be loaded - */ - public static function include_locale_file($module, $locale) { - Deprecation::notice('3.0', 'Use Zend_Translate instead.'); - - if (file_exists($file = Director::getAbsFile("$module/lang/$locale.php"))) include_once($file); - } /** * Includes all available language files for a certain defined locale. diff --git a/javascript/FileIFrameField.js b/javascript/FileIFrameField.js deleted file mode 100644 index 2935ac3f8..000000000 --- a/javascript/FileIFrameField.js +++ /dev/null @@ -1,47 +0,0 @@ -(function($) { - - $('#Form_DeleteFileForm_action_delete').click(function(e) { - var deleteMessage = ss.i18n._t('FILEIFRAMEFIELD.CONFIRMDELETE', 'Are you sure you want to delete this file?'); - - if(typeof(parent.jQuery.fn.dialog) != 'undefined') { - var buttons = {}; - var $dialog = undefined; - var $deleteForm = $('#Form_DeleteFileForm'); - var $deleteFile = $('#Form_DeleteFileForm_DeleteFile'); - - buttons[ss.i18n._t('FILEIFRAMEFIELD.DELETEFILE', 'Delete File')] = function() { - $deleteFile.attr('value', 'true'); - $deleteForm.submit(); - - $dialog.dialog('close'); - }; - - buttons[ss.i18n._t('FILEIFRAMEFIELD.UNATTACHFILE', 'Un-Attach File')] = function() { - $deleteForm.submit(); - $dialog.dialog('close'); - }; - - buttons[ss.i18n._t('CANCEL', 'Cancel')] = function() { - $dialog.dialog('close'); - }; - - $dialog = parent.jQuery('

' + deleteMessage + '

').dialog({ - bgiframe: true, - resizable: false, - modal: true, - height: 140, - overlay: { - backgroundColor: '#000', - opacity: 0.5 - }, - title: ss.i18n._t('FILEIFRAMEFIELD.DELETEIMAGE', 'Delete Image'), - buttons: buttons - }); - - e.preventDefault(); - } else if(!confirm(deleteMessage)) { - e.preventDefault(); - } - }); - -})(jQuery); \ No newline at end of file diff --git a/javascript/ImageFormAction.js b/javascript/ImageFormAction.js deleted file mode 100644 index 5e1b85128..000000000 --- a/javascript/ImageFormAction.js +++ /dev/null @@ -1,18 +0,0 @@ -(function($) { - $(document).ready(function() { - $("input.rollover").live('mouseover', function(){ - if(!this.overSrc) { - var srcParts = $(this).attr('src').match( /(.*)\.([a-zA-Z]+)$/ ); - var fileName = srcParts[1]; - var extension = srcParts[2]; - this.overSrc = fileName + '_over.' + extension; - this.outSrc = $(this).attr('src'); - } - $(this).attr('src', this.overSrc); - }); - - $("input.rollover").live('mouseout', function(){ - $(this).attr('src', this.outSrc); - }); - }); -})(jQuery); \ No newline at end of file diff --git a/model/ComponentSet.php b/model/ComponentSet.php deleted file mode 100644 index c66dbf11f..000000000 --- a/model/ComponentSet.php +++ /dev/null @@ -1,10 +0,0 @@ -alterDataQuery_30(function($query) use ($join){ - $query->join($join); - }); - } - /** * Return a new DataList instance with the records returned in this query restricted by a limit clause * @@ -257,10 +243,6 @@ class DataList extends ViewableData implements SS_List, SS_Filterable, SS_Sortab if(!$limit && !$offset) { return $this; } - if($limit && !is_numeric($limit)) { - Deprecation::notice('3.0', 'Please pass limits as 2 arguments, rather than an array or SQL fragment.', - Deprecation::SCOPE_GLOBAL); - } return $this->alterDataQuery_30(function($query) use ($limit, $offset){ $query->limit($limit, $offset); }); diff --git a/model/DataObject.php b/model/DataObject.php index 61156610e..b3839579e 100644 --- a/model/DataObject.php +++ b/model/DataObject.php @@ -1454,20 +1454,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity return 'ParentID'; } - /** - * Sets the component of a relationship. - * This should only need to be called internally, - * and is mainly due to the caching logic in {@link getComponents()} - * and {@link getManyManyComponents()}. - * - * @param string $componentName Name of the component - * @param DataObject|HasManyList|ManyManyList $componentValue Value of the component - * @deprecated 3.0 Not used internally anymore. - */ - public function setComponent($componentName, $componentValue) { - Deprecation::notice('3.0', 'Not used internally anymore.'); - } - /** * Returns a many-to-many component, as a ManyManyList. * @param string $componentName Name of the many-many component @@ -2030,17 +2016,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity return isset($this->record[$field]) ? $this->record[$field] : null; } - /** - * Return a map of all the fields for this record - * @deprecated 2.4 Use toMap() - * - * @return array A map of field names to field values. - */ - public function getAllFields() { - Deprecation::notice('3.0', 'Use toMap() instead.'); - return $this->toMap(); - } - /** * Loads all the stub fields that an initial lazy load didn't load fully. * @@ -2657,23 +2632,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity return false; } - /** - * @deprecated 3.0 Use DataList::create and DataList to do your querying - */ - public function buildSQL($filter = "", $sort = "", $limit = "", $join = "", $restrictClasses = true, $having="") { - Deprecation::notice('3.0', 'Use DataList::create and DataList to do your querying instead.'); - return $this->extendedSQL($filter, $sort, $limit, $join, $having); - } - - /** - * @deprecated 3.0 Use DataList::create and DataList to do your querying - */ - public function extendedSQL($filter = "", $sort = "", $limit = "", $join = ""){ - Deprecation::notice('3.0', 'Use DataList::create and DataList to do your querying instead.'); - $dataList = DataObject::get($this->class, $filter, $sort, $join, $limit); - return $dataList->dataQuery()->query(); - } - /** * Return all objects matching the filter * sub-classes are automatically selected and included @@ -2708,13 +2666,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity return $result; } - // Todo: Determine if we can deprecate for 3.0.0 and use DI or something instead - // Todo: Make the $containerClass method redundant - if($containerClass != 'DataList') { - Deprecation::notice('3.0', 'DataObject::get() - $containerClass argument is deprecated.', - Deprecation::SCOPE_GLOBAL); - } - $result = DataList::create($callerClass)->where($filter)->sort($sort); if($limit && strpos($limit, ',') !== false) { @@ -2731,10 +2682,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity } /** - * @deprecated 3.0 Use DataList::create and DataList to do your querying + * @deprecated 3.1 Use DataList::create and DataList to do your querying */ public function Aggregate($class = null) { - Deprecation::notice('3.0', 'Call aggregate methods on a DataList directly instead. In templates' + Deprecation::notice('3.1', 'Call aggregate methods on a DataList directly instead. In templates' . ' an example of the new syntax is <% cached List(Member).max(LastEdited) %> instead' . ' (check partial-caching.md documentation for more details.)'); @@ -2752,70 +2703,14 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity } /** - * @deprecated 3.0 Use DataList::create and DataList to do your querying + * @deprecated 3.1 Use DataList::create and DataList to do your querying */ public function RelationshipAggregate($relationship) { - Deprecation::notice('3.0', 'Call aggregate methods on a relationship directly instead.'); + Deprecation::notice('3.1', 'Call aggregate methods on a relationship directly instead.'); return $this->$relationship(); } - /** - * DataList::create("Table")->where("filter") is the same as singleton("Table")->instance_get("filter") - * - * @deprecated 3.0 Use DataList::create and DataList to do your querying - * - * @param string $filter A filter to be inserted into the WHERE clause. - * @param string $sort A sort expression to be inserted into the ORDER BY clause. If omitted, self::$default_sort - * will be used. - * @param string $join A single join clause. This can be used for filtering, only 1 instance of each DataObject - * will be returned. - * @param string $limit A limit expression to be inserted into the LIMIT clause. - * @param string $containerClass The container class to return the results in. - * - * @return mixed The objects matching the filter, in the class specified by $containerClass - */ - public function instance_get($filter = "", $sort = "", $join = "", $limit="", $containerClass = "DataObjectSet") { - Deprecation::notice('3.0', 'Use DataList::create and DataList to do your querying instead.'); - return self::get($this->class, $filter, $sort, $join, $limit, $containerClass); - } - - /** - * Take a database {@link SS_Query} and instanciate an object for each record. - * - * @deprecated 3.0 Replaced by DataList - * - * @param SS_Query|array $records The database records, a {@link SS_Query} object or an array of maps. - * @param string $containerClass The class to place all of the objects into. - * - * @return mixed The new objects in an object of type $containerClass - */ - public function buildDataObjectSet($records, $containerClass = "DataObjectSet", $query = null, $baseClass = null) { - Deprecation::notice('3.0', 'Use DataList instead.'); - - foreach($records as $record) { - if(empty($record['RecordClassName'])) { - $record['RecordClassName'] = $record['ClassName']; - } - if(class_exists($record['RecordClassName'])) { - $results[] = new $record['RecordClassName']($record); - } else { - if(!$baseClass) { - user_error("Bad RecordClassName '{$record['RecordClassName']}' and " - . "\$baseClass not set", E_USER_ERROR); - } else if(!is_string($baseClass) || !class_exists($baseClass)) { - user_error("Bad RecordClassName '{$record['RecordClassName']}' and bad " - . "\$baseClass '$baseClass not set", E_USER_ERROR); - } - $results[] = new $baseClass($record); - } - } - - if(isset($results)) { - return new $containerClass($results); - } - } - /** * Return the first item matching the given query. * All calls to get_one() are cached. @@ -2909,23 +2804,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity DataObject::$_cache_field_labels = array(); } - /** - * Does the hard work for get_one() - * - * @deprecated 3.0 Use DataList::create($this->class)->where($filter)->sort($orderby)->First() instead - * - * @uses DataExtension->augmentSQL() - * - * @param string $filter A filter to be inserted into the WHERE clause - * @param string $orderby A sort expression to be inserted into the ORDER BY clause. - * @return DataObject The first item matching the query - */ - public function instance_get_one($filter, $orderby = null) { - Deprecation::notice('3.0', - 'Use DataList::create($this->class)->where($filter)->sort($orderby)->First() instead.'); - return DataObject::get_one($this->class, $filter, true, $orderby); - } - /** * Return the given element, searching by ID * @@ -3066,24 +2944,6 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity $this->extend('requireDefaultRecords', $dummy); } - /** - * @deprecated 3.0 Use DataObject::database_fields() instead - * @see DataObject::database_fields() - */ - public function databaseFields() { - Deprecation::notice('3.0', 'Use DataObject::database_fields() instead.'); - return self::database_fields($this->class); - } - - /** - * @deprecated 3.0 Use DataObject::custom_database_fields() instead - * @see DataObject::custom_database_fields() - */ - public function customDatabaseFields() { - Deprecation::notice('3.0', 'Use DataObject::custom_database_fields() instead.'); - return self::custom_database_fields($this->class); - } - /** * Returns fields bu traversing the class heirachy in a bottom-up direction. * diff --git a/model/DataObjectDecorator.php b/model/DataObjectDecorator.php deleted file mode 100644 index 0bcd41c04..000000000 --- a/model/DataObjectDecorator.php +++ /dev/null @@ -1,15 +0,0 @@ - 1) { - $items = func_get_args(); - } - - foreach ($items as $i => $item) { - if ($item instanceof ViewableData) { - continue; - } - - if (is_object($item) || ArrayLib::is_associative($item)) { - $items[$i] = new ArrayData($item); - } else { - user_error( - "DataObjectSet::__construct: Passed item #{$i} is not an" - . ' and object or associative array, can\'t be properly' - . ' iterated on in templates', E_USER_WARNING - ); - } - } - } - - parent::__construct($items); - } - -} diff --git a/model/DataQuery.php b/model/DataQuery.php index aea38eff3..d9b195972 100644 --- a/model/DataQuery.php +++ b/model/DataQuery.php @@ -530,24 +530,6 @@ class DataQuery { return $this; } - /** - * Add a join clause to this query - * @deprecated 3.0 Use innerJoin() or leftJoin() instead. - */ - public function join($join) { - Deprecation::notice('3.0', 'Use innerJoin() or leftJoin() instead.'); - if($join) { - $this->query->addFrom($join); - // TODO: This needs to be resolved for all databases - - if(DB::getConn() instanceof MySQLDatabase) { - $from = $this->query->getFrom(); - $this->query->setGroupBy(reset($from) . ".\"ID\""); - } - } - return $this; - } - /** * Add an INNER JOIN clause to this query. * diff --git a/model/fieldtypes/StringField.php b/model/fieldtypes/StringField.php index 9f1037f49..a580a0531 100644 --- a/model/fieldtypes/StringField.php +++ b/model/fieldtypes/StringField.php @@ -11,8 +11,6 @@ abstract class StringField extends DBField { static $casting = array( "LimitCharacters" => "Text", - "Lower" => "Text", - "Upper" => "Text", "LowerCase" => "Text", "UpperCase" => "Text", ); @@ -114,15 +112,6 @@ abstract class StringField extends DBField { public function LowerCase() { return mb_strtolower($this->value); } - - /** - * Return another DBField object with this value in lowercase. - * @deprecated 3.0 Use LowerCase() instead. - */ - public function Lower() { - Deprecation::notice('3.0', 'Use LowerCase() instead.'); - return $this->LowerCase(); - } /** * Converts the current value for this Enum DBField to uppercase. @@ -132,13 +121,4 @@ abstract class StringField extends DBField { return mb_strtoupper($this->value); } - /** - * Return another DBField object with this value in uppercase. - * @deprecated 3.0 Use UpperCase() instead. - */ - public function Upper() { - Deprecation::notice('3.0', 'Use UpperCase() instead.'); - return $this->UpperCase(); - } - } diff --git a/model/fieldtypes/Text.php b/model/fieldtypes/Text.php index 392bafa02..822d4a535 100644 --- a/model/fieldtypes/Text.php +++ b/model/fieldtypes/Text.php @@ -78,17 +78,7 @@ class Text extends StringField { public function NoHTML() { return strip_tags($this->value); } - /** - * Return the value of the field with XML tags escaped. - * - * @deprecated 3.0 Use DBField->XML() instead. - * @return string - */ - public function EscapeXML() { - Deprecation::notice('3.0', 'Use DBField->XML() instead.'); - return str_replace(array('&','<','>','"'), array('&','<','>','"'), $this->value); - } - + /** * Return the value of the field with relative links converted to absolute urls. * @return string diff --git a/scss/FileIFrameField.scss b/scss/FileIFrameField.scss deleted file mode 100755 index 6df5e66ce..000000000 --- a/scss/FileIFrameField.scss +++ /dev/null @@ -1,175 +0,0 @@ -/* -typography.css has been removed from framework, why shall we still has this? a dynamic typographp.css should be used by -server side call, like Requirements::css(); -@import url("typography.css"); -*/ - -html,body { - padding: 0; - margin: 0; - border-style: none; - height: 100%; - overflow: hidden; -} - -form { - margin: 0; padding: 0; -} - -h2 { - margin: 0; - font-size: 1.4em; -} - -/** - * Selection Groups - */ -.SelectionGroup { - padding: 0; - margin: 10px 0 0 0; -} -.SelectionGroup li { - list-style-type: none; - margin: 0 0 4px; -} -.SelectionGroup li label { - font-size: 11px; -} -.SelectionGroup li input.selector { - width: 20px; - margin-top: 0; -} - - -.SelectionGroup li div.field { - display: none; -} -.SelectionGroup li.selected div.field { - display: block; - margin-left: 30px; - margin-bottom: 1em; - margin-top: 4px; -} -.mainblock .SelectionGroup li.selected div.field { - margin-left: 27px; - margin-bottom: 4px; -} - -.SelectionGroup li.selected label.selector { - font-weight: bold; -} - - - -/** - * TreeDropdownField stying - */ -.SelectionGroup div.TreeDropdownField { - width: 241px; - padding: 0; -} -html>body div.TreeDropdownField { - position:relative; -} - -.SelectionGroup div.TreeDropdownField span.items { - display: block; - height: 100%; - border: 1px #7f9db9 solid; - cursor: pointer; - width: 214px; - float: left; - padding-top: 2px; - padding-bottom: 2px; - background-color: white; -} - -.SelectionGroup div.TreeDropdownField div.tree_holder { - clear: left; - cursor: default; - border: 1px black solid; - margin: 0; - height: 180px; - overflow: auto; - background-color: white; - /** - * HACK IE6, see http://www.hedgerwow.com/360/bugs/css-select-free.html - */ - position:absolute; - z-index:10; - width:238px;/*must have for any value*/ -} - -html>body div.TreeDropdownField div.tree_holder { - top: 20px; - left: 0px; - z-index: 1000; -} - -/** - * HACK IE6, see http://www.hedgerwow.com/360/bugs/css-select-free.html - */ -.SelectionGroup div.TreeDropdownField div.tree_holder iframe { - display:none;/* IE5*/ - display/**/:block;/* IE5*/ - position:absolute; - top:0; - left:0; - z-index:-1; - filter:mask(); - width:180px; /*must have for any big value*/ - height:200px/*must have for any big value*/; - border: 0; -} - -div.TreeDropdownField a.editLink { - border-width: 1px 1px 1px 0; - background: url(../images/TreeDropdownField_button.gif) left top no-repeat; - width: 19px; - height: 21px; - margin: 0; - padding: 0; - float: left; - clear: right; - z-index: 0; - overflow: hidden; -} - -/* added block/width so tree values don't disappear in ie7 */ -.SelectionGroup div.TreeDropdownField ul.tree li { - display: block; - width: 100%; -} - -.Actions { - text-align: right; - margin: 0; - position: absolute; - right: 5px; - bottom: 5px; -} - -.mainblock { - float: left; - border: 1px solid #ccc; - padding: 5px; - margin-right: 5px; - height: 140px; - position: relative; -} - .mainblock.editform { - width: 275px; - } - .mainblock.attached { - position: absolute; - left: 270px; - width: 100px; - } - -.mainblock form fieldset { - border: none; -} - -.mainblock form div.Actions input { - font-size: 11px; -} diff --git a/search/filters/SubstringFilter.php b/search/filters/SubstringFilter.php deleted file mode 100755 index 470963443..000000000 --- a/search/filters/SubstringFilter.php +++ /dev/null @@ -1,44 +0,0 @@ -getValue(); - $filter = new PartialMatchFilter($this->getFullName(), $values, $this->getModifiers()); - return $filter->apply($query); - } - - protected function applyOne(DataQuery $query) { - /* NO OP */ - } - - public function exclude(DataQuery $query) { - $values = $this->getValue(); - $filter = new PartialMatchFilter($this->getFullName(), $values, $this->getModifiers()); - return $filter->exclude($query); - } - - protected function excludeOne(DataQuery $query) { - /* NO OP */ - } - - public function isEmpty() { - return $this->getValue() === array() || $this->getValue() === null || $this->getValue() === ''; - } -} - diff --git a/security/Group.php b/security/Group.php index 518011e6a..772712a21 100755 --- a/security/Group.php +++ b/security/Group.php @@ -216,15 +216,6 @@ class Group extends DataObject { return $labels; } - /** - * @deprecated 2.5 - */ - public static function addToGroupByName($member, $groupcode) { - Deprecation::notice('2.5', 'Use $member->addToGroupByCode($groupcode) instead.'); - - return $member->addToGroupByCode($groupcode); - } - /** * Get many-many relation to {@link Member}, * including all members which are "inherited" from children groups of this record. @@ -323,14 +314,6 @@ class Group extends DataObject { ); } - /** - * @deprecated 3.0 Use getTreeTitle() - */ - public function TreeTitle() { - Deprecation::notice('3.0', 'Use getTreeTitle() instead.'); - return $this->getTreeTitle(); - } - public function getTreeTitle() { if($this->hasMethod('alternateTreeTitle')) return $this->alternateTreeTitle(); else return htmlspecialchars($this->Title, ENT_QUOTES); diff --git a/security/PasswordEncryptor.php b/security/PasswordEncryptor.php index d2258d307..5d5bc093e 100644 --- a/security/PasswordEncryptor.php +++ b/security/PasswordEncryptor.php @@ -102,22 +102,6 @@ abstract class PasswordEncryptor { return substr($generator->generateHash('sha1'), 0, 50); } - /** - * This usually just returns a strict string comparison, - * but is necessary for {@link PasswordEncryptor_LegacyPHPHash}. - * - * @param String $hash1 - * @param String $hash2 - * @return boolean - * - * @deprecated 3.0 - Use PasswordEncryptor::check() instead. - */ - public function compare($hash1, $hash2) { - Deprecation::notice('3.0.0', - 'PasswordEncryptor::compare() is deprecated, replaced by PasswordEncryptor::check().'); - return ($hash1 === $hash2); - } - /** * This usually just returns a strict string comparison, * but is necessary for retain compatibility with password hashed @@ -355,15 +339,6 @@ class PasswordEncryptor_LegacyPHPHash extends PasswordEncryptor_PHPHash { // letters. return substr(base_convert($password, 16, 36), 0, 64); } - - public function compare($hash1, $hash2) { - Deprecation::notice('3.0.0', - 'PasswordEncryptor::compare() is deprecated, replaced by PasswordEncryptor::check().'); - - // Due to flawed base_convert() floating poing precision, - // only the first 10 characters are consistently useful for comparisons. - return (substr($hash1, 0, 10) === substr($hash2, 0, 10)); - } public function check($hash, $password, $salt = null, $member = null) { // Due to flawed base_convert() floating poing precision, diff --git a/templates/FileIFrameField_iframe.ss b/templates/FileIFrameField_iframe.ss deleted file mode 100644 index e44766a17..000000000 --- a/templates/FileIFrameField_iframe.ss +++ /dev/null @@ -1,26 +0,0 @@ - - - - - <% base_tag %> - - <% _t('FileIFrameField_iframe.ss.TITLE', 'Image Uploading Iframe') %> - - - -
- $EditFileForm -
- - <% if AttachedFile %> -
- $AttachedFile.CMSThumbnail - - <% if DeleteFileForm %> - $DeleteFileForm - <% end_if %> -
- <% end_if %> - - - diff --git a/tests/control/DirectorTest.php b/tests/control/DirectorTest.php index 102534060..4a85d482f 100644 --- a/tests/control/DirectorTest.php +++ b/tests/control/DirectorTest.php @@ -191,40 +191,6 @@ class DirectorTest extends SapphireTest { } } - public function testURLParam() { - // 2.4 only - $originalDeprecation = Deprecation::dump_settings(); - Deprecation::notification_version('2.4'); - - Director::test('DirectorTestRule/myaction/myid/myotherid'); - // TODO Works on the assumption that urlParam() is not unset after a test run, which is dodgy - $this->assertEquals(Director::urlParam('Action'), 'myaction'); - $this->assertEquals(Director::urlParam('ID'), 'myid'); - $this->assertEquals(Director::urlParam('OtherID'), 'myotherid'); - - Deprecation::restore_settings($originalDeprecation); - } - - public function testURLParams() { - // 2.4 only - $originalDeprecation = Deprecation::dump_settings(); - Deprecation::notification_version('2.4'); - - Director::test('DirectorTestRule/myaction/myid/myotherid'); - // TODO Works on the assumption that urlParam() is not unset after a test run, which is dodgy - $this->assertEquals( - Director::urlParams(), - array( - 'Controller' => 'DirectorTestRequest_Controller', - 'Action' => 'myaction', - 'ID' => 'myid', - 'OtherID' => 'myotherid' - ) - ); - - Deprecation::restore_settings($originalDeprecation); - } - /** * Tests that additional parameters specified in the routing table are * saved in the request diff --git a/tests/model/DataObjectTest.php b/tests/model/DataObjectTest.php index 115f24f04..9839a82ab 100644 --- a/tests/model/DataObjectTest.php +++ b/tests/model/DataObjectTest.php @@ -116,24 +116,6 @@ class DataObjectTest extends SapphireTest { $this->assertEquals(3, $comments->Count()); $this->assertEquals('Phil', $comments->First()->Name); - // Test join - 2.4 only - $originalDeprecation = Deprecation::dump_settings(); - Deprecation::notification_version('2.4'); - - $comments = DataObject::get( - 'DataObjectTest_TeamComment', - "\"DataObjectTest_Team\".\"Title\" = 'Team 1'", - "\"Name\" ASC", - "INNER JOIN \"DataObjectTest_Team\"" - . " ON \"DataObjectTest_TeamComment\".\"TeamID\" = \"DataObjectTest_Team\".\"ID\"" - ); - - $this->assertEquals(2, $comments->Count()); - $this->assertEquals('Bob', $comments->First()->Name); - $this->assertEquals('Joe', $comments->Last()->Name); - - Deprecation::restore_settings($originalDeprecation); - // Test limit $comments = DataObject::get('DataObjectTest_TeamComment', '', "\"Name\" ASC", '', '1,2'); $this->assertEquals(2, $comments->Count()); diff --git a/view/ArrayData.php b/view/ArrayData.php index 549a953b5..dd3575c9b 100644 --- a/view/ArrayData.php +++ b/view/ArrayData.php @@ -100,13 +100,5 @@ class ArrayData extends ViewableData { if ($arr) foreach($arr as $name => $value) $obj->$name = $value; return $obj; } - - /** - * @deprecated 3.0 Use {@link ArrayData::toMap()}. - */ - public function getArray() { - Deprecation::notice('3.0', 'Use ArrayData::toMap() instead.'); - return $this->toMap(); - } }