MDL-30740 skydrive: improve repo metadata
authorDan Poltawski <dan@moodle.com>
Mon, 15 Jul 2013 09:39:26 +0000 (17:39 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 15 Jul 2013 10:08:18 +0000 (18:08 +0800)
* Add manage link
* Use realthumbnail for lazy loading images
* Add image height/width info
* Add author information to files

repository/skydrive/lib.php
repository/skydrive/microsoftliveapi.php

index 0e0d5d7..50b6933 100644 (file)
@@ -95,6 +95,7 @@ class repository_skydrive extends repository {
         $ret = array();
         $ret['dynload'] = true;
         $ret['nosearch'] = true;
+        $ret['manage'] = 'https://skydrive.live.com/';
         $ret['list'] = $this->skydrive->get_file_list($path);
 
         // Generate path bar, always start with the plugin name.
index 673b063..ef5b563 100644 (file)
@@ -182,9 +182,13 @@ class microsoft_skydrive extends oauth2_client {
                         'title' => $file->name,
                         'size' => $file->size,
                         'date' => strtotime($file->updated_time),
-                        'thumbnail' => $file->picture,
+                        'thumbnail' => $OUTPUT->pix_url(file_extension_icon($file->name, 90))->out(false),
+                        'realthumbnail' => $file->picture,
                         'source' => $file->id,
                         'url' => $file->link,
+                        'image_height' => $file->height,
+                        'image_width' => $file->width,
+                        'author' => $file->from->name,
                     );
                     break;
                 case 'video':
@@ -192,9 +196,11 @@ class microsoft_skydrive extends oauth2_client {
                         'title' => $file->name,
                         'size' => $file->size,
                         'date' => strtotime($file->updated_time),
-                        'thumbnail' => $file->picture,
+                        'thumbnail' => $OUTPUT->pix_url(file_extension_icon($file->name, 90))->out(false),
+                        'realthumbnail' => $file->picture,
                         'source' => $file->id,
                         'url' => $file->link,
+                        'author' => $file->from->name,
                     );
                     break;
                 case 'audio':
@@ -205,6 +211,7 @@ class microsoft_skydrive extends oauth2_client {
                         'thumbnail' => $OUTPUT->pix_url(file_extension_icon($file->name, 90))->out(false),
                         'source' => $file->id,
                         'url' => $file->link,
+                        'author' => $file->from->name,
                     );
                     break;
                 case 'file':
@@ -215,6 +222,7 @@ class microsoft_skydrive extends oauth2_client {
                         'thumbnail' => $OUTPUT->pix_url(file_extension_icon($file->name, 90))->out(false),
                         'source' => $file->id,
                         'url' => $file->link,
+                        'author' => $file->from->name,
                     );
                     break;
             }