Browse files

MDL-33122 repositories: Enable youtube,url and wikimedia repositories…

… by default
  • Loading branch information...
1 parent 4f7f2a8 commit 55e25598e767a50b58d8e44fb202cda78117fc2c @ankitagarwal ankitagarwal committed May 21, 2012
Showing with 120 additions and 0 deletions.
  1. +40 −0 repository/url/db/install.php
  2. +40 −0 repository/wikimedia/db/install.php
  3. +40 −0 repository/youtube/db/install.php
View
40 repository/url/db/install.php
@@ -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;
+}
View
40 repository/wikimedia/db/install.php
@@ -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;
+}
View
40 repository/youtube/db/install.php
@@ -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;
+}

0 comments on commit 55e2559

Please sign in to comment.