Home
News
Forum
Wiki
Blog
Contents
Gallery
Movies
Downloads
About NSL
[
List of Titles
|
List of Pages
|
New
|
Search
|
Recent changes
|
Help
]
Moodle/Programming/1.9
[
Front page
]
[ ]
Start:
** Moodle1.9 Programing
- http://docs.moodle.org/dev/Blocks/Blocks_for_1.5_to_1.9
#br
*** global 変数
**** $CFG
- $CFG->wwwroot : top url
- $CFG->prefix
**** $USER
- メンバ変数例
-- id => 2
-- username => admin
-- firstname => 管理
-- lastname => ユーザ
-- email => iseki@solar-system.tuis.ac.jp
-- emailstop => 0
-- city => 千葉市
-- country => JP
-- lang => ja_utf8
-- timezone => 9.0
-- firstaccess => 1259809008
-- lastaccess => 1273976520
-- lastlogin => 1273631570
-- currentlogin => 1273761631
**** $_POST
- empty($_POST)
#br
*** POST, GET
- required_param('course', PARAM_INT);
- optional_param('mode', default, PARAM_ALPHA);
#br
*** 権限
- isadmin()
- isguest()
- require_login($course->id);
- isteacher($course->id)
#br
*** メッセージ
- get_string( , )
#br
*** DataBase
- lib/dmllib.php
#br
**** count_records
$count = count_records('autoattend_sessions', 'courseid'...
**** get_record(s)
- get_record($table, $field1, $value1, $field2="", $value...
if ($user = get_record('user', 'id', $USER->id)) {
$firstname = $user->firstname;
}
- get_records($table, $field="", $value="", $sort="", $fi...
if (!$vars = get_records('autoattend_settings', 'coursei...
$vars = get_records('autoattend_settings', 'courseid'...
}
**** get_records_sql
$qey = "SELECT * FROM .......";
if ($users = get_records_sql($qry)) {
foreach($users as $key => $user) {
$return['id'] = $user->id;
$return['attsid'] = $user->attsid;
.............................
}
}
**** update_record, insert_record
$update = false;
if ($rec = get_record('autoattend_settings', 'courseid',...
$update = true;
}
$rec->courseid = $course->id;
............................
if ($update) {
$result = update_record('autoattend_settings', $rec);
}
else {
$result = insert_record('autoattend_settings', $rec);
}
unset($rec);
**** delete_records
delete_records('autoattend_settings', 'courseid', $cours...
**** XMLDB
- http://dev.moodle.org/mod/resource/view.php?id=48
- block にディレクトリを作成し,その中に dbディレクトリを...
- 「サイト管理」→「その他」→「XMLDBエディタ」 でデータベ...
#br
*** ログ
- add_to_log($course->id, 'autoattend', 'restore settings...
#br
*** Form
#br
*** settings.php
- admin_setting_configtext
- admin_setting_configcheckbox
- admin_setting_configselect
**** Moodle Data Cleaning Parameters
- PARAM_RAW: specifies a parameter that is not cleaned or...
- PARAM_CLEAN: Obsolete, please try to use a more specifi...
- PARAM_INT: Integers only, use when expecting only numbers
- PARAM_INTEGER: Alias for PARAM_INT
- PARAM_ALPHA: Contains only english letters.
- PARAM_ACTION: Alias for PARAM_ALPHA, use for various ac...
- PARAM_FORMAT: Alias for PARAM_ALPHA, use for names of p...
- PARAM_NOTAGS: All HTML tags are stripped from the text....
- PARAM_MULTILANG: Alias of PARAM_TEXT.
- PARAM_TEXT: General plain text compatible with multilan...
- PARAM_FILE: Safe file name, all dangerous chars are str...
- PARAM_PATH: Safe relative path name, all dangerous char...
-- note: The leading slash is not removed, window drive l...
- PARAM_HOST: expected fully qualified domain name (FQDN)...
- PARAM_URL: expected properly formatted URL.
- PARAM_LOCALURL: expected properly formatted URL as well...
- PARAM_CLEANFILE: safe file name, all dangerous and regi...
- PARAM_ALPHANUM: expected numbers and letters only.
- PARAM_BOOL: converts input into 0 or 1, use for switche...
- PARAM_CLEANHTML: cleans submitted HTML code and removes...
-- note: do not forget to addslashes() before storing int...
- PARAM_ALPHAEXT: the same contents as PARAM_ALPHA plus t...
- PARAM_SAFEDIR: safe directory name, suitable for includ...
- PARAM_SEQUENCE: expects a sequence of numbers like 8 to...
End:
** Moodle1.9 Programing
- http://docs.moodle.org/dev/Blocks/Blocks_for_1.5_to_1.9
#br
*** global 変数
**** $CFG
- $CFG->wwwroot : top url
- $CFG->prefix
**** $USER
- メンバ変数例
-- id => 2
-- username => admin
-- firstname => 管理
-- lastname => ユーザ
-- email => iseki@solar-system.tuis.ac.jp
-- emailstop => 0
-- city => 千葉市
-- country => JP
-- lang => ja_utf8
-- timezone => 9.0
-- firstaccess => 1259809008
-- lastaccess => 1273976520
-- lastlogin => 1273631570
-- currentlogin => 1273761631
**** $_POST
- empty($_POST)
#br
*** POST, GET
- required_param('course', PARAM_INT);
- optional_param('mode', default, PARAM_ALPHA);
#br
*** 権限
- isadmin()
- isguest()
- require_login($course->id);
- isteacher($course->id)
#br
*** メッセージ
- get_string( , )
#br
*** DataBase
- lib/dmllib.php
#br
**** count_records
$count = count_records('autoattend_sessions', 'courseid'...
**** get_record(s)
- get_record($table, $field1, $value1, $field2="", $value...
if ($user = get_record('user', 'id', $USER->id)) {
$firstname = $user->firstname;
}
- get_records($table, $field="", $value="", $sort="", $fi...
if (!$vars = get_records('autoattend_settings', 'coursei...
$vars = get_records('autoattend_settings', 'courseid'...
}
**** get_records_sql
$qey = "SELECT * FROM .......";
if ($users = get_records_sql($qry)) {
foreach($users as $key => $user) {
$return['id'] = $user->id;
$return['attsid'] = $user->attsid;
.............................
}
}
**** update_record, insert_record
$update = false;
if ($rec = get_record('autoattend_settings', 'courseid',...
$update = true;
}
$rec->courseid = $course->id;
............................
if ($update) {
$result = update_record('autoattend_settings', $rec);
}
else {
$result = insert_record('autoattend_settings', $rec);
}
unset($rec);
**** delete_records
delete_records('autoattend_settings', 'courseid', $cours...
**** XMLDB
- http://dev.moodle.org/mod/resource/view.php?id=48
- block にディレクトリを作成し,その中に dbディレクトリを...
- 「サイト管理」→「その他」→「XMLDBエディタ」 でデータベ...
#br
*** ログ
- add_to_log($course->id, 'autoattend', 'restore settings...
#br
*** Form
#br
*** settings.php
- admin_setting_configtext
- admin_setting_configcheckbox
- admin_setting_configselect
**** Moodle Data Cleaning Parameters
- PARAM_RAW: specifies a parameter that is not cleaned or...
- PARAM_CLEAN: Obsolete, please try to use a more specifi...
- PARAM_INT: Integers only, use when expecting only numbers
- PARAM_INTEGER: Alias for PARAM_INT
- PARAM_ALPHA: Contains only english letters.
- PARAM_ACTION: Alias for PARAM_ALPHA, use for various ac...
- PARAM_FORMAT: Alias for PARAM_ALPHA, use for names of p...
- PARAM_NOTAGS: All HTML tags are stripped from the text....
- PARAM_MULTILANG: Alias of PARAM_TEXT.
- PARAM_TEXT: General plain text compatible with multilan...
- PARAM_FILE: Safe file name, all dangerous chars are str...
- PARAM_PATH: Safe relative path name, all dangerous char...
-- note: The leading slash is not removed, window drive l...
- PARAM_HOST: expected fully qualified domain name (FQDN)...
- PARAM_URL: expected properly formatted URL.
- PARAM_LOCALURL: expected properly formatted URL as well...
- PARAM_CLEANFILE: safe file name, all dangerous and regi...
- PARAM_ALPHANUM: expected numbers and letters only.
- PARAM_BOOL: converts input into 0 or 1, use for switche...
- PARAM_CLEANHTML: cleans submitted HTML code and removes...
-- note: do not forget to addslashes() before storing int...
- PARAM_ALPHAEXT: the same contents as PARAM_ALPHA plus t...
- PARAM_SAFEDIR: safe directory name, suitable for includ...
- PARAM_SEQUENCE: expects a sequence of numbers like 8 to...
Page:
Site Search
Advanced Search
Login
Username:
Password:
Lost Password?
Register now!!
Sub Menu
New Arrivals
Books
Web Links
Site Map
e-Learning
TUIS Certificate
mini Calendar
May 2025
Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Today
Who's Online
78 user(s) are online (5 user(s) are browsing xpwiki)
Members: 0
Guests: 78
more...
Access Counter
Today :
Yesterday :
Total :
Powered by XOOPS Cube 2.1© 2001-2006
XOOPS Cube Project
Design by
XoopsDesign.com