summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r--inc/pageutils.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php
index e22dc3c86..dea691381 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -152,6 +152,27 @@ function metaFN($id,$ext){
}
/**
+ * returns an array of full paths to all metafiles of a given ID
+ *
+ * @author Esther Brunner <esther@kaffeehaus.ch>
+ */
+function metaFiles($id){
+ $name = noNS($id);
+ $dir = metaFN(getNS($id),'');
+ $files = array();
+
+ $dh = @opendir($dir);
+ if(!$dh) return;
+ while(($file = readdir($dh)) !== false){
+ if(strpos($file,$name.'.') == 0 && !is_dir($dir.$file))
+ $files[] = $dir.$file;
+ }
+ closedir($dh);
+
+ return $files;
+}
+
+/**
* returns the full path to the mediafile specified by ID
*
* The filename is URL encoded to protect Unicode chars