From: <var...@us...> - 2014-10-16 10:18:43
|
Revision: 9273 http://sourceforge.net/p/phpwiki/code/9273 Author: vargenau Date: 2014-10-16 10:18:36 +0000 (Thu, 16 Oct 2014) Log Message: ----------- Add class imageOrVideoSet Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-16 09:56:27 UTC (rev 9272) +++ trunk/lib/stdlib.php 2014-10-16 10:18:36 UTC (rev 9273) @@ -57,6 +57,7 @@ class fileSet {fileSet($directory, $filepattern = false), getFiles($exclude='', $sortby='', $limit='') } class imageSet extends fileSet + class imageOrVideoSet extends fileSet glob_to_pcre ($glob) glob_match ($glob, $against, $case_sensitive = true) @@ -1422,10 +1423,18 @@ */ function _filenameSelector($filename) { - return preg_match("/(" . INLINE_IMAGES . ")$/i", $filename); + return is_image($filename); } } +class imageOrVideoSet extends fileSet +{ + function _filenameSelector($filename) + { + return is_image($filename) or is_video($filename); + } +} + // Convert fileglob to regex style: // Convert some wildcards to pcre style, escape the rest // Escape . \\ + * ? [ ^ ] $ ( ) { } = ! < > | : / This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |