7
That's it!
Quote:
- If you want to make a block template, firstly, you should change the xoopsversion.php of the module you are going to use (if you want a general block use system module)
- Copy the last block section in xoopsversion.php and paste it just below, changing: $modversion['blocks'][i] to $modversion['blocks'][i+1] in each one of the option lines.
At least the way I understand it. And now lets try to figure out the thing with parameters:
Quote:
1) File: the php file that the block should use to withdraw it's variables
Something like this here.
Everything thay needs to be initialized for the block comes from this file.
Quote:
2) Name: _MI_"modulename"_BNAME(i+1) (this is typically the form of the name, i don't know if it's necessary to be like this)
It's just the constant name that the system will use for this block. You have to give it a text name in your module/language/yourlanguage/modinfo.php file, sth like
Quote:
define('_MI_MODULENAME_BLOCKNAME','Title of your block');
i.e. just add such a line there (you'll find similar already defined for the other available blocks). This is the name of the block that will appear in your admin's blocks list.
Quote:
3) Description: Your description about the block enclosed in double quotes
I'm missing where this description comes for, but at least it's just block description
Quote:
4) show_func: (not tested) I believe this is a function from "File" whose results will be in the block. (i believe this is optional)
I don't think it's optional, cause I find it for every other module's block I look at now. So the .php file we already mentioned in 1) just defines it in itself and it's called so the block to be visualized.
Quote:
5) template: The html file that will generate the block's appearance
OK, so we came with it from the real begining and no questions come here I think
.
Quote:
6) options: (not so sure again) Options for the function that was retrieved with "show_func" (-=optional=-)
You can find in some of the other blocks that they has some options for themselves, some values that they use in their visualization. So this field just defines the default options values delimeted by '|' I think.
Quote:
7) edit_func: I don't know what exactly this does but it is optional either way.
Like we had show_func for showing the block here we have edit_func it seems for editing
. But I'm not sure the way it is used, have to look around.
Hey, it came long but it's at the end now
. Hope we've cleared things for ourselves now. Good luck!