「モジュール (開発者)」の版間の差分

提供:MoodleDocs
移動先:案内検索
(ちょっと訳してみます)
編集の要約なし
3行目: 3行目:
'''活動モジュール'''は、'mod'ディレクトリ内にあります。それぞれのモジュールは、別々のサブディレクトリに分かれていて、次の必須要素を含みます (+ それぞれのモジュール特有のスクリプト):
'''活動モジュール'''は、'mod'ディレクトリ内にあります。それぞれのモジュールは、別々のサブディレクトリに分かれていて、次の必須要素を含みます (+ それぞれのモジュール特有のスクリプト):


* ''mod.html'' - そのモジュールのインスタンスを生成したり更新するためのフォーム
* ''mod.html'' - 本モジュールのインスタンスを生成・更新するためのフォーム
* ''version.php'' - defines some meta-info and provides upgrading code
* ''version.php'' - メタ情報を定義し,アップグレード用コードを提供
* ''icon.gif'' - a 16x16 icon for the module
* ''icon.gif'' - モジュールを表す 16x16 のアイコン
* ''db/'' - SQL dumps of all the required db tables and data (for each database type)
* ''db/'' - (各データベース形式毎の)必要な全てのDBテーブルとデータを生成するSQLコード
* ''index.php'' - a page to list all instances in a course
* ''index.php'' - コース内の全てのインスタンス一覧を表示するページ
* ''view.php'' - a page to view a particular instance
* ''view.php'' - 特定のインスタンスを表示するページ
* ''lib.php'' - any/all functions defined by the module should be in here. If the modulename is called widget, then the required functions include:
* ''lib.php'' - 本モジュールで定義されるあらゆる全ての関数はここに書く。例えばモジュール名が widget である場合,以下の関数が必要:
:* widget_add_instance() - code to add a new instance of widget
:* widget_add_instance() - code to add a new instance of widget
:* widget_update_instance() - code to update an existing instance
:* widget_update_instance() - code to update an existing instance

2007年9月7日 (金) 11:08時点における版

作成中です - Mitsuhiro Yoshida 2006年12月7日 (木) 19:41 (CST)

活動モジュールは、'mod'ディレクトリ内にあります。それぞれのモジュールは、別々のサブディレクトリに分かれていて、次の必須要素を含みます (+ それぞれのモジュール特有のスクリプト):

  • mod.html - 本モジュールのインスタンスを生成・更新するためのフォーム
  • version.php - メタ情報を定義し,アップグレード用コードを提供
  • icon.gif - モジュールを表す 16x16 のアイコン
  • db/ - (各データベース形式毎の)必要な全てのDBテーブルとデータを生成するSQLコード
  • index.php - コース内の全てのインスタンス一覧を表示するページ
  • view.php - 特定のインスタンスを表示するページ
  • lib.php - 本モジュールで定義されるあらゆる全ての関数はここに書く。例えばモジュール名が widget である場合,以下の関数が必要:
  • widget_add_instance() - code to add a new instance of widget
  • widget_update_instance() - code to update an existing instance
  • widget_delete_instance() - code to delete an instance
  • widget_user_outline() - given an instance, return a summary of a user's contribution
  • widget_user_complete() - given an instance, print details of a user's contribution
  • Other functions available but not required are:
    • widget_delete_course() - code to clean up anything that would be leftover after all instances are deleted
    • widget_process_options() - code to pre-process the form data from module settings
  • To avoid possible conflict, any module functions should be named starting with widget_ and any constants you define should start with WIDGET_
  • config.html - (optional) a form to set up or update global settings of this module
  • Lastly, each module will have some language files that contain strings for that module.

重要: When creating a new module, the new name of the module must not contain numbers or other special characters!

You should also make sure that your activity module provides appropriate support for groups and metacourses.

関連情報