- Open \theme\standard\config.php (assume you are using "standard" theme)
- Find the last element of $THEME->sheets (should be css3 if you have not done anything yet)
- Open \theme\standard\style\css3.css and add your css code
- Goto \moodledata\cache\theme\standard\css and delete all files (anyone have a better way?)
- Done
Moodle 2.0
2011年4月3日 星期日
Add a style (CSS)
2011年3月14日 星期一
Set up role permission
First, add this to \mod\your_module\db\access.php (after line $capabilities = array( )
Open \mod\your_module\lang\en\your_module.php, add this line:
$string['your_module:view'] = 'View your module';
Change version.php to new version, and then goto Notification.
Use this to test the permission:
'mod/your_module:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'teacher' => CAP_ALLOW
)
)
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'teacher' => CAP_ALLOW
)
)
Open \mod\your_module\lang\en\your_module.php, add this line:
$string['your_module:view'] = 'View your module';
Change version.php to new version, and then goto Notification.
Use this to test the permission:
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
has_capability('mod/your_module:view', $context)
has_capability('mod/your_module:view', $context)
2011年3月12日 星期六
2011年3月10日 星期四
Make new module with groupING
In mod_form.php, add this line:
$this->_features->groupings = true;
Note: But i still wonder why others module don't add this line but they are still available for groupING, any idea?
$this->_features->groupings = true;
Note: But i still wonder why others module don't add this line but they are still available for groupING, any idea?
2011年3月8日 星期二
Add a table to Module Database
- Site administration -> Development -> XMLDB editor
- Find your module and click [Load]
- Click [Edit]
- Click [New table] and fill in the detail
- Click [Back]
- Click [View PHP code]
- Select action: create table
- Select table: select your table name
- Click "View"
- Copy the code to mod/your_mod/db/upgrade.php
- Change XXXXXXXXXX to new version number (e.g. 2011022301)
- Open mod/your_mod/version.php, change $module->version to the new version number
- Notification
- Done
2011年2月27日 星期日
Create a new format
- Goto course/format/ (read the README.txt there)
- Copy topics folder to a new folder (e.g. yourformat)
- Goto yourformat/lang/en/
- Rename "format_topics.php" to "format_yourformat.php"
- Open format_yourformat.php
- Change the $string
- Done.
2011年2月22日 星期二
訂閱:
文章 (Atom)