35 Commits

Author SHA1 Message Date
thepurpleblob
367b841305 Added 'studentview' button functionality. 2005-08-15 12:53:57 +00:00
defacer
e15e02bf98 Merging from STABLE:
Fix for bug 3637:

Certain obscure cases of using PHP accelerators (probably has to do with
OS and PHP version as well, but it's not certain) caused an error to be
displayed when importing data from "local pagelib" files with "debug" turned
on. The error was bogus, but error() stopped the page from being displayed.

Thanks to James P. Dugal the from University of Louisiana at Lafayette for
identifying and helping to solve the problem!
2005-07-20 17:23:07 +00:00
defacer
eee5cf8f64 Removing the "dirty compatibility hack", it surely has done what it was
meant to do all this time (keep Moodle working for people who had already
upgraded to early versions of 1.5).

This fixes bug 2965, thanks Penny for reminding!
2005-04-19 12:40:15 +00:00
defacer
262771e08f page_import_types($path) doesn't care if $path has a trailing slash or not 2005-03-02 03:43:41 +00:00
defacer
b5e9682173 Adding caching to page_import_types. Actually the caching is REQUIRED for the
function to work, because otherwise it would barf on duplicate class declaration
the second time it was called with the same arguments.
2005-02-28 04:16:41 +00:00
defacer
3f6aba0c42 Library function which returns the page types used for a specific directory
in the Moodle distro structure. As generic as it gets.
2005-02-28 04:01:30 +00:00
moodler
fd5b9188bd removed explicit style-adding for user login string 2005-02-25 06:23:46 +00:00
defacer
4f0d565da6 Bringing Quiz in line with Martin's "make Chat into a showcase for pages" idea. 2005-02-10 01:59:11 +00:00
moodler
6744033797 Removed CHAT further 2005-02-09 16:47:41 +00:00
moodler
37dfb27974 Moved chat PAGE stuff out of core as an example 2005-02-09 16:44:35 +00:00
defacer
0ab589983e New class that models the behavior of a chat activity!
Isn't it so small and cute? ;-)
2005-02-09 15:39:07 +00:00
defacer
b83eee7daa Putting all things that are common among activities into a new class
page_generic_activity. Then we can inherit almost all of the desired
behavior and just override a couple of functions to get going with page
support in a new activity.
2005-02-09 15:22:16 +00:00
defacer
55815b288d Streamlining class page_quiz, fixing things, removing needless comments. 2005-02-09 15:05:14 +00:00
defacer
8a47e075b3 Changing the way that applicable formats for each block are defined:
The format for each page is now the same as the id attribute of the
BODY tag, which in turn is a simple function of the script's relative path:

The format for e.g. a quiz view page is "mod-quiz-view". The format for the
site index is "site-index". Exception: the format for courses is not just
"course-view", but "course-view-weeks" etc.

Obviously the applicable_formats() override for each block should now take
this into account. The matching rules now are:

* You can specify the full format, e.g. "mod-quiz-view" => true
  will allow the block to be added in quizzes
* Prefixes match the full page format, e.g. "mod" matches ALL activities
* You can use "*" as a wildcard, e.g. "mod-*-view" matches just the view.php
  page of all activities
* These rules interoperate, thus "mod-*" is the same as "mod"
* "all" remains as a catch-all situation
2005-02-08 02:59:44 +00:00
defacer
246c206420 Fix for bug 2492: Notices thrown by pagelib.php.
It was an oversight on my part. Thanks Gustav!
2005-02-04 20:27:54 +00:00
defacer
7c6c051326 Utilizing page_id_and_class(), make a factory function page_create_instance()
that does not need the page type as an argument (autodetects from the URL).
2005-02-02 02:32:40 +00:00
defacer
8bd3fad303 I need those constants a bit more easily accessible. 2005-02-01 07:39:21 +00:00
defacer
7221d319be Fixing all the details in the block instance configuration screen.
That wasn't so hard!
2005-02-01 07:34:17 +00:00
defacer
cadc69c64c Added a new class page_quiz, modelling the behavior of a quiz view page.
Not everything is quite right now, a few details (e.g. correct breadcrumbs)
have been ignored but most of the functionality is there.

Blocks in quizzes, here we come!
2005-02-01 07:12:39 +00:00
defacer
7542a4e574 Dropping the use of MOODLE_PAGE_COURSE <gasp>!
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.
2005-01-31 02:18:15 +00:00
moodler
93dcb13ed9 Only show page errors when debugging is on (in case we can recover) 2005-01-28 17:03:57 +00:00
defacer
bbcbc3f85e Removing the extra debug info now that bug 2431 was fixed.
I can't believe that this insignificant workaround actually solved the
problem. This is most probably a bug with PHP and static initialization
of array variables.
2005-01-28 05:42:19 +00:00
defacer
0d7e0e8ada A small change for the static initialization in page_map_class,
and more debug added just before init is done.
2005-01-28 03:52:56 +00:00
defacer
e355a2d304 Bugfix: when configuring a block in the site index, the site name was
being displayed twice in the breadcrumbs.
2005-01-27 23:56:46 +00:00
defacer
eaba9c8510 Adding that nifty BODY id and class detection code to pages... I have the
feeling that this is the way to go, as more Moodle things will be converted
to use $PAGE in the future.
2005-01-26 15:33:50 +00:00
defacer
6bc5558ce6 Adding some extra debug output when a specific error() occurs to help track
down a problem which has been reported in the forums (it is NOT a bug though).

THIS SHOULD BE REMOVED BEFORE 1.5 IS RELEASED!
2005-01-25 19:13:09 +00:00
defacer
0f256abc0c Fix for bug 2336:
I accidentally removed the editing button from courses when fixing bug 2328.
Fortunately, Gustav was on the lookout.
2005-01-04 19:43:09 +00:00
defacer
edb42f0924 Fix for bug 2328:
* When configuring a block instance, "Turn editing off" button is not
  shown anymore.

* When configuring a block instance, the breadcrumbs are now better,
  providing a link to the course page. This could be done in a much
  better way if we had a comprehensive template system but it will
  suffice for now.
2005-01-02 15:20:15 +00:00
dhawes
5809683fba fixed a comment whose details had been left behind in the recent api change 2004-11-29 04:38:07 +00:00
defacer
9b12850043 Fix for bug 2241:
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.
2004-11-29 04:19:05 +00:00
defacer
99110470ba Somehow I forgot to commit these and the whole page setup wasn't working
after renaming MoodlePage => page_base.
2004-11-25 17:23:57 +00:00
defacer
0fa6d31143 Removed a useless space :) 2004-11-20 19:44:28 +00:00
defacer
c8e0b57900 Pages/blocks code updates:
NEW: The code now supports dynamically plugging your own Pages and block position
identifiers into Moodle without messing with the main libraries at all.

UPDATE: Many functions in blocklib now use pass-by-reference for speed.

UPDATE: Class MoodlePage has been made more presentable and robust.
2004-11-12 18:39:25 +00:00
dhawes
e0134f842c added comments and some spacing cleanup 2004-11-10 16:43:57 +00:00
defacer
f032aa7a5f MAJOR CHANGES:
--------------

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.
2004-11-08 19:36:07 +00:00