-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from storypioneers/develop
Merge 1.4.2
- Loading branch information
Showing
4 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Selector | ||
* Kirby Fileselect Field for Kirby 2 | ||
* | ||
* @version 1.4.1 | ||
* @version 1.4.2 | ||
* @author Jonas Döbertin <[email protected]> | ||
* for digital storytelling pioneers <[email protected]> | ||
* @copyright digital storytelling pioneers <[email protected]> | ||
|
@@ -334,7 +334,7 @@ public function files() | |
|
||
$files = $files->sortBy($this->sort, ($this->flip) ? 'desc' : 'asc') | ||
->filter(function ($file) use ($field) { | ||
return $field->includeAllFiles() or in_array($file->type(), $field->types); | ||
return $field->includeAllFiles() or in_array($file->type(), $field->types()); | ||
}); | ||
|
||
/** | ||
|
@@ -410,4 +410,20 @@ public function isRegExp($string) | |
{ | ||
return !(@preg_match($string, null) === false); | ||
} | ||
|
||
/** | ||
* Return type filter array. | ||
* | ||
* FIX: This function is required since we create a new variable containing | ||
* a reference to `$this` to overcome the unavailability of `$this within | ||
* closures in PHP < 5.4.0 by passing this new reference with the "use" | ||
* language construct in the `files()` function. | ||
* | ||
* @since 1.4.2 | ||
* @return array | ||
*/ | ||
public function types() | ||
{ | ||
return $this->types; | ||
} | ||
} |