MDL-44070 Conditional availability enhancements (2): subsystem, API
authorsam marshall <s.marshall@open.ac.uk>
Wed, 26 Mar 2014 12:02:30 +0000 (12:02 +0000)
committersam marshall <s.marshall@open.ac.uk>
Mon, 7 Apr 2014 19:11:33 +0000 (20:11 +0100)
commitd3db4b037cc3d0ba4afdd51fa9a9565dac1385e3
tree1de199a0c98642ed773ff95f1c404a677bbaa598
parent8e97006ad00e9b699b52588d3d29a910a597baaa
MDL-44070 Conditional availability enhancements (2): subsystem, API

This commit defines the new /availability root folder, with
/availability/classes, /availability/tests, and
/availability/condition where the condition plugins will live.
Condition plugin prefix is availability_, e.g. availability_date.

Rationale for this organisation:

1. I was originally going to put this in /lib/availability but
   it has been pointed out that putting even more junk in lib
   is probably bad.
2. 'availability' and 'condition' are the two names used in code
   to refer to this system ($CFG->enableavailability).
3. The prefix has to be short enough to allow database tables
   (although in practice I assume that condition plugins will not
   normally contain database tables).

The new API includes a Boolean tree structure that controls the
availability of an item.

AMOS BEGIN
 CPY [availabilityconditions,core_condition],[restrictaccess,core_availability]
 CPY [enableavailability,core_condition],[enableavailability,core_availability]
 CPY [configenableavailability,core_condition],[enableavailability_desc,core_availability]
AMOS END
31 files changed:
admin/tool/availabilityconditions/index.php [new file with mode: 0644]
admin/tool/availabilityconditions/lang/en/tool_availabilityconditions.php [new file with mode: 0644]
admin/tool/availabilityconditions/settings.php [new file with mode: 0644]
admin/tool/availabilityconditions/version.php [new file with mode: 0644]
availability/classes/capability_checker.php [new file with mode: 0644]
availability/classes/condition.php [new file with mode: 0644]
availability/classes/frontend.php [new file with mode: 0644]
availability/classes/info_base.php [new file with mode: 0644]
availability/classes/info_module.php [new file with mode: 0644]
availability/classes/info_section.php [new file with mode: 0644]
availability/classes/result.php [new file with mode: 0644]
availability/classes/tree.php [new file with mode: 0644]
availability/classes/tree_node.php [new file with mode: 0644]
availability/renderer.php [new file with mode: 0644]
availability/tests/behat/display_availability.feature [new file with mode: 0644]
availability/tests/behat/edit_availability.feature [new file with mode: 0644]
availability/tests/capability_checker_test.php [new file with mode: 0644]
availability/tests/component_test.php [new file with mode: 0644]
availability/tests/fixtures/mock_condition.php [new file with mode: 0644]
availability/tests/fixtures/mock_info.php [new file with mode: 0644]
availability/tests/info_test.php [new file with mode: 0644]
availability/tests/tree_test.php [new file with mode: 0644]
availability/yui/src/form/build.json [new file with mode: 0644]
availability/yui/src/form/js/form.js [new file with mode: 0644]
availability/yui/src/form/meta/form.json [new file with mode: 0644]
lang/en/availability.php [new file with mode: 0644]
lang/en/plugin.php
lib/classes/component.php
lib/classes/plugin_manager.php
lib/classes/plugininfo/availability.php [new file with mode: 0644]
phpunit.xml.dist