Commit graph

360 commits

Author SHA1 Message Date
tjhunt
08eab89703 blocklib: MDL-19010 add block and get_blocks methods 2009-05-06 09:14:42 +00:00
tjhunt
86b5ea0f85 blocklib: MDL-19010 start of block_manager - get and set regions 2009-05-06 09:14:01 +00:00
tjhunt
c33db6e690 moodle_page: MDL-12212 clarify some comments 2009-05-06 09:13:40 +00:00
tjhunt
93d4a373f9 blocklib: MDL-19010 always include blocklib in setup.php, stip includes elsewhere 2009-05-06 09:13:16 +00:00
tjhunt
5ed70539f9 moodle_page: MDL-12212 ->subpage field 2009-05-06 09:03:49 +00:00
tjhunt
5ec434a9c2 moodle_page: MDL-12212 ->cm and ->activityrecord fields 2009-05-06 09:03:33 +00:00
tjhunt
934524d70b moodle_page: MDL-12212 new implementation of user_allowed_editing 2009-05-06 09:01:42 +00:00
tjhunt
830dd6e9cd moodle_page: MDL-12212 reimplement user_is_editing, deprecate isediting 2009-05-06 08:59:29 +00:00
tjhunt
ad52c04f4c moodle_page: MDL-12212 Kill legacy url_... and blocks_... methods
Start calling $PAGE->set_url in all the places it will be necessary
Start of a stub implementation of $PAGE->blocks to stop other things breaking
Remove some of the special case methods in admin_page
2009-05-06 08:55:53 +00:00
tjhunt
75781f879c moodle_page: MDL-12212 ->url and cleanup init of $FULLME, etc. 2009-05-06 08:50:32 +00:00
tjhunt
82611d8d33 moodle_page: MDL-12212 ->docspath 2009-05-06 08:48:13 +00:00
tjhunt
d7ab887938 moodle_page: MDL-14306 (part of MDL-12212) class name on body with ->category
If ->allowcategorythemes is set, includes all parent categories too
2009-05-06 08:46:48 +00:00
tjhunt
948203a5e8 moodle_page: MDL-12212 ->category and ->categories 2009-05-06 08:46:05 +00:00
tjhunt
89fbdca300 moodle_page: MDL-14305 (and MDL-12212) class on body based on ->wwwroot 2009-05-06 08:44:58 +00:00
tjhunt
753debd2ab moodle_page: MDL-12212 ->bodyclasses and initialise_standard_body_classes 2009-05-06 08:42:13 +00:00
tjhunt
e88462a055 moodle_page: MDL-12212 eliminate the two different interpretations of
pagetype
2009-05-06 08:41:02 +00:00
tjhunt
f230ce19ea moodle_page: MDL-12212 implement ->pagetype 2009-05-06 08:34:32 +00:00
tjhunt
2afe21eea3 moodle_page: MDL-12212 implement ->context 2009-05-06 08:30:25 +00:00
tjhunt
6db66ba11c Disable the bloody eventslib unit tests until someone fixes them! 2009-04-24 09:49:43 +00:00
nicolasconnault
577d5f9e32 MDL-15931 More unit tests of file_info_* classes 2009-04-23 09:06:59 +00:00
nicolasconnault
a196c5ace7 MDL-15931 More unit tests of file_info_* classes 2009-04-23 09:02:21 +00:00
nicolasconnault
ce75fef1c6 MDL-15931 More unit tests of file_info_* classes 2009-04-23 08:58:49 +00:00
nicolasconnault
d263168375 MDL-15931 Using $CFG->unittestprefix now for filelib unit tests. MUCH slower but safe(r) 2009-04-21 12:22:36 +00:00
nicolasconnault
f91a05e0e1 MDL-15931 More unit tests of file_info_* classes 2009-04-20 14:42:17 +00:00
nicolasconnault
2b726e9f3a MDL-15931 More unit tests of file_info_* classes 2009-04-20 13:10:42 +00:00
nicolasconnault
dd13271188 MDL-15931 refactored file_browser.php 2009-04-20 08:18:33 +00:00
nicolasconnault
edfbf2fe81 MDL-15931 Adding testfilelib.php and a few comments in file API code 2009-04-18 15:16:13 +00:00
tjhunt
9434fef401 filters: MDL-18879 filter data not deleted when a context is deleted
Missed when implementing MDL-7336

Also, fix minor issues with deleting filters
2009-04-17 02:49:07 +00:00
poltawski
668fa0d667 simplepie: fix class name caseing: MDL-7946, MDL-13932 2009-04-13 16:00:44 +00:00
poltawski
80d72d56bc Adding SimplePie feed parsing library MDL-7946, MDL-13932
To replace unmaintained magipie. Simplepie is actively maintained has some
nice features such as feed autodisovery. Implemented a simple extended class
which uses the Moodle core curl class from filelib.

Added unit test using the moodle.org sample files. Please note these tests will
fail if moodle can't make http connections out, so ensure proxy settings
etc are correct.
2009-04-13 15:29:08 +00:00
tjhunt
a042675877 filters: MDL-7336 function to get the information the local settings page will need. 2009-04-13 07:07:03 +00:00
tjhunt
3058afd429 filters: MDL-7336 performance testing script 2009-04-13 07:06:44 +00:00
tjhunt
5b8fa09b00 filters: MDL-7336 Finish admin settings page. 2009-04-13 07:04:07 +00:00
tjhunt
456c8cc738 filters: MDL-7336 redo global settings page to use the new libs
Note: ->stringfilters update not done yet.
2009-04-13 07:03:32 +00:00
tjhunt
ccc161f8f0 filters: MDL-7336 change weblib to use the new code
* Rename filter base class from filter_base to moodle_text_filter
* Remove unnecessary explicit constructors in moodle_text_filter
subclasses
* New filter_manager class, rather than static methods in filter_base
* Move some logic out of weblib, and into filter_manager
* Count filtering ops when $CFG->perfdebug on, via
performance_measuring_filter_manager
* Kill unused filter_string function. Petr said it should have been
private to weblib
2009-04-13 06:56:32 +00:00
tjhunt
1f8c468dbd filters: MDL-7336 rename get_active_filters -> filter_get_active_in_context and improve auto-sorting. 2009-04-13 06:54:34 +00:00
tjhunt
1bd09db947 filters: MDL-7336 implement get_active_filters 2009-04-13 06:53:53 +00:00
tjhunt
56881fdc93 filters: MDL-7336 functions for g/setting local filter_active overrides 2009-04-13 06:53:33 +00:00
tjhunt
84e240a091 filters: MDL-7336 rework unit tests to use CheckSpecifiedFieldsExpectation. 2009-04-13 06:53:14 +00:00
tjhunt
e1a9622fad filters: MDL-7336 functions for getting and setting filter_config 2009-04-13 06:52:56 +00:00
tjhunt
7e3a668c07 get_string unit tests: Switch to inline fixture setup 2009-04-10 04:59:09 +00:00
tjhunt
5c2fec8b74 get_string: MDL-18813 get_string was broken for strings that were '' 2009-04-08 11:45:53 +00:00
tjhunt
0c34c7eb50 translation: MDL-18766 reverting. I guess it was not yet ready for prime-time.
I'll commit the patch to contrib in case anyone wishes to experiment further.
2009-04-02 02:42:11 +00:00
tjhunt
b4cf937102 translation: MDL-18766 Prototype automatic translation system for Moodle.
If Google can do something like http://translate.google.com/, surely we
can do something just as good in Moodle. Here is a first attempt. It is
a bit rough around the edges, and only a couple of target lananguages
have been implemented so far. (More and better attempts welcome!)

In order to ensure that this gets adequate testing, I have made sure that
it gets turn on by default. However, if you really don't like it, you can
turn it off under Administration > Development -> Experimental settings.
2009-04-01 00:39:17 +00:00
tjhunt
240be1d71c DB unit tests: improve the class so it is easier to use. 2009-03-30 07:05:29 +00:00
tjhunt
e7b818807c get_string: MDL-13816 allow third-partly modules to register sub-plugin types that have their own lang files.
I suppose to be really useful we should deal with database, capabiltities, etc. too in due course. Still, this is a start.
2009-03-30 06:13:35 +00:00
tjhunt
bb45fe62c4 get_string: Refactoring, performance improvements, bug fixes and unit tests
MDL-18669 get_string refactored to elimiate duplicate code and make it easier to understand.
MDL-17763 parent language not processed correctly when getting a plugin string.
MDL-16181 more intelligent caching to avoid repeated file_exists checks.
MDL-12434 move values to array keys to improve lookup times.

The main part of the refactoring is to create a singleton string_manager class to encapsulate the cached data and the processing, while breaking the code up into more smaller methods.

Other performance improvements include:
* Cache results of plugin name -> locations to search array.
* Cache parent lang lookup.
* Skip eval if the string does not contain $ \ or %.
* Remove the unnecessary sprintf from the eval.

There is a performance testing script in lib/simpletest/getstringperformancetester.php. For now this script has the old get_string implementation copied and pasted to the end, and renamed to old_get_string to allow for comparitive timings.

There are now some unit tests for get_string in lib/simpletest/teststringmanager.php. I think I have managed to cover most of the tricky cases.
2009-03-30 02:21:27 +00:00
tjhunt
c468795ce9 switch roles: MDL-18132 New Role allow switches page finished.
I also set up a reasonable set of default allows, including setting up some sensible allow_overrides, whatever the rant in MDL-15841 says.
2009-03-25 04:20:57 +00:00
tjhunt
82701e2443 switch roles: MDL-18132 separate database table role_allow_switch instead of re-using role_allow_assign.
This is part 1 that does the back-end:

1. New table role_allow_switch.
2. Upgrade that copies all the allows from role_allow_assign, and then drops the old CFG->allowuserswitchrolestheycantassign.
3. Old function get_assignable_roles_for_switchrole renamed to get_switchable_roles and changed to use the new table. Fixes MDL-18604 in HEAD.
4. Switch callers to use the new function name.
5. Unit tests for this new function.
6. To make those unit tests work, new switch_global_user_id and revert_global_user_id methods in UnitTestCaseUsingDatabase for toggling $USER->id.

I still need to do the editing interface under Administration ► Users ► Permissions ► Define roles. That will be done as a second commit.
2009-03-23 08:15:21 +00:00
tjhunt
b695b4e16c Make accesslib unit tests work once again using the new UnitTestCaseUsingDatabase 2009-03-23 04:18:44 +00:00