Commit graph

158 commits

Author SHA1 Message Date
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
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
dhawes
c7e3bc51e2 spacing updates and addition of some phpdoc comments 2004-10-28 01:26:33 +00:00
dhawes
6195e04a9d clarified comments and added some spacing. 2004-10-25 03:30:48 +00:00
dhawes
43038ce6d7 added comment for new specialization function 2004-10-25 00:09:47 +00:00
dhawes
59b2920778 added spacing 2004-10-24 21:49:58 +00:00
dhawes
e1b8bdf8e3 some spacing added 2004-10-24 15:52:25 +00:00
defacer
9b4b78fd6a Da monster-commit of blocks version 2!
Code based on the work of Daryl Hawes for the blog module. Thanks, Daryl!

Please test the hell out of it as it's sure to have issues that need to be
ironed out.
2004-10-19 21:04:28 +00:00
stronk7
5b224948aa course/view.php is using sesskey
(changes in blocks done, please check them)

Merged from MOODLE_14_STABLE
2004-10-09 20:16:05 +00:00
moodler
c347053d5e Changes for XHTML compatibility 2004-10-07 07:25:19 +00:00
gustav_delius
839f2456bb XHTML compliance
- fixed (hopefully) all <img> tags
- global replace on <br> to <br />
- &amp; in URLs
- got the forum module XHTML compliant
Julian Sedding
2004-09-16 17:13:57 +00:00
defacer
2b0d60ec78 Fix for bug 1662:
Changed the way applicable formats for blocks are handled. The changes are
short codewise, but to grasp all the implications read the forum discussion
at the relevant URL.
2004-08-22 16:54:48 +00:00
gustav_delius
7a1efb695d fixed the problem that people trying to move blocks accidentally deleted them. 2004-08-21 09:01:01 +00:00
defacer
4e60e777a3 As per Gustav's suggestion in bug 1507, changing the default behavior for
blocks to make them available in the site page, too. Also, minor spelling correction.
2004-06-01 10:45:12 +00:00
gustav_delius
e48550e0b8 fixed empty boxes bug reported in http://moodle.org/mod/forum/discuss.php?d=8432 2004-05-29 10:35:57 +00:00
defacer
22931cf410 Bugfix: blocks with no content at all show up as shadows when editing. 2004-05-28 13:57:09 +00:00
defacer
89adb17442 Merging the changes from 1.4 dev branch (site index blocks + various bugfixes) 2004-05-28 10:53:54 +00:00