本文整理汇总了PHP中ilObject::notify方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::notify方法的具体用法?PHP ilObject::notify怎么用?PHP ilObject::notify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObject
的用法示例。
在下文中一共展示了ilObject::notify方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notify
/**
* notifys an object about an event occured
* Based on the event happend, each object may decide how it reacts.
*
* If you are not required to handle any events related to your module, just delete this method.
* (For an example how this method is used, look at ilObjGroup)
*
* @access public
* @param string event
* @param integer reference id of object where the event occured
* @param array passes optional parameters if required
* @return boolean
*/
function notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params = 0)
{
global $tree;
switch ($a_event) {
case "link":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
//exit;
break;
case "cut":
//echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
//exit;
break;
case "copy":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
//exit;
break;
case "paste":
//echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
//exit;
break;
case "new":
//echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
//exit;
break;
}
// At the beginning of the recursive process it avoids second call of the notify function with the same parameter
if ($a_node_id == $_GET["ref_id"]) {
$parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
$parent_type = $parent_obj->getType();
if ($parent_type == $this->getType()) {
$a_node_id = (int) $tree->getParentId($a_node_id);
}
}
parent::notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params);
}
示例2: notify
/**
* notifys an object about an event occured
* Based on the event happend, each object may decide how it reacts.
*
* @access public
* @param string event
* @param integer reference id of object where the event occured
* @param array passes optional paramters if required
* @return boolean
*/
function notify($a_event, $a_ref_id, $a_node_id, $a_params = 0)
{
// object specific event handling
parent::notify($a_event, $a_ref_id, $a_node_id, $a_params);
}
示例3: afterSave
protected function afterSave(ilObject $a_new_object)
{
$a_new_object->notify("new", $_GET["ref_id"], $_GET["parent_non_rbac_id"], $_GET["ref_id"], $a_new_object->getRefId());
$a_new_object->setCleanFrames(true);
$a_new_object->update();
// create content object tree
$a_new_object->createLMTree();
// create a first chapter
$a_new_object->addFirstChapterAndPage();
// always send a message
ilUtil::sendSuccess($this->lng->txt($this->type . "_added"), true);
ilUtil::redirect("ilias.php?ref_id=" . $a_new_object->getRefId() . "&baseClass=ilLMEditorGUI");
}
示例4: notify
function notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params = 0)
{
return parent::notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params);
}