]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-19181, display plugin instances based on capabilities"
authordongsheng <dongsheng>
Fri, 7 Aug 2009 10:02:47 +0000 (10:02 +0000)
committerdongsheng <dongsheng>
Fri, 7 Aug 2009 10:02:47 +0000 (10:02 +0000)
66 files changed:
lang/en_utf8/repository_alfresco.php
lang/en_utf8/repository_boxnet.php
lang/en_utf8/repository_draft.php
lang/en_utf8/repository_filesystem.php
lang/en_utf8/repository_flickr.php
lang/en_utf8/repository_flickr_public.php
lang/en_utf8/repository_googledocs.php
lang/en_utf8/repository_local.php
lang/en_utf8/repository_mahara.php
lang/en_utf8/repository_picasa.php
lang/en_utf8/repository_remotemoodle.php
lang/en_utf8/repository_s3.php
lang/en_utf8/repository_upload.php
lang/en_utf8/repository_url.php
lang/en_utf8/repository_webdav.php
lang/en_utf8/repository_wikimedia.php
lang/en_utf8/repository_youtube.php
repository/alfresco/db/access.php [new file with mode: 0644]
repository/alfresco/db/upgrade.php [new file with mode: 0644]
repository/alfresco/version.php [new file with mode: 0644]
repository/boxnet/db/access.php [new file with mode: 0644]
repository/boxnet/db/upgrade.php [new file with mode: 0644]
repository/boxnet/version.php [new file with mode: 0755]
repository/draft/db/access.php [new file with mode: 0644]
repository/draft/version.php
repository/filesystem/db/access.php [new file with mode: 0644]
repository/filesystem/db/upgrade.php [new file with mode: 0644]
repository/filesystem/version.php [new file with mode: 0644]
repository/flickr/db/access.php [new file with mode: 0644]
repository/flickr/db/upgrade.php [new file with mode: 0644]
repository/flickr/version.php [new file with mode: 0644]
repository/flickr_public/version.php [new file with mode: 0644]
repository/googledocs/db/access.php [new file with mode: 0644]
repository/googledocs/db/upgrade.php [new file with mode: 0644]
repository/googledocs/version.php [new file with mode: 0644]
repository/lib.php
repository/local/db/access.php [new file with mode: 0644]
repository/local/version.php
repository/mahara/db/access.php [new file with mode: 0644]
repository/mahara/db/upgrade.php [new file with mode: 0644]
repository/mahara/version.php [new file with mode: 0644]
repository/picasa/db/access.php [new file with mode: 0644]
repository/picasa/db/upgrade.php [new file with mode: 0644]
repository/picasa/version.php [new file with mode: 0644]
repository/remotemoodle/db/access.php [new file with mode: 0644]
repository/remotemoodle/db/upgrade.php [new file with mode: 0644]
repository/remotemoodle/version.php [new file with mode: 0644]
repository/s3/db/access.php [new file with mode: 0644]
repository/s3/db/upgrade.php [new file with mode: 0644]
repository/s3/version.php [new file with mode: 0644]
repository/upload/db/access.php [new file with mode: 0644]
repository/upload/repository.class.php
repository/upload/version.php
repository/url/db/access.php [new file with mode: 0644]
repository/url/db/upgrade.php [new file with mode: 0644]
repository/url/version.php
repository/webdav/db/access.php [new file with mode: 0644]
repository/webdav/db/upgrade.php [new file with mode: 0644]
repository/webdav/version.php [new file with mode: 0644]
repository/wikimedia/db/access.php [new file with mode: 0644]
repository/wikimedia/db/upgrade.php [new file with mode: 0644]
repository/wikimedia/version.php [new file with mode: 0644]
repository/youtube/db/access.php [new file with mode: 0644]
repository/youtube/db/upgrade.php [new file with mode: 0644]
repository/youtube/version.php [new file with mode: 0644]
version.php

index a8f2edfc8eff3f755123ecef2621019ac9f1c80b..3dceb88ffd3815f4553e6938b86be61c7b66cc2a 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 $string['alfresco_url'] = 'Alfresco URL';
+$string['alfresco:view'] = 'View alfresco repository';
 $string['alfrescourltext'] = 'Afresco API url should be: http://yoursite.com/alfresco/api';
 $string['configplugin'] = 'Alfresco configuration';
 $string['notitle'] = 'notitle';
index bbc5e734cf2e20317128c4aa35a9d4f5cb1e9f42..4fa9177f24b18af3d91154785f8ac37208b610ef 100644 (file)
@@ -1,7 +1,8 @@
 <?php
 $string['apikey'] = 'API Key';
+$string['boxnet:view'] = 'View box.net repository';
 $string['configplugin'] = 'Box.net configuration';
-$string['information'] = '<div>Get <a href=\"http://enabled.box.net/\">Box.net API Key</a> for your Moodle site. </div>';
+$string['information'] = '<div>Get <a href=\"http://enabled.box.net/my-projects/\">Box.net API Key</a> for your Moodle site. </div>';
 $string['invalidpassword'] = 'Invalid password';
 $stirng['invalidtoken'] = 'Invalid authentication token';
 $string['nullfilelist'] = 'There are no files in this repository';
index 1e3779a81ba60d5b7e8b1cb2f9f896c7160033ef..4f7c631d38db4dfff42bda42e5295faa2be842b7 100644 (file)
@@ -1,3 +1,4 @@
 <?php
 $string['repositoryname'] = 'Current files';
 $string['repositorydesc'] = 'A plug-in for browsing current draft files';
+$string['draft:view'] = 'View draft files in file picker';
index 777060b9f429db489ea96d94f4adad49a4892bbb..44ad7b24a357f24b6aa1bdcbd5b5077401b0c3bc 100644 (file)
@@ -1,10 +1,11 @@
 <?php
 
+$string['blockedpath'] = 'Blocked root path';
 $string['configplugin'] = 'Setup repository on file system';
+$string['donotusesysdir'] = 'Don\'t use system directory as repository, including';
+$string['filesystem:view'] = 'View file system repository';
+$string['information'] = 'This is the relative path against %moodledata%/repository/';
+$string['invalidpath'] = 'Invalid root path';
 $string['repositoryname'] = 'File system';
 $string['repositorydesc'] = 'Create repository from local directory';
 $string['path'] = 'Select a subdirectory';
-$string['information'] = 'This is the relative path against %moodledata%/repository/';
-$string['invalidpath'] = 'Invalid root path';
-$string['blockedpath'] = 'Blocked root path';
-$string['donotusesysdir'] = 'Don\'t use system directory as repository, including';
index cf90a51ca6f27b8229b36fdddc32d89ed37c5145..f6f90e4908c7a17838cf432a4136873ea00f5240 100644 (file)
@@ -10,6 +10,7 @@ $string['callbackwarning'] = '<ol>
 <li>Edit your <a href=\"http://www.flickr.com/services/api/keys/\">Flickr</a> key details again and set the callback URL.</li></ol>';
 $string['configplugin'] = 'Flickr configuration';
 $string['emailaddress'] = 'Email address';
+$string['flickr:view'] = 'View Flickr repository';
 $string['invalidemail'] = 'Invalid email address for flickr';
 $string['notitle'] = 'notitle';
 $string['nullphotolist'] = 'There are no photos in this account';
index d73f54790f3bc95a5db79e3b77eb2400eb0f384c..845fe28126cd8ae71a8d6eb50addc8dca5ff332f 100644 (file)
@@ -14,6 +14,7 @@ $string['commercialuse'] = 'Allow commercial uses of your work?';
 $string['creativecommonscommercial'] = 'Only creative commons commercial';
 $string['emailaddress'] = 'Email address';
 $string['fulltext'] = 'Full text';
+$string['flickr_public:view'] = 'View flickr_public repository';
 $string['information'] = '<div>Get <a href=\"http://www.flickr.com/services/api/keys/\">Flickr API Key</a> for your Moodle site. </div>';
 $string['invalidemail'] = 'Invalid email account for flickr';
 $string['license'] = 'License';
index e6bd104fcad33ff60721f68bec8db6d672397d27..be06825425cd5cc1bc244ded74a5130ef82cb903 100644 (file)
@@ -1,3 +1,4 @@
 <?php
 $string['repositoryname'] = 'Google Docs';
+$string['googledocs:view'] = 'View google docs repository';
 ?>
index 0db9e5d3e152d73cb56d6a95a0e28a060005cabe..dc1422f77f8cdd7e676a0145d8931315b4710de2 100644 (file)
@@ -1,8 +1,9 @@
 <?php // $Id$
+$string['emptyfilelist'] = 'There are no files to show';
 $string['configplugin'] = 'Configuration for local file repository';
 $string['currentusefiles'] = 'Current use files';
+$string['local:view'] = 'View local repository';
 $string['repositoryname'] = 'Local files';
 $string['repositorydesc'] = 'Repository on the local Moodle server';
-$string['notitle'] = 'notitle';
 $string['remember'] = 'Remember me';
-$string['emptyfilelist'] = 'There are no files to show';
+$string['notitle'] = 'notitle';
index 306958b16423506c95736aab3479576fbaca0779..0c3d7008653a3c70253a0960f8722dc85b24e019 100644 (file)
@@ -1,16 +1,17 @@
 <?php // $Id$
 $string['configplugin'] = 'Configuration for Mahara repository';
-$string['repositoryname'] = 'Mahara';
-$string['repositorydesc'] = 'Files on a remote Moodle server';
+$string['connectionfailure'] = 'Failed to retrieve file listing - The host moodle has either a version older than 2.0, either its Mahara Repository service hasn\'t been activated';
+$string['emptyfilelist'] = 'There are no files to show';
+$string['failtoretrievelist'] = 'List could not be retrieved or is empty';
+$string['usercannotaccess'] = 'You ($a) cannot access to this file';
+$string['hostnotfound'] = 'Cannot find the Mahara site into the database - contact your system administrator';
+$string['mahara:view'] = 'View mahara repository';
 $string['notitle'] = 'notitle';
 $string['peer'] = 'Peer';
+$string['nopeer'] = 'Please setup some <a href=\"http://docs.moodle.org/en/admin/mnet/peers#Peer_to_Peer_Network\">Moodle peers</a> for your Mahara site.';
+$string['repositoryname'] = 'Mahara';
+$string['repositorydesc'] = 'Files on a remote Moodle server';
 $string['remember'] = 'Remember me';
-$string['emptyfilelist'] = 'There are no files to show';
 $string['remoterep_name'] = 'Mahara';
 $string['remoterep_description'] = 'Allow the service to be discovered';
-$string['connectionfailure'] = 'Failed to retrieve file listing - The host moodle has either a version older than 2.0, either its Mahara Repository service hasn\'t been activated';
-$string['failtoretrievelist'] = 'List could not be retrieved or is empty';
 $string['usernotfound'] = 'The user $a is not registered into the Mahara';
-$string['usercannotaccess'] = 'You ($a) cannot access to this file';
-$string['nopeer'] = 'Please setup some <a href=\"http://docs.moodle.org/en/admin/mnet/peers#Peer_to_Peer_Network\">Moodle peers</a> for your Mahara site.';
-$string['hostnotfound'] = 'Cannot find the Mahara site into the database - contact your system administrator';
index f69f84481bc34e98aebed85ed3c8175fa72cf680..a3f91fc47470d28ea79f890f41b318a2329624ed 100644 (file)
@@ -1,3 +1,4 @@
 <?php
+$string['picasa:view'] = 'View picasa repository';
 $string['repositoryname'] = 'Picasa web album';
 ?>
index 26c937aedd3349cd592029e5c1355f115ca5630d..f5349a20cd1f2392c3ce7c6399bffe43acd517cc 100644 (file)
@@ -1,16 +1,17 @@
 <?php // $Id$
 $string['configplugin'] = 'Configuration for remote Moodle file repository';
-$string['repositoryname'] = 'Remote Moodle site';
-$string['repositorydesc'] = 'Files on a remote Moodle server';
+$string['connectionfailure'] = 'Failed to retrieve file listing - The host moodle has either a version older than 2.0, either its Moodle Remote Repository service hasn\'t been activated';
+$string['emptyfilelist'] = 'There are no files to show';
+$string['failtoretrievelist'] = 'List could not be retrieved or is empty';
 $string['notitle'] = 'notitle';
+$string['hostnotfound'] = 'Cannot find the remote Moodle into the database - contact your system administrator';
+$string['nopeer'] = 'Please setup some <a href=\"http://docs.moodle.org/en/admin/mnet/peers#Peer_to_Peer_Network\">Moodle peers</a> for your Moodle site.';
 $string['peer'] = 'Peer';
+$string['repositoryname'] = 'Remote Moodle site';
+$string['repositorydesc'] = 'Files on a remote Moodle server';
 $string['remember'] = 'Remember me';
-$string['emptyfilelist'] = 'There are no files to show';
+$string['remotemoodle:view'] = 'View remote moodle repository';
 $string['remoterep_name'] = 'Remote Moodle site';
 $string['remoterep_description'] = 'Allow the service to be discovered';
-$string['connectionfailure'] = 'Failed to retrieve file listing - The host moodle has either a version older than 2.0, either its Moodle Remote Repository service hasn\'t been activated';
-$string['failtoretrievelist'] = 'List could not be retrieved or is empty';
 $string['usernotfound'] = 'The user $a is not registered into the remote Moodle';
 $string['usercannotaccess'] = 'You ($a) cannot access to this file';
-$string['nopeer'] = 'Please setup some <a href=\"http://docs.moodle.org/en/admin/mnet/peers#Peer_to_Peer_Network\">Moodle peers</a> for your Moodle site.';
-$string['hostnotfound'] = 'Cannot find the remote Moodle into the database - contact your system administrator';
index 663a6127a34129ed6c48615c8fe2dc1ea8fd9dc4..800997876d494a47cc94e2832ef4a7ef2f1bbb46 100644 (file)
@@ -1,7 +1,8 @@
 <?php // $Id$
-$string['repositoryname'] = 'Amazon S3';
-$string['configplugin'] = 'Amazon S3 settings';
 $string['access_key'] = 'Access key';
+$string['configplugin'] = 'Amazon S3 settings';
+$string['s3:view'] = 'View amazon s3 repository';
 $string['secret_key'] = 'Secret key';
 $string['needaccesskey'] = 'Access key must be provided';
+$string['repositoryname'] = 'Amazon S3';
 
index 2c8456d9562426c9fce57fb1a1410da09a85a430..864825cbbf8e3d32aa34530789acc7ae20d2a80b 100644 (file)
@@ -1,4 +1,5 @@
 <?php // $Id$
 $string['configplugin'] = 'Configuration for upload plugin';
+$string['upload:view'] = 'Use uploading in file picker';
 $string['repositoryname'] = 'Upload a file';
 $string['repositorydesc'] = 'Upload a file to Moodle';
index f5cf550e527fe10a80e2210314fd9518f94ecd95..3ea4b1615a7679c69b7964b9cb002a6f2fa42165 100644 (file)
@@ -1,6 +1,7 @@
 <?php // $Id$
-$string['repositoryname'] = 'URL Downloader';
+$string['download'] = 'Download';
 $string['url'] = 'URL';
+$string['url:view'] = 'Use url downloader in file picker';
 $string['rename'] = 'Name';
-$string['download'] = 'Download';
+$string['repositoryname'] = 'URL Downloader';
 $string['validname'] = 'You must provide a valid file name';
index 115d38b23d890c915e3c4c47f9688b2cf5020280..0283f7f3193f27d25fccd3499916d504c6b1a698 100644 (file)
@@ -1,10 +1,11 @@
 <?php
-$string['repositoryname'] = 'WebDAV repository';
 $string['configplugin'] = 'WebDav configuration';
+$string['http'] = 'HTTP';
+$string['https'] = 'HTTPS';
+$string['repositoryname'] = 'WebDAV repository';
+$string['webdav:view'] = 'View WebDav repository';
 $string['webdav_type'] = 'WebDav type';
 $string['webdav_server'] = 'WebDAV server';
 $string['webdav_port'] = 'WebDAV server port';
 $string['webdav_user'] = 'WebDAV server user';
 $string['webdav_password'] = 'WebDAV server password';
-$string['http'] = 'HTTP';
-$string['https'] = 'HTTPS';
index 4823b97a98e1e00e2ca95e97caff24c9b234bfe1..e7f2a0e2b10bf7c1d445fed7cbe03cbc5ba2920e 100644 (file)
@@ -1,3 +1,4 @@
 <?php
-$string['repositoryname'] = 'Wikimedia';
 $string['keyword'] = 'Image name';
+$string['repositoryname'] = 'Wikimedia';
+$string['wikimedia:view'] = 'View wikimedia repository';
index 25ce0ac5ebce4e76cf822f6bcd4d4825fd478d47..ab9c30a179f0a6f8abae90663d955f7fcc02b7b3 100644 (file)
@@ -1,3 +1,4 @@
 <?php
-$string['repositoryname'] = 'Youtube videos';
+$string['youtube:view'] = 'Use youtube in file picker';
 $string['search'] = 'Search videos';
+$string['repositoryname'] = 'Youtube videos';
diff --git a/repository/alfresco/db/access.php b/repository/alfresco/db/access.php
new file mode 100644 (file)
index 0000000..a3dc399
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_alfresco_capabilities = array(
+
+    'repository/alfresco:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/alfresco/db/upgrade.php b/repository/alfresco/db/upgrade.php
new file mode 100644 (file)
index 0000000..b037b20
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_alfresco_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/alfresco/version.php b/repository/alfresco/version.php
new file mode 100644 (file)
index 0000000..6955b54
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 20090080101;
diff --git a/repository/boxnet/db/access.php b/repository/boxnet/db/access.php
new file mode 100644 (file)
index 0000000..234c112
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_boxnet_capabilities = array(
+
+    'repository/boxnet:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/boxnet/db/upgrade.php b/repository/boxnet/db/upgrade.php
new file mode 100644 (file)
index 0000000..2a8b38b
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_boxnet_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/boxnet/version.php b/repository/boxnet/version.php
new file mode 100755 (executable)
index 0000000..0856417
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080104;
diff --git a/repository/draft/db/access.php b/repository/draft/db/access.php
new file mode 100644 (file)
index 0000000..ca26bc1
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_draft_capabilities = array(
+
+    'repository/draft:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
index 0b633c373f57bfbe78954bbb509a2ad848fdb415..868025bd14c4e3da815785be929bb48dda5c4ec8 100755 (executable)
@@ -1,2 +1,2 @@
 <?php
-$plugin->version = 2009062000;
+$plugin->version = 2009080101;
diff --git a/repository/filesystem/db/access.php b/repository/filesystem/db/access.php
new file mode 100644 (file)
index 0000000..05009b4
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_filesystem_capabilities = array(
+
+    'repository/filesystem:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/filesystem/db/upgrade.php b/repository/filesystem/db/upgrade.php
new file mode 100644 (file)
index 0000000..9e762f3
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_filesystem_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/filesystem/version.php b/repository/filesystem/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
diff --git a/repository/flickr/db/access.php b/repository/flickr/db/access.php
new file mode 100644 (file)
index 0000000..3d4e30c
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_flickr_capabilities = array(
+
+    'repository/flickr:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/flickr/db/upgrade.php b/repository/flickr/db/upgrade.php
new file mode 100644 (file)
index 0000000..6ad451c
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_flickr_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/flickr/version.php b/repository/flickr/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
diff --git a/repository/flickr_public/version.php b/repository/flickr_public/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
diff --git a/repository/googledocs/db/access.php b/repository/googledocs/db/access.php
new file mode 100644 (file)
index 0000000..eb17fc0
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_googledocs_capabilities = array(
+
+    'repository/googledocs:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/googledocs/db/upgrade.php b/repository/googledocs/db/upgrade.php
new file mode 100644 (file)
index 0000000..842760b
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_googledocs_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/googledocs/version.php b/repository/googledocs/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
index d5554923d151565ecab45d171debc6dc7af6f344..8b4004a028645fdd98f335eba807caef44c72f89 100644 (file)
@@ -623,6 +623,7 @@ abstract class repository {
             $is_supported = true;
 
             $repository = new $classname($repo->id, $repo->contextid, $options, $repo->readonly);
+            $context = get_context_instance_by_id(CONTEXT_SYSTEM, $repo->contextid);
             if (empty($repository->super_called)) {
                 debugging('parent::__construct must be called by '.$repo->repositorytype.' plugin.');
             } else {
@@ -645,7 +646,8 @@ abstract class repository {
                 if (!$onlyvisible || ($repository->is_visible() && !$repository->disabled)) {
                     // super_called will make sure the parent construct function is called
                     // by repository construct function
-                    if ($is_supported) {
+                    $capability = has_capability('repository/'.$repo->repositorytype.':view', $context, $USER->id, false);
+                    if ($is_supported && $capability) {
                         $ret[] = $repository;
                     }
                 }
diff --git a/repository/local/db/access.php b/repository/local/db/access.php
new file mode 100644 (file)
index 0000000..c64bac4
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_local_capabilities = array(
+
+    'repository/local:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
index 5ef0c2c4300f72704251f89e680803acb20987d6..868025bd14c4e3da815785be929bb48dda5c4ec8 100644 (file)
@@ -1,2 +1,2 @@
 <?php
-$plugin->version = 2009052000;
+$plugin->version = 2009080101;
diff --git a/repository/mahara/db/access.php b/repository/mahara/db/access.php
new file mode 100644 (file)
index 0000000..2860614
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_mahara_capabilities = array(
+
+    'repository/mahara:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/mahara/db/upgrade.php b/repository/mahara/db/upgrade.php
new file mode 100644 (file)
index 0000000..b85cd22
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_mahara_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/mahara/version.php b/repository/mahara/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
diff --git a/repository/picasa/db/access.php b/repository/picasa/db/access.php
new file mode 100644 (file)
index 0000000..7251244
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_picasa_capabilities = array(
+
+    'repository/picasa:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/picasa/db/upgrade.php b/repository/picasa/db/upgrade.php
new file mode 100644 (file)
index 0000000..7b3d54c
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_picasa_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/picasa/version.php b/repository/picasa/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
diff --git a/repository/remotemoodle/db/access.php b/repository/remotemoodle/db/access.php
new file mode 100644 (file)
index 0000000..72cf42c
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_remotemoodle_capabilities = array(
+
+    'repository/remotemoodle:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/remotemoodle/db/upgrade.php b/repository/remotemoodle/db/upgrade.php
new file mode 100644 (file)
index 0000000..7dc6808
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_remotemoodle_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/remotemoodle/version.php b/repository/remotemoodle/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
diff --git a/repository/s3/db/access.php b/repository/s3/db/access.php
new file mode 100644 (file)
index 0000000..8b816b0
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_s3_capabilities = array(
+
+    'repository/s3:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/s3/db/upgrade.php b/repository/s3/db/upgrade.php
new file mode 100644 (file)
index 0000000..cc2193e
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_s3_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/s3/version.php b/repository/s3/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
diff --git a/repository/upload/db/access.php b/repository/upload/db/access.php
new file mode 100644 (file)
index 0000000..e14d8ae
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_upload_capabilities = array(
+
+    'repository/upload:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
index cf2a52df6f99486fd32a33df7eceeea2f1a60498..b4941c4a70f11e8b8ca703a09284d38d8dcdf43f 100755 (executable)
@@ -69,7 +69,7 @@ class repository_upload extends repository {
      * @return string
      */
     public function get_name(){
-        return get_string('repositoryname', 'repository_upload');;
+        return get_string('repositoryname', 'repository_upload');
     }
 }
 ?>
index bcba2404ed89042f48d2536f2534e09524e06788..868025bd14c4e3da815785be929bb48dda5c4ec8 100644 (file)
@@ -1,2 +1,2 @@
 <?php
-$plugin->version = 2009031000;
+$plugin->version = 2009080101;
diff --git a/repository/url/db/access.php b/repository/url/db/access.php
new file mode 100644 (file)
index 0000000..ef2f4e9
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_url_capabilities = array(
+
+    'repository/url:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/url/db/upgrade.php b/repository/url/db/upgrade.php
new file mode 100644 (file)
index 0000000..021f9bf
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_url_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
index b5721016d8cf211b4ab38e2b802dad0e6ad4b2cd..868025bd14c4e3da815785be929bb48dda5c4ec8 100644 (file)
@@ -1,2 +1,2 @@
 <?php
-$plugin->version = 2009051800;
+$plugin->version = 2009080101;
diff --git a/repository/webdav/db/access.php b/repository/webdav/db/access.php
new file mode 100644 (file)
index 0000000..56ec3be
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_webdav_capabilities = array(
+
+    'repository/webdav:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/webdav/db/upgrade.php b/repository/webdav/db/upgrade.php
new file mode 100644 (file)
index 0000000..e402c88
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_webdav_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/webdav/version.php b/repository/webdav/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
diff --git a/repository/wikimedia/db/access.php b/repository/wikimedia/db/access.php
new file mode 100644 (file)
index 0000000..901b138
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_wikimedia_capabilities = array(
+
+    'repository/wikimedia:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/wikimedia/db/upgrade.php b/repository/wikimedia/db/upgrade.php
new file mode 100644 (file)
index 0000000..60302a5
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_wikimedia_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/wikimedia/version.php b/repository/wikimedia/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
diff --git a/repository/youtube/db/access.php b/repository/youtube/db/access.php
new file mode 100644 (file)
index 0000000..8fca221
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+$repository_youtube_capabilities = array(
+
+    'repository/youtube:view' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    )
+);
diff --git a/repository/youtube/db/upgrade.php b/repository/youtube/db/upgrade.php
new file mode 100644 (file)
index 0000000..7380860
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+function xmldb_repository_youtube_upgrade($oldversion) {
+
+    global $CFG, $DB;
+
+    $dbman = $DB->get_manager();
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need one
+/// block of code similar to the next one. Please, delete
+/// this comment lines once this file start handling proper
+/// upgrade code.
+
+/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
+///     $result = result of database_manager methods
+/// }
+
+    return $result;
+}
diff --git a/repository/youtube/version.php b/repository/youtube/version.php
new file mode 100644 (file)
index 0000000..868025b
--- /dev/null
@@ -0,0 +1,2 @@
+<?php
+$plugin->version = 2009080101;
index 4d8eca7e1c3423426dbcafb92ccff06d95cad23b..162d2f3cede06783da1813bd4bdedabc43d8372f 100644 (file)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-    $version = 2009073101;  // YYYYMMDD   = date of the last version bump
+    $version = 2009080700;  // YYYYMMDD   = date of the last version bump
                             //         XX = daily increments
 
     $release = '2.0 dev (Build: 20090807)';  // Human-friendly version name