Skip to content

Commit

Permalink
"REPOSITORY, UPGRADE/MDL-18354, upgrade/install repository plugins us…
Browse files Browse the repository at this point in the history
…ing moodle hook"
  • Loading branch information
dongsheng committed Mar 10, 2009
1 parent f13ffcd commit 8763ab7
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function get_plugin_types() {
'coursereport' => 'course/report',
'report' => $CFG->admin.'/report',
'portfolio' => 'portfolio/type',
'repository' => 'repository',

// following types a very ugly hacks - we should not make exceptions like this - all plugins should be equal;
// these plugins may cause problems such as when wanting to uninstall them
Expand Down
1 change: 1 addition & 0 deletions repository/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1831,4 +1831,5 @@ function repository_setup_default_plugins() {
if (is_int($local_plugin_id) or is_int($upload_plugin_id)) {
print_box(get_string('setupdefaultplugins', 'repository'));
}
return true;
}
12 changes: 12 additions & 0 deletions repository/local/db/install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

function xmldb_repository_local_install() {
global $CFG;
$result = true;
require_once($CFG->dirroot.'/repository/lib.php');
$local_plugin = new repository_type('local', array(), true);
if(!$id = $local_plugin->create(true)) {
$result = false;
}
return $result;
}
9 changes: 9 additions & 0 deletions repository/local/db/upgrade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
function xmldb_repository_local_upgrade($oldversion) {
$result = true;
/**
if ($result && $oldversion < 2009031000) {
}
*/
return $result;
}
2 changes: 2 additions & 0 deletions repository/local/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
$plugin->version = 2009031000;
12 changes: 12 additions & 0 deletions repository/upload/db/install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

function xmldb_repository_upload_install() {
global $CFG;
$result = true;
require_once($CFG->dirroot.'/repository/lib.php');
$upload_plugin = new repository_type('upload', array(), true);
if (!$id = $upload_plugin->create(true)) {
$result = false;
}
return $result;
}
9 changes: 9 additions & 0 deletions repository/upload/db/upgrade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
function xmldb_repository_upload_upgrade($oldversion) {
$result = true;
/**
if ($result && $oldversion < 2009031000) {
}
*/
return $result;
}
2 changes: 2 additions & 0 deletions repository/upload/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
$plugin->version = 2009031000;

0 comments on commit 8763ab7

Please sign in to comment.