Implemented all the relevant checks for role_switch().
accesslib's role_switch() doesn't do any UI-related checks any more,
being a backend lib call. These belong here.
More consistency across course formats for editing stuff, using $PAGE.
Also a "bugfix": when turning editing off, cancel moving an activity if you
were in the middle of doing so.
The new constant is PAGE_COURSE_VIEW, and it's more streamlined with the
new CSS-related ids for 1.5. There are great possibilities for the future
here, so we 're getting ready.
On the other hand, this has to be the ugliest hack I 've ever inflicted
on any program (look at pagelib.php). Thankfully it will only stay for just
a little while.
I hope this time I got everything changed to the new Page interface! I 'm
really sorry for messing up and breaking new installations... :(
Also moved the only two functions of the API outside the page_base class.
--------------
Brand-new pagelib.php at your disposal! It slices, it dices, it makes your coffee.
It still doesn't understand women... Read the comments in pagelib.php for a first
impression. Feedback highly encouraged!
Blocks code has undergone significant changes to work with Pages. Flexibility is its
middle name, since I think (without having tried it) that adding e.g. a third
placeholder for "center" blocks in courses, with full support for moving around etc,
will now take about 15 lines of new or edited code. If you are not impressed yet, I
suggest watching a documentary on solar physics. :P
MINOR CHANGES:
--------------
Added instance_allow_config() in the blocks class hierarchy to supplement per-instance
configuration options. You can override it to return true and thus get configuration
amenities without allowing multiple instances.
Minor polishing to comments and documentation (whatever caught my eye was game).
Tightened up some code here and there by utilizing all the new features.
BUGFIXES:
---------
A bug in restore_execute.html caused hidden blocks to not be restored at all.
Code based on the work of Daryl Hawes for the blog module. Thanks, Daryl!
Please test the hell out of it as it's sure to have issues that need to be
ironed out.
Changed the way applicable formats for blocks are handled. The changes are
short codewise, but to grasp all the implications read the forum discussion
at the relevant URL.
bug 1248. Widhts were only calculated in teacher mode and
they were down to 100px in student mode!!
Perhaps we could make some session caching to avoid some
calculations every time the course is displayed. Seems to
work fine now.
Anyway, if I compare the right column width
in my server (with blocks running) against moodle.org (without
blocks), it seems that the right column is narrower in my test server...
Integrated with Moodle:
- Install automatically.
- Update course->blockinfo for each course at installation time.
- Modified course creation to insert into blockinfo field.
- Modified restore to insert into blockinfo field.
- Admin options (hide, show, delete, config) from admin page.
- Lang strings inserted (en only).
- Database support to mysql and postgresql (not tested!!).
Moodle, backup and block versions updated to 2004041800.
Tested with mysql: Install fresh and upgrade from previous.
section_activities block renamed to social_activities and created
its own lang file to support name "Social Activities". This can
be changed at any time.
TODO:
=====
Support it really in backup/restore.
????
Enjoy!! Ciao :-)