From d49f500f5277b99b911ad421e61f4fb466857ad8 Mon Sep 17 00:00:00 2001 From: defacer Date: Tue, 25 Jan 2005 03:01:09 +0000 Subject: [PATCH] Oops, I committed this along with the function renames by mistake. Anyway, now fixing a small cosmetic glitch and giving the correct commit message: The latest and greatest version of the blocks documentation is here... Lots of work and polishing to make it as useful as possible. I daresay that it's pretty complete for its purpose now. --- blocks/HOWTO.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/HOWTO.html b/blocks/HOWTO.html index b6aca316d6..6a5e3eb6f8 100644 --- a/blocks/HOWTO.html +++ b/blocks/HOWTO.html @@ -166,7 +166,7 @@

$this->content_type tells Moodle what kind of content to expect from this block. Here we have two simple choices. Either we set it to BLOCK_TYPE_TEXT, which tells Moodle to just take our content and display it on screen as-is; or we set it to BLOCK_TYPE_LIST, which tells Moodle that we want our block to display a nicely formatted list of items with optional icons next to each one. We can use BLOCK_TYPE_TEXT to manually create any content we want (do not be fooled by the name; HTML is allowed in the block's content without restriction) or use BLOCK_TYPE_LIST to easily create a simple menu.

-

$this->version is the version of our block. This actually would only make a difference if your block wanted to keep its own data in special tables in the database (i.e. for very complex blocks). In that case the version number is used exactly as it's used in activities; an upgrade script uses it to incrementally upgrade an "old" version of the block's data to the latest. We will outline this process further ahead, since blocks tend to be relatively simple and not hold their own private data. In our example, this is certainly the case so we just set $this->version to YYYYMMDD00 and forget about it.

+

$this->version is the version of our block. This actually would only make a difference if your block wanted to keep its own data in special tables in the database (i.e. for very complex blocks). In that case the version number is used exactly as it's used in activities; an upgrade script uses it to incrementally upgrade an "old" version of the block's data to the latest. We will outline this process further ahead, since blocks tend to be relatively simple and not hold their own private data. In our example, this is certainly the case so we just set $this->version to YYYYMMDD00 and forget about it.

UPDATING: Prior to version 1.5, the basic structure of each block class was slightly different. Refer to Appendix B for more information on the changes that old blocks have to make to conform to the new standard.

-- 2.39.5