Skip to content

Commit

Permalink
MDL-40709 skydrive: filter files by accepted types
Browse files Browse the repository at this point in the history
This means images will only be shown in the image picker, videos
in the video picker - etc.
  • Loading branch information
danpoltawski committed Aug 14, 2013
1 parent 50ff861 commit 7e9ab93
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion repository/skydrive/lib.php
Expand Up @@ -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();
Expand Down

0 comments on commit 7e9ab93

Please sign in to comment.