mirror of
https://github.com/processwire/processwire.git
synced 2025-08-14 02:34:24 +02:00
Bump version to 3.0.170
This commit is contained in:
@@ -17,7 +17,7 @@ require_once(__DIR__ . '/boot.php');
|
|||||||
* ~~~~~
|
* ~~~~~
|
||||||
* #pw-body
|
* #pw-body
|
||||||
*
|
*
|
||||||
* ProcessWire 3.x, Copyright 2020 by Ryan Cramer
|
* ProcessWire 3.x, Copyright 2021 by Ryan Cramer
|
||||||
* https://processwire.com
|
* https://processwire.com
|
||||||
*
|
*
|
||||||
* Default API vars (A-Z)
|
* Default API vars (A-Z)
|
||||||
@@ -79,7 +79,7 @@ class ProcessWire extends Wire {
|
|||||||
* Reversion revision number
|
* Reversion revision number
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const versionRevision = 169;
|
const versionRevision = 170;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version suffix string (when applicable)
|
* Version suffix string (when applicable)
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
* https://processwire.com
|
* https://processwire.com
|
||||||
*
|
*
|
||||||
* @property array $allowFieldtypes Allowed Fieldtype types for custom fields
|
* @property array $allowFieldtypes Allowed Fieldtype types for custom fields
|
||||||
|
* @property string $defaultFileExtensions
|
||||||
* @method string formatValueString(Page $page, Field $field, $value)
|
* @method string formatValueString(Page $page, Field $field, $value)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -145,6 +146,11 @@ class FieldtypeFile extends FieldtypeMulti implements ConfigurableModule {
|
|||||||
if($this->className() === 'FieldtypeFile') $this->allowFieldtypes = $this->defaultAllowFieldtypes;
|
if($this->className() === 'FieldtypeFile') $this->allowFieldtypes = $this->defaultAllowFieldtypes;
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get($key) {
|
||||||
|
if($key === 'defaultFileExtensions') return $this->getDefaultFileExtensions();
|
||||||
|
return parent::get($key);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Inputfield module to handle input for this Fieldtype
|
* Get the Inputfield module to handle input for this Fieldtype
|
||||||
@@ -1253,7 +1259,9 @@ class FieldtypeFile extends FieldtypeMulti implements ConfigurableModule {
|
|||||||
* Subclasses can override with their own string of file extensions
|
* Subclasses can override with their own string of file extensions
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getDefaultFileExtensions() {
|
protected function getDefaultFileExtensions() {
|
||||||
|
// note: this method is not public because other modules are implementing it
|
||||||
|
// access $fieldtype->defaultFileExtensions to get the value instead
|
||||||
return "pdf doc docx xls xlsx gif jpg jpeg png";
|
return "pdf doc docx xls xlsx gif jpg jpeg png";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ class FieldtypeFileConfiguration extends Wire {
|
|||||||
$f = $modules->get('InputfieldTextarea');
|
$f = $modules->get('InputfieldTextarea');
|
||||||
$f->attr('name', 'extensions');
|
$f->attr('name', 'extensions');
|
||||||
$value = $field->get('extensions');
|
$value = $field->get('extensions');
|
||||||
if(!$value) $value = $fieldtype->getDefaultFileExtensions();
|
if(!$value) $value = $fieldtype->get('defaultFileExtensions');
|
||||||
$f->attr('value', $value);
|
$f->attr('value', $value);
|
||||||
$f->attr('rows', 3);
|
$f->attr('rows', 3);
|
||||||
$f->label = $this->_('Allowed file extensions');
|
$f->label = $this->_('Allowed file extensions');
|
||||||
|
@@ -68,7 +68,7 @@ class FieldtypeImage extends FieldtypeFile {
|
|||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getDefaultFileExtensions() {
|
protected function getDefaultFileExtensions() {
|
||||||
return "gif jpg jpeg png";
|
return "gif jpg jpeg png";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user