MDL-33122 repositories: Enable youtube,url and wikimedia repositories by default
authorAnkit Agarwal <ankit@moodle.com>
Mon, 21 May 2012 05:32:02 +0000 (13:32 +0800)
committerAnkit Agarwal <ankit@moodle.com>
Mon, 21 May 2012 05:32:02 +0000 (13:32 +0800)
repository/url/db/install.php [new file with mode: 0644]
repository/wikimedia/db/install.php [new file with mode: 0644]
repository/youtube/db/install.php [new file with mode: 0644]

diff --git a/repository/url/db/install.php b/repository/url/db/install.php
new file mode 100644 (file)
index 0000000..4a431f6
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ *
+ * @package    repository_url
+ * @category   repository
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+
+/**
+ * Create a instance of url repository
+ *
+ * @return bool A status indicating success or failure
+ */
+function xmldb_repository_url_install() {
+    global $CFG;
+    $result = true;
+    require_once($CFG->dirroot.'/repository/lib.php');
+    $url_plugin = new repository_type('url', array(), true);
+    if(!$id = $url_plugin->create(true)) {
+        $result = false;
+    }
+    return $result;
+}
diff --git a/repository/wikimedia/db/install.php b/repository/wikimedia/db/install.php
new file mode 100644 (file)
index 0000000..e1bc22c
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ *
+ * @package    repository_wikimedia
+ * @category   repository
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+
+/**
+ * Create a instance of wikimedia repository
+ *
+ * @return bool A status indicating success or failure
+ */
+function xmldb_repository_wikimedia_install() {
+    global $CFG;
+    $result = true;
+    require_once($CFG->dirroot.'/repository/lib.php');
+    $wikimedia_plugin = new repository_type('wikimedia', array(), true);
+    if(!$id = $wikimedia_plugin->create(true)) {
+        $result = false;
+    }
+    return $result;
+}
diff --git a/repository/youtube/db/install.php b/repository/youtube/db/install.php
new file mode 100644 (file)
index 0000000..47741a0
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ *
+ * @package    repository_youtube
+ * @category   repository
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+
+/**
+ * Create a instance of youtube repository
+ *
+ * @return bool A status indicating success or failure
+ */
+function xmldb_repository_youtube_install() {
+    global $CFG;
+    $result = true;
+    require_once($CFG->dirroot.'/repository/lib.php');
+    $youtube_plugin = new repository_type('youtube', array(), true);
+    if(!$id = $youtube_plugin->create(true)) {
+        $result = false;
+    }
+    return $result;
+}