API CHANGE Removed $rightTitle and $folderName constructor arguments for FileField and SimpleImageField, use setRightTitle() and setFolderName() instead

This commit is contained in:
Ingo Schommer 2012-01-02 17:43:36 +01:00
parent 1a10e8bcf5
commit 27ec98cfce
2 changed files with 8 additions and 8 deletions

View File

@ -101,15 +101,13 @@ class FileField extends FormField {
* @param string $name The internal field name, passed to forms.
* @param string $title The field label.
* @param int $value The value of the field.
* @param Form $form Reference to the container form
* @param string $rightTitle Used in SmallFieldHolder() to force a right-aligned label
* @param string $folderName Folder to upload files to
*/
function __construct($name, $title = null, $value = null, $form = null, $rightTitle = null, $folderName = null) {
if(isset($folderName)) $this->folderName = $folderName;
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');
$this->upload = new Upload();
parent::__construct($name, $title, $value, $form, $rightTitle);
parent::__construct($name, $title, $value);
}
public function Field($properties = array()) {

View File

@ -65,8 +65,10 @@
class SimpleImageField extends FileField {
function __construct($name, $title = null, $value = null, $form = null, $rightTitle = null, $folderName = null) {
parent::__construct($name, $title, $value, $form, $rightTitle, $folderName);
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');
parent::__construct($name, $title, $value);
$this->getValidator()->setAllowedExtensions(array('jpg','gif','png'));
}