295 Commits

Author SHA1 Message Date
tjhunt
02b126af8a blocks editing ui: MDL-19398 permissions checks when deleting a block. 2009-07-14 11:16:21 +00:00
tjhunt
1936f20b8b blocks editing ui: MDL-19398 move generating the block edit icons to blocklib.php
Since that is where the resulting actions are processed.
2009-07-14 10:57:06 +00:00
tjhunt
727ae4362e blocks editing ui: MDL-19398 fix adding a block to a page that forgets to call $PAGE->set_url. 2009-07-14 10:41:59 +00:00
tjhunt
2a3b076368 blocks editing ui: MDL-19398 fix some bugs with adding a block. 2009-07-14 09:28:10 +00:00
tjhunt
a2789e3426 blocks editing ui: MDL-19398 add block now secure. Delete block works insecurely.
Will add security checks in a moment.
2009-07-14 08:37:28 +00:00
tjhunt
21d33bdf62 blocks editing ui: MDL-19398 you can now add new blocks! 2009-07-14 07:18:57 +00:00
tjhunt
e92c286c20 block contexts: MDL-19098 every block should have a context
even non-course and sticky blocks.

The parent context is block_instances.parentcontextid.

The block context should be used for checking permissions directly
related to the block, like moodle/block:view or moodle/site:manageblocks.

However, if the block is displaying information about the current page,
for example the participants block showing who 'here', then it may be
better to use the context of the page where the bloack is appearing -
in other words $this->page->context - to check permissions about the
user's ability to see participants here.

Or, if the block is displaying something stronly related to courses,
for example, a course meny block, the block should probably use the
context for $this->page->course to check permissions.
2009-07-13 08:37:34 +00:00
tjhunt
13a0d3d3c9 blocks MDL-19536: rename block_instances.contextid to parentcontextid to avoid gross confusion 2009-07-10 05:58:59 +00:00
tjhunt
fc2593fef9 blocks - MDL-19010 fix bug where blocks did not show up with editing off. 2009-07-09 08:17:23 +00:00
tjhunt
d4a03c00ea themes & blocks - MDL-19077 & MDL-19010 blocks are now printed by the theme
The code to print blocks in now in theme layout.php files. (Or in
moodle_core_renderer::handle_legacy_theme)

Code for printing blocks everywhere else has been stripped out.
(Total diffstat 1225 insertions, 2019 deletions)

The way the HTML for a block instance is generated has been cleaned
up a lot. Now, the block_instance generates a block_contents
object which gives a structured representation of the block,
and then $OUTPUT->block builds all the HTML from that.

How theme config.php files specify the layout template and block
regions by page general type has been changed to be even more flexible.

Further refinement for how the theme and block code gets initialised.

Ability for scrits to add 'pretend blocks' to the page. That is,
things that look like blocks, but are not normal block_instances.
(Like the add a new block UI.)

Things that are still broken:
 * some pages in lesson, quiz and resource. I'm working on it.
 * lots of developer debug notices pointing out things that
   need to be updated.
2009-07-09 07:35:03 +00:00
tjhunt
b70094743a themes: MDL-19077 change how the theme is initialised and CSS is served.
This is part of http://docs.moodle.org/en/Development:Theme_engines_for_Moodle%3F

$THEME is now initialised at the same time as $OUTPUT. Old functions like
theme_setup are deprecated in favour of methods on $PAGE. There is a new
theme_config class in outputlib.php that deals with loading the theme config.php file.

CSS used to be served by themes styles.php files calling a function in weblib.php.
Now it works by each theme's styles.php file doing
$themename = basename(dirname(__FILE__));
require_once(dirname(__FILE__) . '/../../theme/styles.php');
which is less code to be copied into each theme. (Old-style styles.php files still
work thanks to some code in deprecatedlib.php.)

Admin UI for choosing a theme cleaned up.

A couple of theme-specific hard-coded hacks like $THEME->cssconstants and
$THEME->CSSEdit have been replaced by a more generic $THEME->customcssoutputfunction
hook. See examples at the end of outputlib.php

Also:
* Fix setting the theme in the URL, which seems to have been broken since 1.9.
* Fix up errors on a few pages caused by the new initialisation order.
* MDL-19097 moodle_page::set_course should not set $COURSE unless it is $PAGE.
* httpsrequired() from moodlelib.php moved to $PAGE->https_required().
* Move has_started() method to the renderer base class.
* Further fixes to display of early errors.
* Remove print_header/footer_old from weblib. I did not mean to commit them before.
2009-07-01 05:54:26 +00:00
tjhunt
c679c3582a Fix some fallout from the pagelib changes. 2009-06-12 11:56:30 +00:00
samhemelryk
d4accfc0ad blocklib.php MDL-19236 added phpdocs and copyrights 2009-05-22 02:18:49 +00:00
tjhunt
6cbcbf0fb3 blocklib: MDL-19010 eliminate remaining calls to blocks_repopulate_page 2009-05-08 08:22:59 +00:00
tjhunt
e03c0c1d49 blocklib: MDL-19010 fix editing block config and block roles. 2009-05-08 07:47:50 +00:00
tjhunt
f4d38d20fb blocklib: MDL-19010 and now you can delete blocks too! 2009-05-08 06:34:40 +00:00
tjhunt
7130fb212c blocklib: MDL-19010 once again you can add blocks, at least on the coures page. 2009-05-08 03:30:58 +00:00
tjhunt
1d00ec6a6a blocklib: MDL-19010 finally fix the regressions that mean that you could not create a new course. 2009-05-08 03:11:24 +00:00
tjhunt
feed19003c blocks: MDL-19010 Fix, or prevent being executed, all references to blocks_insance_old inside blocklib.php 2009-05-07 09:16:22 +00:00
tjhunt
f474a4e583 blocks: MDL-19010 Fix further blocks-related breakage, including removing all references to blocks_insance_old outside blocklib.php 2009-05-07 08:55:10 +00:00
tjhunt
9d1d606e0d blocklib: MDL-19010 fix new install.
* Fix the blocks bit of build_context_path
* Replace blocks_repopulate_page
* Make starting_output work during setup
2009-05-07 07:05:22 +00:00
tjhunt
d19e819597 blocklib: MDL-19010 move the check for whether the right database tables exist to a place where it is better encapsulated. 2009-05-07 02:56:48 +00:00
tjhunt
f2c6739c39 blocklib: MDL-19010 rename $position -> $region throughout blocklib.php 2009-05-06 09:27:02 +00:00
tjhunt
6bf44482c6 pagelib: MDL-12212 eliminate quiz_page 2009-05-06 09:24:45 +00:00
tjhunt
1b6b940022 moodle_page: MDL-12212 eliminate page_my_moodle 2009-05-06 09:23:37 +00:00
tjhunt
bb46a4fa2a blocklib: MDL-19010 refactor blocklib to use block_manager to get the blocks for rendering 2009-05-06 09:15:05 +00:00
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
93d4a373f9 blocklib: MDL-19010 always include blocklib in setup.php, stip includes elsewhere 2009-05-06 09:13:16 +00:00
tjhunt
66b10689e2 blocklib: MDL-19010 upgrade database tables ready for now blocks system 2009-05-06 09:12:03 +00:00
tjhunt
d7f688d46a moodle_page: MDL-12212 eliminate page::edit_always 2009-05-06 08:56:44 +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
ad5d5997ed moodle_page: MDL-12212 more ->pagepaths to kill 2009-05-06 08:43:51 +00:00
tjhunt
e88462a055 moodle_page: MDL-12212 eliminate the two different interpretations of
pagetype
2009-05-06 08:41:02 +00:00
tjhunt
d529807a65 moodle_page: MDL-12212 kill $CFG->pagepath (use $PAGE->set_pagetype)
deprecate $PAGE->get_format_name (use $PAGE->pagetype)
deprecate page_id_and_class (use $PAGE->pagetype)
2009-05-06 08:38:55 +00:00
tjhunt
cd2bc3c98a moodle_page: MDL-12212 rewrite blocks_name_allowed_in_format to improve readability 2009-05-06 08:36:50 +00:00
tjhunt
f230ce19ea moodle_page: MDL-12212 implement ->pagetype 2009-05-06 08:34:32 +00:00
tjhunt
e8c8cee99a blocklib: MDL-19010 add standard boilerplate at the top of the file. 2009-04-30 03:50:00 +00:00
skodak
795a08adb7 MDL-17458 upgrade logging implemented + a lot more refactoring + exceptions implemented in install/upgrade code + lang pack cleanup + some more improvements 2009-01-31 20:07:32 +00:00
skodak
0cb93a7e45 MDL-17427 another round of refactoring of upgrade related functions - this should be final now I hope ;-) 2009-01-29 19:58:47 +00:00
skodak
1045a0074c MDL-17849 sql queries not printed by default during upgrade anymore, there is a new config.php only setting $CFG->upgradeshowsql instead 2009-01-12 16:52:53 +00:00
skodak
5c144d605e MDL-17845 now only one page per installs/upgrade :-D 2009-01-12 15:13:44 +00:00
skodak
3e46c66a5d MDL-17427 - removed old file based logging from ugprade - going to add new upgrade logging later 2009-01-11 10:18:53 +00:00
skodak
1caea91efb MDL-17457 moved a lot of code into lib/db/install.php + other refactoring and cleanup 2009-01-11 09:41:48 +00:00
skodak
704f4cdb7a MDL-17845 moved blocks code from /blocks/db/* to core 2009-01-10 22:01:20 +00:00
skodak
ab2eb65c88 MDL-17846 moved blocks code from /blocks/db/* to core 2009-01-10 21:06:53 +00:00
skodak
27bd819be5 MDL-17848 oops, yet more cron compatibility fixes for console_write() ;-) I have added a new console_write_error() too 2009-01-10 20:44:45 +00:00
tjhunt
19f5b2dbee accesslib: MDL-17626 delete the context whenever a block is deleted. This includes a new helper function blocks_delete_all_on_page. 2009-01-09 06:16:36 +00:00
mjollnir_
ee1efe0b0f MDL-17694: very small stickyblocks improvements (Merged from MOODLE_19_STABLE) 2008-12-19 09:49:33 +00:00
skodak
775f811a66 MDL-16002 rewritten upgrade locking and better upgrade progress tracking; MDL-16070 Do not use $a[0] syntax in lang packs + various other upgrade improvements and fixes 2008-08-16 12:16:01 +00:00