MDL-13766, stop using shorttitle in repository plugin
authorDongsheng Cai <unoter@gmail.com>
Thu, 9 Sep 2010 07:36:20 +0000 (07:36 +0000)
committerDongsheng Cai <unoter@gmail.com>
Thu, 9 Sep 2010 07:36:20 +0000 (07:36 +0000)
repository/coursefiles/lib.php
repository/local/lib.php
repository/recent/lib.php

index 858f7ea..9429378 100755 (executable)
@@ -91,14 +91,12 @@ class repository_coursefiles extends repository {
             // build file tree
             $children = $fileinfo->get_children();
             foreach ($children as $child) {
-                $shorttitle = $this->get_short_filename($child->get_visible_name(), 12);
                 if ($child->is_directory()) {
                     $params = $child->get_params();
                     $subdir_children = $child->get_children();
                     $encodedpath = base64_encode(serialize($params));
                     $node = array(
                         'title' => $child->get_visible_name(),
-                        'shorttitle'=>$shorttitle,
                         'size' => 0,
                         'date' => '',
                         'path' => $encodedpath,
@@ -110,7 +108,6 @@ class repository_coursefiles extends repository {
                     $encodedpath = base64_encode(serialize($child->get_params()));
                     $node = array(
                         'title' => $child->get_visible_name(),
-                        'shorttitle'=>$shorttitle,
                         'size' => 0,
                         'date' => '',
                         'source'=> $encodedpath,
index 0448823..478ba2b 100755 (executable)
@@ -94,7 +94,6 @@ class repository_local extends repository {
             // build file tree
             $children = $fileinfo->get_children();
             foreach ($children as $child) {
-                $shorttitle = $this->get_short_filename($child->get_visible_name(), 12);
                 if ($child->is_directory()) {
                     $params = $child->get_params();
                     $subdir_children = $child->get_children();
@@ -109,7 +108,6 @@ class repository_local extends repository {
                     //}
                     $node = array(
                         'title' => $child->get_visible_name(),
-                        'shorttitle'=>$shorttitle,
                         'size' => 0,
                         'date' => '',
                         'path' => $encodedpath,
@@ -121,7 +119,6 @@ class repository_local extends repository {
                     $encodedpath = base64_encode(serialize($child->get_params()));
                     $node = array(
                         'title' => $child->get_visible_name(),
-                        'shorttitle'=>$shorttitle,
                         'size' => 0,
                         'date' => '',
                         'source'=> $encodedpath,
@@ -204,4 +201,7 @@ class repository_local extends repository {
 
         return $info;
     }
+    function get_file_count($contextid) {
+        global $DB;
+    }
 }
index 41eb445..6d9df31 100755 (executable)
@@ -100,7 +100,6 @@ class repository_recent extends repository {
                 $params = base64_encode(serialize($file));
                 $node = array(
                     'title' => $file['filename'],
-                    'shorttitle' => $this->get_short_filename($file['filename'], 12),
                     'size' => 0,
                     'date' => '',
                     'source'=> $params,