+++ /dev/null
-<?php
-
-defined('MOODLE_INTERNAL') || die;
-
-$ADMIN->add('roles', new admin_externalpage('reportcapability', get_string('pluginname', 'report_capability'), "$CFG->wwwroot/$CFG->admin/report/capability/index.php",'moodle/role:manage'));
<?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/>.
+
/**
* For a given capability, show what permission it has for every role, and
* everywhere that it is overridden.
*
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- * @package roles
+ * @package tool
+ * @subpackage capability
+ * @copyright 2008 Tim Hunt
+ * @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');
// Check permissions.
}
// Include the required JavaScript.
-$PAGE->requires->js_init_call('M.report_capability.init', array(get_string('search')));
+$PAGE->requires->js_init_call('M.tool_capability.init', array(get_string('search')));
// Log.
-add_to_log(SITEID, "admin", "report capability", "report/capability/index.php?capability=$capability", $capability);
+add_to_log(SITEID, "admin", "tool capability", "tool/capability/index.php?capability=$capability", $capability);
// Print the header.
-admin_externalpage_setup('reportcapability');
+admin_externalpage_setup('toolcapability');
echo $OUTPUT->header();
// Prepare the list of capabilities to choose from
// Print the settings form.
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
-echo '<form method="get" action="." id="settingsform"><div>';
-echo $OUTPUT->heading(get_string('reportsettings', 'report_capability'));
-echo '<p id="intro">', get_string('intro', 'report_capability') , '</p>';
-echo '<p><label for="menucapability"> ' . get_string('capabilitylabel', 'report_capability') . '</label></p>';
+echo '<form method="get" action="" id="settingsform"><div>';
+echo $OUTPUT->heading(get_string('reportsettings', 'tool_capability'));
+echo '<p id="intro">', get_string('intro', 'tool_capability') , '</p>';
+echo '<p><label for="menucapability"> ' . get_string('capabilitylabel', 'tool_capability') . '</label></p>';
echo html_writer::select($capabilitychoices, 'capability', $capability, array(''=>'choose'), array('size'=>10));
-echo '<p><label for="menuroles"> ' . get_string('roleslabel', 'report_capability') . '</label></p>';
+echo '<p><label for="menuroles"> ' . get_string('roleslabel', 'tool_capability') . '</label></p>';
echo html_writer::select($rolechoices, 'roles[]', $selectedroleids, false, array('size'=>10, 'multiple'=>'multiple'));
-echo '<p><input type="submit" id="settingssubmit" value="' . get_string('getreport', 'report_capability') . '" /></p>';
+echo '<p><input type="submit" id="settingssubmit" value="' . get_string('getreport', 'tool_capability') . '" /></p>';
echo '</div></form>';
echo $OUTPUT->box_end();
}
// Print the report heading.
- echo $OUTPUT->heading(get_string('reportforcapability', 'report_capability', get_capability_string($capability)), 2, 'main', 'report');
+ echo $OUTPUT->heading(get_string('reportforcapability', 'tool_capability', get_capability_string($capability)), 2, 'main', 'report');
if (count($cleanedroleids) != count($allroles)) {
$rolenames = array();
foreach ($cleanedroleids as $roleid) {
$rolenames[] = $allroles[$roleid]->name;
}
- echo '<p>', get_string('forroles', 'report_capability', implode(', ', $rolenames)), '</p>';
+ echo '<p>', get_string('forroles', 'tool_capability', implode(', ', $rolenames)), '</p>';
}
// Now, recursively print the contexts, and the role information.
// make changes.
if ($contextid == get_system_context()->id) {
$url = "$CFG->wwwroot/$CFG->admin/roles/manage.php";
- $title = get_string('changeroles', 'report_capability');
+ $title = get_string('changeroles', 'tool_capability');
} else {
$url = "$CFG->wwwroot/$CFG->admin/roles/override.php?contextid=$contextid";
- $title = get_string('changeoverrides', 'report_capability');
+ $title = get_string('changeoverrides', 'tool_capability');
}
echo '<h3><a href="' . $url . '" title="' . $title . '">', print_context_name($contexts[$contextid]), '</a></h3>';
<?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_capability', language 'en', branch 'MOODLE_20_STABLE'
+ * Strings for component 'tool_capability', language 'en', branch 'MOODLE_22_STABLE'
*
- * @package report_capability
- * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package tool
+ * @subpackage capability
+ * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['capabilitylabel'] = 'Capability:';
-$string['capabilityreport'] = 'Capability report';
+$string['capabilityreport'] = 'Capability overview';
$string['forroles'] = 'For roles {$a}';
-$string['getreport'] = 'Get the report';
+$string['getreport'] = 'Get the overview';
$string['changeoverrides'] = 'Change overrides in this context';
$string['changeroles'] = 'Change role definitions';
$string['intro'] = 'This report shows, for a particular capability, what permission that capability has in the definition of every role (or a selection of roles), and everywhere in the site where that capability is overridden.';
-$string['pluginname'] = 'Capability report';
+$string['pluginname'] = 'Capability overview';
$string['reportforcapability'] = 'Report for capability \'{$a}\'';
$string['reportsettings'] = 'Report settings';
$string['roleslabel'] = 'Roles:';
-M.report_capability = {
+M.tool_capability = {
select: null,
input: null,
button: null,
init: function(Y, strsearch) {
- var context = M.report_capability;
+ var context = M.tool_capability;
// Find the form controls.
context.select = document.getElementById('menucapability');
},
typed: function() {
- var context = M.report_capability;
+ var context = M.tool_capability;
var filtertext = context.input.value;
var options = context.select.options;
},
validate: function() {
- var context = M.report_capability;
+ var context = M.tool_capability;
context.button.disabled = (context.select.value == '');
}
}
\ No newline at end of file
--- /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/>.
+
+/**
+ * Capability overview settings
+ *
+ * @package tool
+ * @subpackage capability
+ * @copyright 2008 Tim Hunt
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die;
+
+$ADMIN->add('roles', new admin_externalpage('toolcapability', get_string('pluginname', 'tool_capability'), "$CFG->wwwroot/$CFG->admin/tool/capability/index.php",'moodle/role:manage'));
--- /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/>.
+
+/**
+ * Version details.
+ *
+ * @package tool
+ * @subpackage capability
+ * @copyright 2011 petr Skoda
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die;
+
+$plugin->version = 2011091700; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2011091600; // Requires this Moodle version
+$plugin->component = 'tool_capability'; // Full name of the plugin (used for diagnostics)
),
'report' => array(
- 'backups', 'capability', 'configlog', 'courseoverview',
+ 'backups', 'configlog', 'courseoverview',
'customlang', 'log', 'profiling', 'questioninstances',
'security', 'spamcleaner', 'stats', 'unittest', 'unsuproles'
),
),
'tool' => array(
+ 'capability'
),
'webservice' => array(