--- /dev/null
+<?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/>.
+
+/**
+ * Post installation and migration code.
+ *
+ * @package tool
+ * @subpackage unsuproles
+ * @copyright 2011 Petr Skoda {@link http://skodak.org}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die;
+
+function xmldb_tool_unsuproles_install() {
+ global $CFG;
+
+ // this is a hack - this plugin used to live in admin/report/unsuproles,
+ // we want to remove the orphaned version info unless there is a new
+ // report type with the same name
+
+ if (!file_exists("$CFG->dirroot/report/report_unsuproles")) {
+ unset_all_config_for_plugin('report_unsuproles');
+ }
+}
<?php
-
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
* Report of unsupported role assignments,
* unsupported role assignments can be dropped from here.
*
- * @package report
+ * @package tool
* @subpackage unsuproles
* @copyright 2010 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__).'/../../../config.php');
+require_once(dirname(__FILE__) . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
$action = optional_param('action', '', PARAM_ACTION);
$syscontext = get_context_instance(CONTEXT_SYSTEM);
require_login();
-admin_externalpage_setup('reportunsuproles'); // checks permissions specified in settings.php
+admin_externalpage_setup('toolunsuproles'); // checks permissions specified in settings.php
if ($action === 'delete') {
$contextlevel = required_param('contextlevel', PARAM_INT);
$yesurl = new moodle_url($PAGE->url, array('roleid'=>$roleid, 'contextlevel'=>$contextlevel, 'action'=>'delete', 'confirm'=>1, 'sesskey'=>sesskey()));
$levelname = get_contextlevel_name($contextlevel);
$rolename = format_string($role->name);
- $message = get_string('confirmdelete', 'report_unsuproles', array('level'=>$levelname, 'role'=>$rolename));
+ $message = get_string('confirmdelete', 'tool_unsuproles', array('level'=>$levelname, 'role'=>$rolename));
echo $OUTPUT->confirm($message, $yesurl, $PAGE->url);
echo $OUTPUT->footer();
die();
echo $OUTPUT->header();
-echo $OUTPUT->heading(get_string('pluginname', 'report_unsuproles'));
+echo $OUTPUT->heading(get_string('pluginname', 'tool_unsuproles'));
$sql = "SELECT r.id AS roleid, c.contextlevel, r.sortorder, COUNT(ra.id) AS racount
FROM {role} r
$rs->close();
if (!$problems) {
- echo $OUTPUT->notification(get_string('noprolbems', 'report_unsuproles'), 'notifysuccess');
+ echo $OUTPUT->notification(get_string('noprolbems', 'tool_unsuproles'), 'notifysuccess');
} else {
$roles = get_all_roles();
$data = array();
$data[] = array($levelname, $rolename, $count, implode(' ', $edit));
}
$table = new html_table();
- $table->head = array(get_string('contextlevel', 'report_unsuproles'), get_string('role'), get_string('count', 'report_unsuproles'), get_string('edit'));
+ $table->head = array(get_string('contextlevel', 'tool_unsuproles'), get_string('role'), get_string('count', 'tool_unsuproles'), get_string('edit'));
$table->size = array('40%', '40%', '10%', '10%');
$table->align = array('left', 'left', 'center', 'center');
$table->width = '90%';
<?php
-
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * Strings for component 'report_unsuproles', language 'en', branch 'MOODLE_20_STABLE'
+ * Strings for component 'tool_unsuproles', language 'en', branch 'MOODLE_22_STABLE'
*
* @package report
* @subpackage unsuproles
<?php
-
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
/**
* Link to unsupported roles report
*
- * @package report
+ * @package tool
* @subpackage unsuproles
* @copyright 2010 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
defined('MOODLE_INTERNAL') || die;
if ($hassiteconfig) {
- $ADMIN->add('roles', new admin_externalpage('reportunsuproles', get_string('pluginname', 'report_unsuproles'), "$CFG->wwwroot/$CFG->admin/report/unsuproles/index.php"), array('moodle/site:config', 'moodle/role:assign'));
+ $ADMIN->add('roles', new admin_externalpage('toolunsuproles', get_string('pluginname', 'tool_unsuproles'), "$CFG->wwwroot/$CFG->admin/tool/unsuproles/index.php"), array('moodle/site:config', 'moodle/role:assign'));
}
<?php
-
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
/**
* Plugin version info
*
- * @package report
+ * @package tool
* @subpackage unsuproles
* @copyright 2010 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
-$plugin->version = 2010071800;
+$plugin->version = 2011091700; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2011091600; // Requires this Moodle version
+$plugin->component = 'tool_unsuproles'; // Full name of the plugin (used for diagnostics)
'report' => array(
'backups', 'configlog', 'courseoverview',
'customlang', 'log', 'profiling', 'questioninstances',
- 'security', 'spamcleaner', 'stats', 'unittest', 'unsuproles'
+ 'security', 'spamcleaner', 'stats', 'unittest'
),
'repository' => array(
),
'tool' => array(
- 'capability'
+ 'capability', 'unsuproles'
),
'webservice' => array(