flagflag  If you want to see English page, please click "English" Button at Left.
Page Top

messsage_send() anchor.png

   $eventdata = new stdClass();
   $eventdata->name              = 'processed';
   $eventdata->component         = 'mod_apply';
   $eventdata->userfrom          = $fuser;    // id またはオブジェクト
   $eventdata->userto            = $user;     // id またはオブジェクト
   $eventdata->subject           = $postsubject;
   $eventdata->fullmessage       = $posttext;
   $eventdata->fullmessageformat = FORMAT_PLAIN;
   $eventdata->fullmessagehtml   = $posthtml;
   $eventdata->smallmessage      = '';
   $eventdata->notification      = 1;
   //
   message_send($eventdata);
  • name の processed に対応した messageprovidersを db/messages.php に追加
$messageproviders = array (
/// Submitting a apply
   'submission' => array (
   ),

   'processed' => array (
   )
);
  • moodle のバージョン番号を上げて,アップデート
     
Page Top

LOG anchor.png

  • http://docs.moodle.org/dev/Migrating_log​_access_in_reports
  • mdl_logstore_standard_log
    MariaDB [moodle_db]> show columns from mdl_logstore_standard_log;
    +-------------------+--------------+------+-----+---------+----------------+
    | Field             | Type         | Null | Key | Default | Extra          |
    +-------------------+--------------+------+-----+---------+----------------+
    | id                | bigint(10)   | NO   | PRI | NULL    | auto_increment |
    | eventname         | varchar(255) | NO   |     |         |                |
    | component         | varchar(100) | NO   |     |         |                |
    | action            | varchar(100) | NO   |     |         |                |
    | target            | varchar(100) | NO   |     |         |                |
    | objecttable       | varchar(50)  | YES  |     | NULL    |                |
    | objectid          | bigint(10)   | YES  |     | NULL    |                |
    | crud              | varchar(1)   | NO   |     |         |                |
    | edulevel          | tinyint(1)   | NO   |     | NULL    |                |
    | contextid         | bigint(10)   | NO   |     | NULL    |                |
    | contextlevel      | bigint(10)   | NO   |     | NULL    |                |
    | contextinstanceid | bigint(10)   | NO   |     | NULL    |                |
    | userid            | bigint(10)   | NO   | MUL | NULL    |                |
    | courseid          | bigint(10)   | YES  | MUL | NULL    |                |
    | relateduserid     | bigint(10)   | YES  |     | NULL    |                |
    | anonymous         | tinyint(1)   | NO   |     | 0       |                |
    | other             | longtext     | YES  |     | NULL    |                |
    | timecreated       | bigint(10)   | NO   | MUL | NULL    |                |
    | origin            | varchar(10)  | YES  |     | NULL    |                |
    | ip                | varchar(45)  | YES  |     | NULL    |                |
    | realuserid        | bigint(10)   | YES  |     | NULL    |                |
    +-------------------+--------------+------+-----+---------+----------------+
    21 rows in set (0.00 sec)
     
Page Top

add_to_log() anchor.png

  • 2.6 から deprecated
  • event log を使う
     
Page Top

event log anchor.png

Page Top
block_autoattend\event\view_log anchor.png
  • コンポーネント名: block_autoattend
  • ターゲット名: view
  • アクション名: log
  • ファイル名: classes/event/ターゲット名_アクション名.php (この命名規則に従わないとシステムが読んでくれない)
    • 変更後 キャッシュをクリア
    • バージョンをアップする.(説明書にはすると書いてあるがしなくてもよい)
  • オブジェクトに値を渡すには,$this->other[] を使用する.
     
Page Top
イベントオブジェクトの構造 for module anchor.png
mod_autoattendmod\event\add_to_log Object ( 
   [data:protected] => Array ( 
       [eventname] => \mod_autoattendmod\event\add_to_log 
       [component] => mod_autoattendmod 
       [action] => log 
       [target] => add_to 
       [objecttable] => 
       [objectid] => 
       [crud] => c 
       [edulevel] => 0 
       [contextid] => 416 
       [contextlevel] => 70 
       [contextinstanceid] => 142 
       [userid] => 5 
       [courseid] => 2 
       [relateduserid] => 
       [anonymous] => 0 
       [other] => 
       [timecreated] => 1417150766 
   ) 
   [logextra:protected] => Array ( 
       [origin] => web 
       [ip] => 172.22.1.79 
       [realuserid] => 
   ) 
   [context:protected] => 
   [triggered:core\event\base:private] => 1 
   [dispatched:core\event\base:private] => 1 
   [restored:core\event\base:private] => 1 
   [recordsnapshots:core\event\base:private] => Array ( ) 
) 
Page Top
イベントオブジェクトの構造 for block anchor.png
block_autoattend\event\view_log ( 
   [data:protected] => Array ( 
       [eventname] => \block_autoattend\event\view_log 
       [component] => block_autoattend 
       [action] => log 
       [target] => view 
       [objecttable] => 
       [objectid] => 
       [crud] => r 
       [edulevel] => 0 
       [contextid] => 15 
       [contextlevel] => 50 
       [contextinstanceid] => 2 
       [userid] => 5 :
       [courseid] => 2 
       [relateduserid] => 
       [anonymous] => 0 
       [other] => 
       [timecreated] => 1417154135 
   )
   [logextra:protected] => 
   [context:protected] => context_course Object ( 
       [_id:protected] => 15 
       [_contextlevel:protected] => 50 
       [_instanceid:protected] => 2 
       [_path:protected] => /1/3/15 
       [_depth:protected] => 3 
   ) 
   [triggered:core\event\base:private] => 
   [dispatched:core\event\base:private] => 
   [restored:core\event\base:private] => 
   [recordsnapshots:core\event\base:private] => Array ( ) 
)  
 
Page Top
doc.moodle.org anchor.png
       $event = \mod_wiki\event\page_updated::create(
               array(
                   'context' => $context,
                   'objectid' => $wikipage->id,
                   'relateduserid' => $userid,
                   'other' => array(
                       'newcontent' => $newcontent
                       )
                   ));
       $event->add_record_snapshot('wiki', $wiki);
       $event->add_record_snapshot('wiki_pages', $wikipage);
       $event->add_record_snapshot('wiki_versions', $version);
       $event->trigger();
   $params = array(
       'context' => $context,
       'objectid' => $post->id,
       'other' => array(
           'content' => $post->message,
           'pathnamehashes' => array_keys($files),
           'discussionid' => $post->discussion,
           'triggeredfrom' => $name,
       )
   );
   $event = \mod_forum\event\assessable_uploaded::create($params);
   $event->trigger();
 

トップ   凍結 差分 バックアップ 複製 名前変更 リロード   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom
Counter: 2487, today: 1, yesterday: 0
最終更新: 2021-07-29 (木) 15:15:24 (JST) (997d) by iseki

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 4月翌月
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
<今日>

オンライン状況

33 人のユーザが現在オンラインです。 (2 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 33

もっと...

アクセスカウンタ

今日 : 4407440744074407
昨日 : 1461914619146191461914619
総計 : 2330636123306361233063612330636123306361233063612330636123306361
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com