Issue Details (XML | Word | Printable)

Key: MDL-16348
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Tim Hunt
Reporter: Tim Hunt
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

A way for admin report plugins to specify where they appear in the admin tree

Created: 05/Sep/08 06:02 PM   Updated: 08/Sep/08 07:32 PM
Component/s: Administration
Affects Version/s: 2.0
Fix Version/s: 2.0

File Attachments: 1. Text File admintree.patch.txt (15 kB)


Participants: Petr Skoda and Tim Hunt
Security Level: None
Resolved date: 08/Sep/08
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
In each admin report plugin, there will be an optional file lib.php, which may define two variables:

$placeintree = array('users', 'roles');
$requirecapability = 'moodle/role:manage';

If this was in admin/report/capability/lib.php, then it would say that the capability report appears under Users -> Permissions, and is only available to people with the moodle/role:manage capability.

If lib.php does not exist, or either of these variables are not defined in that file, then the default is

$placeintree = array('reports');
$requirecapability = 'moodle/site:viewreports';

The strings in the $placeintree array are the names passed to the admin_category constructor.

Note that this has to work, even if reports want to add themselves to the experimental category, that is, reports need to be processed last when building the tree, although the reports category will remain second from last.

As well as moving the new Capabilities report to Users -> Permissions, we will move Unit tests and Functional DB tests (and XMLDB editor, although that is not a report) to a new Developer top level category.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
tjhunt committed 11 files to 'Moodle CVS' - 08/Sep/08 07:32 PM
MDL-16348 Reorganise admin tree:
* New Capability report put under Users -> Permissions
* Miscellaneous category renamed to Development
* Unit tests and Functional DB test moved to be under Development.
* The hard-coded hack that was used to change the permission that controls the Backups and stats reports replaced with settings.php files.
* There were two hidden Miscellaneous things in the old category, so I moved them. Multilan upgrade now under Lanuages, and Online assignment cleanup now under Plugins -> Activity modules. Both still hidden.

There was already a way for admin report plugins to control where they appeared in the tree, but it was not documented, so see http://docs.moodle.org/en/Development:Admin_reports
DEL admin/settings/Attic/misc.php   Rev. 1.25    (+0 -0 lines)
MODIFY lib/adminlib.php   Rev. 1.261    (+17 -1 lines)
MODIFY admin/settings/plugins.php   Rev. 1.23    (+3 -1 lines)
MODIFY admin/settings/top.php   Rev. 1.25    (+2 -25 lines)
MODIFY admin/report/simpletest/Attic/settings.php   Rev. 1.4    (+3 -10 lines)
MODIFY admin/settings/language.php   Rev. 1.13    (+4 -4 lines)
ADD admin/report/backups/settings.php   Rev. 1.1    (+0 -0 lines)
ADD admin/report/stats/settings.php   Rev. 1.1    (+0 -0 lines)
MODIFY lang/en_utf8/admin.php   Rev. 1.225    (+2 -0 lines)
ADD admin/settings/development.php   Rev. 1.1    (+0 -0 lines)
ADD admin/report/capability/settings.php   Rev. 1.1    (+0 -0 lines)
Mitsuhiro Yoshida committed 3 files to 'Lang CVS' - 08/Sep/08 11:48 PM
MDL-16348 - Translated new strings for admin.
MDL-13766 - Translated new strings for repository.
MODIFY ja_utf8/admin.php   Rev. 1.299    (+3 -1 lines)
MODIFY ja_utf8/README   Rev. 1.808    (+1 -1 lines)
MODIFY ja_utf8/repository.php   Rev. 1.20    (+3 -1 lines)
tjhunt committed 2 files to 'Moodle CVS' - 09/Sep/08 05:35 PM
MDL-16348 - followup - prevent debug output when logged in as a non-admin. Thanks to Mat for ponting this out.
MODIFY admin/report/simpletest/Attic/settings.php   Rev. 1.5    (+6 -3 lines)
MODIFY admin/report/capability/settings.php   Rev. 1.2    (+4 -2 lines)
martignoni committed 1 file to 'Lang CVS' - 15/Sep/08 12:11 AM
MDL-16348 new strings for admin reports
MODIFY fr_utf8/admin.php   Rev. 1.298    (+3 -1 lines)