6: 2010-05-16 (日) 12:06:57 admin |
現: 2013-03-20 (水) 09:39:44 iseki |
| ** Moodle1.9 Programing [#l2cb4679] | | ** Moodle1.9 Programing [#l2cb4679] |
- | - http://docs.moodle.org/en/Development:Blocks | + | - http://docs.moodle.org/dev/Blocks/Blocks_for_1.5_to_1.9 |
| #br | | #br |
| | | |
| *** POST, GET [#i893cfed] | | *** POST, GET [#i893cfed] |
| - required_param('course', PARAM_INT); | | - required_param('course', PARAM_INT); |
- | - optional_param('mode', '', PARAM_ALPHA); | + | - optional_param('mode', default, PARAM_ALPHA); |
| #br | | #br |
| | | |
| | | |
| **** get_record(s) [#z3e3f469] | | **** get_record(s) [#z3e3f469] |
- | - get_record($table, $field1, $value1, $field2='', $value2='', $field3='', $value3='', $fields='*') | + | - get_record($table, $field1, $value1, $field2="", $value2="", $field3="", $value3="", $fields='*') |
- | if ($user = get_record("user", "id", $USER->id)) { | + | if ($user = get_record('user', 'id', $USER->id)) { |
| $firstname = $user->firstname; | | $firstname = $user->firstname; |
| } | | } |
- | - get_records($table, $field='', $value='', $sort='', $fields='*', $limitfrom='', $limitnum='') | + | - get_records($table, $field="", $value="", $sort="", $fields='*', $limitfrom="", $limitnum="") |
| if (!$vars = get_records('autoattend_settings', 'courseid', $courseid, 'id')) { | | if (!$vars = get_records('autoattend_settings', 'courseid', $courseid, 'id')) { |
| $vars = get_records('autoattend_settings', 'courseid', 0); // use default | | $vars = get_records('autoattend_settings', 'courseid', 0); // use default |
| } | | } |
| else { | | else { |
- | $result = insert_record('autoattend_settings', $rec); | + | $result = insert_record('autoattend_settings', $rec); |
| } | | } |
| unset($rec); | | unset($rec); |