1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 08:44:46 +02:00

Bump version to 3.0.89 and some other adjustments

This commit is contained in:
Ryan Cramer
2018-01-26 11:43:22 -05:00
parent 2cebe89e57
commit 90efe9b14a
6 changed files with 28 additions and 27 deletions

View File

@@ -1063,20 +1063,6 @@ $config->pageAdd = array(
'noSuggestTemplates' => '', 'noSuggestTemplates' => '',
); );
/**
* Disable template suggestions when adding new pages?
*
* Applies when adding a new page where more than one template may be selected for the newly added page.
*
* - true: Always disable template suggestions (forcing user to make selection)
* - false: Never disable template suggestions (default)
* - array: Array of template names or IDs where suggestions should be disabled when children are added.
*
* @var bool|array
*
$config->noSuggestTemplate = false;
*/
/*** 9. MISC ************************************************************************************/ /*** 9. MISC ************************************************************************************/

View File

@@ -232,13 +232,13 @@ class Pagefile extends WireData {
*/ */
public function filedata($key = '', $value = null) { public function filedata($key = '', $value = null) {
$filedata = $this->filedata; $filedata = $this->filedata;
$changed = false;
if($key === false || $key === null) { if($key === false || $key === null) {
// unset property named in $value // unset property named in $value
if(!empty($value)) { if(!empty($value) && isset($filedata[$value])) {
unset($this->filedata[$value]); unset($this->filedata[$value]);
if(isset($filedata[$value])) $this->trackChange('filedata', $filedata, $this->filedata); $changed = true;
} }
return $this;
} else if(empty($key)) { } else if(empty($key)) {
// return all // return all
return $filedata; return $filedata;
@@ -246,9 +246,8 @@ class Pagefile extends WireData {
// set all // set all
if($key != $filedata) { if($key != $filedata) {
$this->filedata = $key; $this->filedata = $key;
$this->trackChange('filedata', $filedata, $this->filedata); $changed = true;
} }
return $this;
} else if($value === null) { } else if($value === null) {
// return value for key // return value for key
return isset($this->filedata[$key]) ? $this->filedata[$key] : null; return isset($this->filedata[$key]) ? $this->filedata[$key] : null;
@@ -256,10 +255,14 @@ class Pagefile extends WireData {
// set value for key // set value for key
if(!isset($filedata[$key]) || $filedata[$key] != $value) { if(!isset($filedata[$key]) || $filedata[$key] != $value) {
$this->filedata[$key] = $value; $this->filedata[$key] = $value;
$this->trackChange('filedata', $filedata, $this->filedata); $changed = true;
} }
return $this;
} }
if($changed) {
$this->trackChange('filedata', $filedata, $this->filedata);
if($this->page && $this->field) $this->page->trackChange($this->field->name);
}
return $this;
} }
/** /**

View File

@@ -45,7 +45,7 @@ class ProcessWire extends Wire {
* Reversion revision number * Reversion revision number
* *
*/ */
const versionRevision = 88; const versionRevision = 89;
/** /**
* Version suffix string (when applicable) * Version suffix string (when applicable)

View File

@@ -2007,7 +2007,8 @@ function InputfieldImage($) {
updateProgress(); updateProgress();
if(useClientResize) { var ext = file.name.substring(file.name.lastIndexOf('.')+1).toLowerCase();
if(useClientResize && (ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif')) {
var resizer = new PWImageResizer(resizeSettings); var resizer = new PWImageResizer(resizeSettings);
$spinner.addClass('pw-resizing'); $spinner.addClass('pw-resizing');
resizer.resize(file, function(imageData) { resizer.resize(file, function(imageData) {

File diff suppressed because one or more lines are too long

View File

@@ -830,7 +830,7 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
/** /**
* Get array of actions available for given Pagefile * Get array of actions available for given Pagefile
* *
* @param Pagefile $pagefile * @param Pagefile|Pageimage $pagefile
* @return array Associative array of ('action_name' => 'Action Label') * @return array Associative array of ('action_name' => 'Action Label')
* *
*/ */
@@ -849,6 +849,7 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
'dup' => $this->_('Duplicate'), 'dup' => $this->_('Duplicate'),
'rmv' => $this->_('Remove variations'), 'rmv' => $this->_('Remove variations'),
'rbv' => $this->_('Rebuild variations'), 'rbv' => $this->_('Rebuild variations'),
'rmf' => $this->_('Remove focus'),
'vertical' => $this->_('vert'), 'vertical' => $this->_('vert'),
'horizontal' => $this->_('horiz'), 'horizontal' => $this->_('horiz'),
'both' => $this->_('both'), 'both' => $this->_('both'),
@@ -886,6 +887,10 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
$actions['bw'] = $labels['bw']; $actions['bw'] = $labels['bw'];
$actions['sep'] = $labels['sep']; $actions['sep'] = $labels['sep'];
if($pagefile->hasFocus) {
$actions['rmf'] = $labels['rmf'];
}
} }
return $actions; return $actions;
@@ -1345,6 +1350,7 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
$success = null; $success = null;
$showSuccess = true; $showSuccess = true;
$rebuildVariations = false;
if($action == 'dup') { if($action == 'dup') {
// duplicate image file // duplicate image file
@@ -1369,6 +1375,10 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
// rebuild variations // rebuild variations
} else if($action == 'rmv') { } else if($action == 'rmv') {
// remove variations // remove variations
} else if($action == 'rmf') {
// remove focus
$pagefile->focus(false);
$success = true;
} else { } else {
/** @var ImageSizer $sizer Image sizer actions */ /** @var ImageSizer $sizer Image sizer actions */
$sizer = $this->wire(new ImageSizer($pagefile->filename())); $sizer = $this->wire(new ImageSizer($pagefile->filename()));
@@ -1396,9 +1406,10 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu
$success = $sizer->rotate($deg); $success = $sizer->rotate($deg);
} }
if($success && $rebuildVariations) $pagefile->rebuildVariations();
} }
if($success && $rebuildVariations) $pagefile->rebuildVariations();
if($success === null) { if($success === null) {
// for hooks // for hooks
$success = $this->processUnknownFileAction($pagefile, $action, $label); $success = $this->processUnknownFileAction($pagefile, $action, $label);