- Got to moodle/blocks/
- Create a folder: your_new_block
- Copy blog_menu/*.* to your_new_block/ (as blog_menu is a simple block)
- Go to your_new_block folder
- Rename block_blog_menu.php to block_your_new_block.php
- Open block_your_new_block.php
- Remove the "require_once" line at the top
- Change "class block_blog_menu extends block_base {" to "class block_your_new_block extends block_base {"
- In init(), change "$this->title = get_string('pluginname', 'block_blog_menu');" to "$this->title = get_string('pluginname', 'block_your_new_block');"
- In get_content(), you can delete from "* Prepare the content for this block" to "// Return the content object", just keep the last return line.
- All you have to do is fill in $this->content->text = "Your block content html";
- Go to lang\en\ folder
- Rename block_blog_menu.php to block_your_new_block.php
- Open the file, change "$string['pluginname'] = 'Blog menu';" to your block displace name
- Notifications
- Done
2011年1月26日 星期三
Create a new block
Assume the new block name is your_new_block:
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言