From 7e9ab93199836e9e282f7bdc3c8ca309ed716315 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Wed, 14 Aug 2013 15:56:58 +0800 Subject: [PATCH] MDL-40709 skydrive: filter files by accepted types This means images will only be shown in the image picker, videos in the video picker - etc. --- repository/skydrive/lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/repository/skydrive/lib.php b/repository/skydrive/lib.php index 50b6933390342..26464b8de66c7 100644 --- a/repository/skydrive/lib.php +++ b/repository/skydrive/lib.php @@ -96,7 +96,11 @@ public function get_listing($path='', $page = '') { $ret['dynload'] = true; $ret['nosearch'] = true; $ret['manage'] = 'https://skydrive.live.com/'; - $ret['list'] = $this->skydrive->get_file_list($path); + + $fileslist = $this->skydrive->get_file_list($path); + // Filter list for accepted types. Hopefully this will be done by core some day. + $fileslist = array_filter($fileslist, array($this, 'filter')); + $ret['list'] = $fileslist; // Generate path bar, always start with the plugin name. $ret['path'] = array();