]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-16907, add thumbnail for smb plugin"
authordongsheng <dongsheng>
Tue, 21 Oct 2008 06:37:13 +0000 (06:37 +0000)
committerdongsheng <dongsheng>
Tue, 21 Oct 2008 06:37:13 +0000 (06:37 +0000)
repository/smb/repository.class.php

index ddf441fb71c9c6589436b51443e2f5e0f784a443..fe8592e67953d645c1d89f95376163ffd093048f 100755 (executable)
@@ -33,7 +33,6 @@ class repository_smb extends repository {
         }
 
         $fp = fopen($dir.$file, 'w');
-        $c = new curl;
         $content = '';
         $fp = fopen($url, 'r');
         while (!feof($fp)) {
@@ -47,6 +46,7 @@ class repository_smb extends repository {
         return false;
     }
     public function get_listing($path='') {
+        global $CFG;
         $list = array();
         $ret  = array();
         $ret['dynload'] = true;
@@ -61,10 +61,16 @@ class repository_smb extends repository {
                 $ret['list'][] = array(
                     'title'=>$file,
                     'path'=>$path.$file.'/',
+                    'thumbnail'=>$CFG->pixpath.'/f/folder.gif',
+                    'size'=>0,
+                    'date'=>'',
                     'children'=>array());
             } else {
                 $ret['list'][] = array(
                     'title'=>$file,
+                    'thumbnail' => $CFG->pixpath .'/f/'. mimeinfo("icon", $file),
+                    'size'=>'',
+                    'date'=>'',
                     'source'=>$path.$file);
             }
         }