* @param <type> $search
* @return <type>
*/
- public function get_listing($path = null, $page = '', $search = '') {
+ public function get_listing($path = null, $page = 1, $search = '') {
global $CFG, $DB, $USER;
///check that Mahara has a good version
$list = array();
+ if (!empty($filesandfolders['folders'])) {
+ foreach ($filesandfolders['folders'] as $folder) {
+ $list[] = array('path'=>$folder['id'], 'title'=>$folder['title'], 'date'=>$folder['mtime'], 'size'=>'0', 'children'=>array(), 'thumbnail' => $CFG->pixpath .'/f/folder.gif');
+ }
+ }
if (!empty($filesandfolders['files'])) {
foreach ($filesandfolders['files'] as $file) {
if ($file['artefacttype'] == 'image') {
} else {
$thumbnail = $CFG->pixpath .'/f/'. mimeinfo('icon32', $file['title']);
}
- $list[] = array( 'title'=>$file['title'], 'date'=>$file['mtime'], 'size'=>'10MB', 'source'=>$file['id'], 'thumbnail' => $thumbnail);
- }
- }
- if (!empty($filesandfolders['folders'])) {
- foreach ($filesandfolders['folders'] as $folder) {
- $list[] = array('path'=>$folder['id'], 'title'=>$folder['title'], 'date'=>$folder['mtime'], 'size'=>'0', 'children'=>array(), 'thumbnail' => $CFG->pixpath .'/f/folder.gif');
+ $list[] = array( 'title'=>$file['title'], 'date'=>$file['mtime'], 'source'=>$file['id'], 'thumbnail' => $thumbnail);
}
}
+
$filepickerlisting = array(
'path' => $newpath,
'dynload' => 1,
'nosearch' => 0,
'list'=> $list,
+ 'manage'=> $host->wwwroot.'/artefact/file/'
);
return $filepickerlisting;