Commit Graph

18 Commits

Author SHA1 Message Date
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 3179b0006a blocklib: MDL-19010 Fix blocks that were relying on ->instance in an unfortunate way 2009-05-06 09:15:33 +00:00
skodak e8a7edd7d6 MDL-17236 html block: proper cleanup of html 2008-11-19 16:46:41 +00:00
skodak f28f2d9022 MDL-14679 towards blocks conversion 2008-06-02 20:15:51 +00:00
dongsheng f36acb35fb MDL-14111, multilang htmlblock title, merged from MOODLE_19_STABLE 2008-04-01 05:57:00 +00:00
stronk7 83fc40040b Prevent cloning of non-object. Delegate to parent method as fallback. MDL-14120 ; merged from 19_STABLE 2008-03-31 22:52:17 +00:00
skodak 5cfefc9b02 MDL-8270 full block backup/restore - based on patches by Mark Nielsen and code in HEAD by Tim Hunt; merged from MOODLE_19_STABLE 2008-03-23 15:54:42 +00:00
moodler 433c242f1a Merged new block versions from 1.9 2008-03-03 11:43:32 +00:00
poltawski 2d035282fe remove debugging message, merged from MOODLE_19_STABLE 2007-12-29 12:07:08 +00:00
tjhunt 43457dc87c MDL-12066 - Links in the HTML block are not recoded on backup and restore.
This is messy because the links are hidden in the configdata column, which is serialized and base64encoded. So we have to untangle that, then ask the block whether there are any bits of $config that need to be fixed, then re-encode it before backup up. And reverse that on restore. It needs to remain base64 encoded in the backup file, so that the file format is backwards compatible.

I disucssed this with Eloy before doing it.

Merged from MOODLE_19_STABLE.
2007-11-14 17:03:32 +00:00
defacer e345909c50 Now that the extended multilang filter is in place (bug 2879),
reintroducing format_text to the HTML block (bug 2878).
2005-05-19 20:09:57 +00:00
moodler 381576d219 Undoing PJs change - sorry. HTML tags were being completely filtered out.
Trying to come up with another solution to work with multilang
tags (Bug 2878) (SE).
2005-05-18 01:49:56 +00:00
defacer 7c7d56bbd9 Fix for bug 2878:
HTML block now calls format_string to run filters as required.
2005-05-17 15:01:10 +00:00
defacer 48f7fa4a60 Small improvement to HTML block; new html blocks have a default title instead of none. 2005-03-02 19:31:11 +00:00
defacer 3ef642d96a Implemented discussion from bug 2547:
* Block authors no longer need to set $this->content_type
* If you want to make a "list" block, just derive from block_list
  instead of block_base
* All switch() statements gone from library code
* Overloaded method is_empty() added to block classes for convenience
2005-03-02 19:22:26 +00:00
defacer b959599b51 Allow this in quiz pages, too. 2005-02-01 10:03:54 +00:00
moodler 63689c58b1 Some fixes to avoid notices etc 2005-01-29 03:55:29 +00:00
moodler 86db09ef85 Added Jon's html block from contrib! Thanks, Jon! 2005-01-29 03:48:45 +00:00