diff --git a/blocks/admin/block_admin.php b/blocks/admin/block_admin.php
deleted file mode 100644
index c616d1e87fa..00000000000
--- a/blocks/admin/block_admin.php
+++ /dev/null
@@ -1,225 +0,0 @@
-title = get_string('pluginname', 'block_admin');
- $this->version = 2007101509;
- }
-
- function get_content() {
- global $CFG, $USER, $DB, $OUTPUT;
-
- if ($this->content !== NULL) {
- return $this->content;
- }
-
- $this->content = new stdClass;
- $this->content->items = array();
- $this->content->icons = array();
- $this->content->footer = '';
-
- $course = $this->page->course;
-
- if (empty($CFG->loginhttps)) {
- $securewwwroot = $CFG->wwwroot;
- } else {
- $securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
- }
-
- $isenrolled = is_enrolled($this->page->context);
- $isviewing = is_viewing($this->page->context);
-
- /// Course editing on/off
- if ($course->id !== SITEID and has_capability('moodle/course:update', $this->page->context)) {
- $this->content->icons[]='';
- if ($this->page->user_is_editing()) {
- $this->content->items[]=''.get_string('turneditingoff').'';
- } else {
- $this->content->items[]=''.get_string('turneditingon').'';
- }
-
- $this->content->items[]=''.get_string('settings').'';
- $this->content->icons[]='
';
- }
-
- /// Assign roles to the course
- if ($course->id != SITEID) {
- if (has_capability('moodle/role:assign', $this->page->context)) {
- $this->content->items[]=''.get_string('assignroles', 'role').'';
- $this->content->icons[]='
';
- } else if (get_overridable_roles($this->page->context, ROLENAME_ORIGINAL)) {
- $this->content->items[]=''.get_string('overridepermissions', 'role').'';
- $this->content->icons[]='
';
- }
- }
-
- /// View course grades (or just your own grades, same link)
- /// find all accessible reports
- if ($course->id !== SITEID and ($isenrolled or $isviewing)) {
- $reportavailable = false;
- if (has_capability('moodle/grade:viewall', $this->page->context)) {
- $reportavailable = true;
- } else if (!empty($course->showgrades)) {
- if ($reports = get_plugin_list('gradereport')) { // Get all installed reports
- arsort($reports); // user is last, we want to test it first
- foreach ($reports as $plugin => $plugindir) {
- if (has_capability('gradereport/'.$plugin.':view', $this->page->context)) {
- //stop when the first visible plugin is found
- $reportavailable = true;
- break;
- }
- }
- }
- }
-
- if ($reportavailable) {
- $this->content->items[]=''.get_string('grades').'';
- $this->content->icons[]='
';
- }
- }
-
- /// Course outcomes (to help give it more prominence because it's important)
- if (!empty($CFG->enableoutcomes)) {
- if ($course->id!==SITEID and has_capability('moodle/course:update', $this->page->context)) {
- $this->content->items[]=''.get_string('outcomes', 'grades').'';
- $this->content->icons[]='
';
- }
- }
-
- /// Manage metacourses
- if ($course->metacourse) {
- if (has_capability('moodle/course:managemetacourse', $this->page->context)) {
- $strchildcourses = get_string('childcourses');
- $this->content->items[]=''.$strchildcourses.'';
- $this->content->icons[]='
';
- } else if (has_capability('moodle/role:assign', $this->page->context)) {
- $strchildcourses = get_string('childcourses');
- $this->content->items[]=''.$strchildcourses.'';
- $this->content->icons[]='
';
- }
- }
-
-
- /// Manage groups in this course
- if (($course->id!==SITEID) && ($course->groupmode || !$course->groupmodeforce) && has_capability('moodle/course:managegroups', $this->page->context)) {
- $strgroups = get_string('groups');
- $this->content->items[]=''.$strgroups.'';
- $this->content->icons[]='
';
- }
-
- /// Backup this course
- if ($course->id!==SITEID and has_capability('moodle/backup:backupcourse', $this->page->context)) {
- $this->content->items[]=''.get_string('backup').'';
- $this->content->icons[]='
';
- }
-
- /// Restore to this course
- if ($course->id !== SITEID and has_capability('moodle/restore:restorecourse', $this->page->context)) {
- $this->content->items[]=''.get_string('restore').'';
- $this->content->icons[]='
';
- }
-
- /// Import data from other courses
- if ($course->id !== SITEID and has_capability('moodle/restore:restoretargetimport', $this->page->context)) {
- $this->content->items[]=''.get_string('import').'';
- $this->content->icons[]='
';
- }
-
- /// Reset this course
- if ($course->id!==SITEID and has_capability('moodle/course:reset', $this->page->context)) {
- $this->content->items[]=''.get_string('reset').'';
- $this->content->icons[]='
';
- }
-
- /// View course reports
- if ($course->id !== SITEID and has_capability('moodle/site:viewreports', $this->page->context)) { // basic capability for listing of reports
- $this->content->items[]=''.get_string('reports').'';
- $this->content->icons[]='
';
- }
-
- /// Manage questions
- if ($course->id !== SITEID){
- $questionlink = '';
- $questioncaps = array(
- 'moodle/question:add',
- 'moodle/question:editmine',
- 'moodle/question:editall',
- 'moodle/question:viewmine',
- 'moodle/question:viewall',
- 'moodle/question:movemine',
- 'moodle/question:moveall');
- foreach ($questioncaps as $questioncap){
- if (has_capability($questioncap, $this->page->context)){
- $questionlink = 'edit.php';
- break;
- }
- }
- if (!$questionlink && has_capability('moodle/question:managecategory', $this->page->context)) {
- $questionlink = 'category.php';
- }
- if ($questionlink) {
- $this->content->items[]=''.get_string('questions', 'quiz').'';
- $this->content->icons[]='
';
- }
- }
-
- /// Repository Instances
- require_once($CFG->dirroot.'/repository/lib.php');
- $editabletypes = repository::get_editable_types($this->page->context);
- if ($course->id !== SITEID && has_capability('moodle/course:update', $this->page->context) && !empty($editabletypes)) {
- $this->content->items[]=''.get_string('repositories').'';
- $this->content->icons[]='
';
- }
-
- /// Manage files
- if ($course->id !== SITEID and has_capability('moodle/course:managefiles', $this->page->context)) {
- $this->content->items[]=''.get_string('files').'';
- $this->content->icons[]='
';
- }
-
- /// Authorize hooks
- if ($course->enrol == 'authorize' || (empty($course->enrol) && $CFG->enrol == 'authorize') && ($course->id!==SITEID)) {
- require_once($CFG->dirroot.'/enrol/authorize/const.php');
- $paymenturl = ''.get_string('payments').' ';
- if (has_capability('enrol/authorize:managepayments', $this->page->context)) {
- if ($cnt = $DB->count_records('enrol_authorize', array('status'=>AN_STATUS_AUTH, 'courseid'=>$course->id))) {
- $paymenturl .= ''.get_string('paymentpending', 'moodle', $cnt).'';
- }
- }
- $this->content->items[] = $paymenturl;
- $this->content->icons[] = '
';
- }
-
- /// Unenrol link
- if (empty($course->metacourse) && ($course->id!==SITEID)) {
- if ($isenrolled) {
- if (has_capability('moodle/role:unassignself', $this->page->context, NULL, false) and get_user_roles($this->page->context, $USER->id, false)) { // Have some role
- $this->content->items[]=''.get_string('unenrolme', '', format_string($course->shortname)).'';
- $this->content->icons[]='
';
- }
-
- } else if ($isviewing) {
- // inspector, manager, etc. - do not show anything
- } else {
- // access because otherwise they would not get into this course at all
- $this->content->items[]=''.get_string('enrolme', '', format_string($course->shortname)).'';
- $this->content->icons[]='
';
- }
- }
-
- /// Link to the user own profile if they are enrolled
- if ($isenrolled) {
- $this->content->items[]=''.get_string('profile').'';
- $this->content->icons[]='
';
- }
-
- return $this->content;
- }
-
- function applicable_formats() {
- return array('course' => true); // Not needed on site
- }
-}
-
-
diff --git a/blocks/admin/db/upgrade.php b/blocks/admin/db/upgrade.php
deleted file mode 100644
index fe6782ca3ba..00000000000
--- a/blocks/admin/db/upgrade.php
+++ /dev/null
@@ -1,41 +0,0 @@
-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/blocks/admin/lang/en/block_admin.php b/blocks/admin/lang/en/block_admin.php
deleted file mode 100644
index af9e7e452a6..00000000000
--- a/blocks/admin/lang/en/block_admin.php
+++ /dev/null
@@ -1,26 +0,0 @@
-.
-
-/**
- * Strings for component 'block_admin', language 'en', branch 'MOODLE_20_STABLE'
- *
- * @package block_admin
- * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-$string['pluginname'] = 'Administration';
diff --git a/blocks/admin_tree/admintree.js b/blocks/admin_tree/admintree.js
deleted file mode 100644
index b73304e2a46..00000000000
--- a/blocks/admin_tree/admintree.js
+++ /dev/null
@@ -1,75 +0,0 @@
-admin_tree = {
- numdivs: null,
- hiddennodes: null,
- closedimg: null,
- openimg: null,
- closedalt: null,
- openalt: null,
-
- init: function(numdivs, expandnodes, openimg, closedimg, openalt, closedalt) {
- // Store the information we were passed in.
- admin_tree.openimg = openimg;
- admin_tree.closedimg = closedimg;
- admin_tree.openalt = openalt;
- admin_tree.closedalt = closedalt;
- admin_tree.numdivs = numdivs;
-
- // Initialise the hiddennodes array.
- admin_tree.hiddennodes = new Array();
- for (var i = 1; i <= admin_tree.numdivs; i++) {
- admin_tree.hiddennodes[i] = null;
- }
-
- // Collapse everything while adding the event handlers.
- for (var i = admin_tree.numdivs; i > 0; i--) {
- admin_tree.collapse(i);
- var togglelink = document.getElementById("vh_div" + i + "indicator").parentNode;
- togglelink.href = '#';
- YAHOO.util.Event.addListener(togglelink, 'click', admin_tree.toggle, i);
- }
-
- // Re-expand the bits we want expanded.
- for (var i = 0; i < expandnodes.length; i++) {
- admin_tree.expand(expandnodes[i]);
- }
- },
-
- toggle: function(e, i) {
- if (admin_tree.hiddennodes[i] === null) {
- admin_tree.collapse(i);
- } else {
- admin_tree.expand(i);
- }
- YAHOO.util.Event.preventDefault(e);
- },
-
- collapse: function(i) {
- if (admin_tree.hiddennodes[i] !== null) {
- return;
- }
- var obj = document.getElementById("vh_div" + i);
- if (obj === null) {
- return;
- }
- var nothing = document.createElement("span");
- nothing.setAttribute("id", "vh_div" + i);
- admin_tree.hiddennodes[i] = obj;
- obj.parentNode.replaceChild(nothing, obj);
- var icon = document.getElementById("vh_div" + i + "indicator");
- icon.src = admin_tree.closedimg;
- icon.alt = admin_tree.closedalt;
- },
-
- expand: function(i) {
- if (admin_tree.hiddennodes[i] === null) {
- return;
- }
- var nothing = document.getElementById("vh_div" + i);
- var obj = admin_tree.hiddennodes[i];
- admin_tree.hiddennodes[i] = null;
- nothing.parentNode.replaceChild(obj, nothing);
- var icon = document.getElementById("vh_div" + i + "indicator");
- icon.src = admin_tree.openimg;
- icon.alt = admin_tree.openalt;
- }
-};
diff --git a/blocks/admin_tree/block_admin_tree.php b/blocks/admin_tree/block_admin_tree.php
deleted file mode 100644
index b779bca1085..00000000000
--- a/blocks/admin_tree/block_admin_tree.php
+++ /dev/null
@@ -1,170 +0,0 @@
-title = get_string('pluginname', 'block_admin_tree');
- $this->version = 2007101509;
- $this->currentdepth = 0;
- $this->divcounter = 1;
- $this->tempcontent = '';
- }
-
- function applicable_formats() {
- if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
- return array('site' => true, 'admin' => true, 'my' => true);
- } else {
- return array('site' => true, 'admin' => true);
- }
- }
-
- function preferred_width() {
- return 210;
- }
-
- function open_folder($visiblename) {
- global $OUTPUT;
- $strfolderopened = s(get_string('folderopened'));
-
- $this->tempcontent .= '