64 Commits

Author SHA1 Message Date
tjhunt
263c81b0ad MDL-11794 - Blocks editing on button is not XHTML Strict when produced by page_generic_activity. Merged from MOODLE_19_STABLE. 2007-10-16 20:44:55 +00:00
tjhunt
38e179a4ed MDL-11741 - Convert core modules to take advantage of recent improvements to build_navigation.
This check-in removes about 400 lines of code. I hope I have not screwed anything up. I would be grateful if people could review this change, and keep an eye on the navigation bar in modules.

Any navigation bar bugs you find in the near future, feel free to file them in the tracker and assign them to me. Thanks.

If not to many problems are found, I think I would like to backport this to 1.9 stable, but I am not sure that is a good idea. Opinions to the General Developer Forum please. I am about to start a thread there.
2007-10-12 15:55:49 +00:00
martinlanghoff
e1e1f49820 pagelib: Course page - preload child contexts and smarter user_allowed_editing()
With this patch we preload the child contexts for the course
and hold on to them. This means that in one DB query we have all the contexts
we are going to need.

The checks for user_allowed_editing() move from weblib:update_icon() to
user_allowed_editing(), where we cache the result, and in the process save
50% of the cap checks by testing separately blocks from modules (doh!).

Still, the cap checks here are very inefficient...

With the last 3 patches, a course page with default blocks and 9 modinstances
goes from 157 to 86 db queries when logged in as a non-editing user (guest,
student). As admin it drops from 88 to 81.

Conflicts:

	lib/pagelib.php
2007-09-19 06:53:09 +00:00
skodak
b571c6b37b MDL-10995 eliminated some get course record calls - reused $COURSE instead 2007-08-26 08:24:50 +00:00
skodak
e6260a456b MDL-10635 improved performance of update_course_icon() and friends; fixed parameter of iseditting() - removed $userid which was not used and did not make much sense there anyway 2007-08-25 11:28:37 +00:00
mattc-catalyst
01e3838853 MDL-9473: Initialise navlinks array before use
Author: Matt Clarkson <mattc@catalyst.net.nz>
2007-07-05 04:55:24 +00:00
mattc-catalyst
3b27b0fe21 MDL-9615: Correct incorrect use of term breadcrumbs
- $crumbs -> $navlinks


Author: Matt Clarkson <mattc@catalyst.net.nz>
2007-07-05 04:40:48 +00:00
mattc-catalyst
70c6c0ad70 MDL-9474: Updated build_navigation() to use global $COURSE
- Removed $course parameter from build_navigation()
- Updated all calls to build_navigation()


Author: Matt Clarkson <mattc@catalyst.net.nz>
Committer: Matt Clarkson <mattc@catalyst.net.nz>
2007-04-23 21:11:10 +00:00
mattc-catalyst
6db8acb6a5 Breadcrumbs: pagelib changes
- Modified page class to use build_navigation for creating breadcrumbs.
- Added print_header method to page_generic_activity to make derived
  classes print the page headers the correct way.


Author: Matt Clarkson <mattc@catalyst.net.nz>
Committer: Matt Clarkson <mattc@catalyst.net.nz>
2007-04-16 20:48:48 +00:00
toyomoyo
5c91baaa46 patching up module level manageactivies capability so that you only need it assigned at mod level to update an activity 2007-03-26 02:55:03 +00:00
defacer
fed8017908 Merged from MOODLE_16_STABLE:
Fix for MDL-4940: Social Activities block disappears when editing course settings.
2007-02-24 23:38:42 +00:00
toyomoyo
217a8ee950 made some changes so that if a user has any roles assigned in context_module or context_block with moodle/site:manageblocks or moodle/course:manageactivities, he will see the "turn editting on" button without needing to have a role assigned at context_course with moodle/course:manageactivies capability. Of course this user would not be able to edit any blocks or modules he/she is not supposed to edit. Ajax for these users with partial editing privilages are locked. Please report bugs asap as we are looking at backporting this change to 1.8. Cheers. 2007-02-16 07:57:19 +00:00
skodak
84c8ede022 MDL-8343 reorganize frontpage settings in admintree - admin tree now allows to specify context together with required capability for each entry
MDL-8352 Fully separate CONTEXT_COURSE, SITEID from COURSE_SYSTEM - first part of cleanup related to frontpage
2007-01-29 21:29:27 +00:00
moodler
2ef9d19a51 Added skip links to all course formats to main content MDL-7878 2007-01-03 15:37:07 +00:00
vyshane
ea003a2338 Merged from 1.7. 2006-10-24 09:42:06 +00:00
moodler
3a52e764e4 New "Switch Role" functionality to replace the old "Student view".
It's not well-tested yet and probably doesn't quite work.  I will keep debugging this tonight from home.
2006-09-21 09:16:41 +00:00
skodak
d847bb32fd fixed non-working edit button on course page for teachers, added explanation comments 2006-09-17 17:32:45 +00:00
moodler
ea82d6b638 CHanged a lot of CFG->debug stuff to use the new debuggin() function 2006-09-13 09:45:07 +00:00
toyomoyo
17d6a25e5c adding capabilitiies 2006-09-13 09:08:14 +00:00
skodak
2b156ffbf3 old admin block not added into frontpage during installation anymore, it is not removed during upgrade. 2006-09-11 20:05:31 +00:00
toyomoyo
51792df056 adding capabilities 2006-09-08 08:46:26 +00:00
skodak
b1631fef28 add admin_tree to front page during install and upgrade 2006-09-03 18:37:41 +00:00
moodler
4d2401d524 Removed student view 2006-09-03 08:46:30 +00:00
skodak
ad0f9c828e Bug #6136 - Hard coded admin paths; merged from MOODLE_16_STABLE 2006-07-19 08:13:25 +00:00
moodler
f870b674a1 Take the course listing out of the default site page
because the default setting on site.php is to have it
in the middle of the page.
2006-04-10 15:38:34 +00:00
mjollnir_
aa898e41c1 Stickyblocks: fool pagelib into thinking it is course-view when it needs to be, rather than admin-stickyblocks 2006-03-17 03:17:44 +00:00
stronk7
ec6bee0f8e Prevent a warning when params is empty. Bug 4328.
(http://moodle.org/bugs/bug.php?op=show&bugid=4328)
2005-11-21 13:13:23 +00:00
mjollnir_
1217708363 My moodle sticky block config now generic, can be used for any pagetype.
Currently implemented: course-view (and my moodle, of course)
2005-10-16 22:34:25 +00:00
mjollnir_
4374ee2ca9 Fixing warnings in my moodle/ blocks /pagelib, plus moved page->edit_always to base class 2005-08-23 04:48:34 +00:00
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