/** * 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); }
/** * 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); }
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"); }
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); }