74 Commits

Author SHA1 Message Date
toyomoyo
aa5a393738 merged fix for MDL-7441, wrong size for roles icon 2006-11-13 05:43:41 +00:00
skodak
17e5635c36 fixed 'capabilitities' typos and removed forgotten debug_print_backtrace() commited with MDL-6728 2006-10-08 11:00:49 +00:00
skodak
6859360cd4 coverted /admin/ to proper /$CFG->admin/ in paths 2006-09-26 21:10:14 +00:00
sam_marshall
a82e9bc3bb Added feature to blocks (and restorelib) so that blocks get a method call (default does nothing) after they are restored. This allows blocks to change their settings if necessary in respect of the new course roll-forward 'restore and change start date' feature that Al implemented recently. The core blocks happen not to store dates anyway so don't need this, but contributed blocks may well do. 2006-09-21 12:07:15 +00:00
skodak
6124048972 major whitespace cleanup - fixed tabs 2006-09-20 20:31:09 +00:00
moodler
09a89b01d0 Nuked nuke. 2006-09-18 03:28:02 +00:00
moodler
6d0bd10c0a A temporary icon for roles (needs work!) 2006-09-06 02:16:48 +00:00
skodak
02cc05a708 fixes for new admin blocks 2006-09-02 23:55:56 +00:00
skodak
35a518c5de fixed admin defaults, some warnings during install and added trmporary hack to make $CFG->notloggedinroleid work 2006-09-02 10:03:30 +00:00
moodler
7468981e67 FIxed roles button on blocks 2006-08-24 03:48:04 +00:00
moodler
28e7967aea FIxed some notices 2006-08-24 03:28:09 +00:00
moodler
0a0bb38019 Ed Coyne's AJAX course format, with some cleanups done.
More cleanups to come from Ed.

This isn't actually working for me right now but he'll fix it now.

This is completely optional and won't affect any other code right now.
2006-08-24 03:20:37 +00:00
vyshane
01199ea958 Updated to use new Roles System. Plus some fixes. 2006-08-16 08:54:07 +00:00
moodler
0468976c9a SWEEPING CLEANUP
The API was changed slightly so that has_capability now takes the
whole $context object (we almost always have it anyway)

The $kill thing was removed.   If you want to assert a capability
then use:

    require_capability('capname', $context);

with optional variables to modify the error message

Misc bugs here and there also removed and code tidied
2006-08-14 05:55:40 +00:00
moodler
bbbf2d4015 ROLES AND PERMISSIONS - FIRST CHECK-IN
=======================================

WARNING:  DEV IS CURRENTLY VERY UNSTABLE.

This is a mega-checkin of the new Roles system.   A lot of changes have
been made in core and modules.

Currently there are a lot of rough edges and known problems.  We are
working hard on these .. .the reason for getting this into HEAD at this
stage is enable us to move faster (our branch was diverging from HEAD
too much).

Please keep an eye on http://docs.moodle.org/en/Roles for current status
and information for developers on how to use the new Roles system.
2006-08-08 05:13:06 +00:00
sam_marshall
44c55d4662 Added hooks so that blocks can create functions that are run when they are installed and uninstalled. The base implementation does nothing. 2006-07-14 11:17:46 +00:00
nfreear
782792047b Fix bug 5611 (Skip block), across 4 files. Extra parameter $title in weblib.php: print_side_block, edits to moodleblock.class.php, Standard style, en_utf8 language pack. 2006-06-09 14:25:18 +00:00
nfreear
68ac3b35e0 Accessibility: moved H2 from weblib.php: print_side_block_start, to moodleblock.class.php: _title_html (validate, <span>s revert to <div>); skip block link - replaced pixel image with 'accesshide' text; use get_string. 2006-03-06 12:50:43 +00:00
nfreear
02db7f7a02 Accessibility: function _title_html, replaced <div> with H2, enclosed <div> to <span> - now validates! 2006-02-28 13:12:13 +00:00
mjollnir_
f9648e77cf Added cron support for blocks - it was already there in the tables, now we just need to use it 2006-02-14 03:24:08 +00:00
defacer
8eefd42e7e Oops. Forgot some debug code in there. 2005-12-17 04:53:50 +00:00
defacer
1130633117 NEW FEATURE:
Per-block access controls for creating and editing block instances. Defaults
behave the same as before, and the framework has final say as before.

See relevant discussion at http://moodle.org/mod/forum/discuss.php?d=36444



Other minor changes: Converted "continue" to "break" inside switch statements
(more to the point, although equivalent), change erroneous (but harmless)
"return false" to "break" on failed addition of block instance, removed some
inline comments from block_base (they were duplicated in PHPdoc)
2005-12-17 04:37:55 +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
mjollnir_
5d3715d492 Removed tiny amount of unncessary code I added as part of the my moodle block stuff yesterday 2005-08-16 23:17:56 +00:00
mjollnir_
0d6b9d4f4d MyMoodle: new /my/ page, contains course overview (module based, forum done). User defined blocks on /my/ page, admin defined stickyblocks. Needs lots of testing. Held off bumping version.php for blocks because of the postgres upgrade fixes Patrick is putting in. 2005-08-16 00:25:39 +00:00
defacer
b33dd23adc Merging from STABLE:
Implementing Dan Marsden's great idea for additional hooks when block
instances are deleted (bug 3446). Going a step further and adding hooks
for when block instances are created.
2005-06-13 03:32:31 +00:00
defacer
c4d951e1f8 Here be DIVs. 2005-05-10 04:00:56 +00:00
defacer
88bbf2efff Visual improvement: blocks which are "hidden" (eye icon) now shown exactly
like collapsed blocks (minus sign) when editing is on.
2005-05-09 23:11:25 +00:00
moodler
dd54dea610 Removed an inline style on list blocks 2005-03-26 02:35:29 +00:00
moodler
5a46b1566c Added proper styles to block buttons 2005-03-07 12:08:44 +00:00
defacer
96803c8810 Moved a bunch of inline styles to the stylesheets. 2005-03-02 19:47:04 +00:00
defacer
76a8339a91 Small fix, changing break; to return; now that there's no switch() 2005-03-02 19:29:50 +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
d232b8c701 Updating the guide and some comments to be up to date with the latest
and greatest inner workings. sigh.
2005-02-11 06:30:50 +00:00
defacer
29ba5158ad Introducing instance ids as id attributes in blocks. This should completely
solve the problem where two instances of the same block did confusing things
when you tried to collapse one of them.

Incidentally, moving some styles for quiz_results block to where they belong.
2005-02-10 00:50:08 +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
673c1b2f13 Fixing a serious bug with PHP 5 only, which caused blocks to lose
their configuration data (there is an explanation but I don't think
anyone cares).

Actually it was an optimization and I had to disable it. All is fine now.
2005-02-05 01:32:15 +00:00
defacer
1ef61c260d Pull all blocks out of quiz pages. We can see about allowing them later. 2005-02-01 10:02:12 +00:00
defacer
0144a0a701 Add a very useful feature to block_base to make instance config even more
convenient to use. And take advantage of it to make the block run faster.
2005-02-01 06:51:00 +00:00
moodler
0705dcc035 Removed some $THEME and added some new classes for the blockconfiginstance
and blockconfigglobal boxes
2005-01-29 04:01:15 +00:00
defacer
1345403a7c Renaming 4 internal-use-only class methods by prefixing an underscore.
I want to make a point that people should NOT be calling them.
2005-01-25 02:57:30 +00:00
defacer
abea5d6940 Fix for bug 2371:
The alt text is now the same as the tooltip for the block control icons in
editing mode (i.e., language pack configurable).
2005-01-17 14:51:18 +00:00
defacer
67677908a0 Fixing the alt attributes for the icons used to move/hide etc. blocks when
editing is on. Also a few minor corrections for things inside comments.
2005-01-11 19:38:19 +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
db019d9358 Ummm... more changes due to the renaming. 2004-11-25 17:35:25 +00:00
defacer
e89d741af3 New naming conventions for class names to bring them in line with the
rest of Moodle. The convention for blocks is now:

class block_something extends block_base { ... }

HOWTO updated accordingly, plus some more minor polishing. More to come.
2004-11-23 18:53:34 +00:00
moodler
735547525a Added dummy constructor to keep PHP5 happy. 2004-11-22 16:09:06 +00:00
defacer
331063054a Slight change to the HOWTO to be more clear.
Removed the $course var from MoodleBlock (useless now).
2004-11-20 19:36:47 +00:00
defacer
f8582e3e0a Tweaked class MoodleBlock some. Removed a useless function (how did it get in here?)
and renamed handle_config(), print_config() to config_save(), config_print() for
consistency with the new instance_ functions().

Removed that old and obsolete README file.
2004-11-19 02:41:32 +00:00
dhawes
e0134f842c added comments and some spacing cleanup 2004-11-10 16:43:57 +00:00