當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilObject::notify方法代碼示例

本文整理匯總了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);
 }
開發者ID:khanhnnvn,項目名稱:ilias_E-learning,代碼行數:50,代碼來源:class.ilObjAdvancedEditing.php

示例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);
 }
開發者ID:khanhnnvn,項目名稱:ilias_E-learning,代碼行數:15,代碼來源:class.ilObjExercise.php

示例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");
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:13,代碼來源:class.ilObjContentObjectGUI.php

示例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);
 }
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:4,代碼來源:class.ilObject2.php


注:本文中的ilObject::notify方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。