Procházet zdrojové kódy

Test integration of Timeline with Notes.

AntonLV před 13 roky
rodič
revize
82037b18de

+ 20 - 0
modules/boonex/notes/classes/BxNotesModule.php

@@ -160,6 +160,26 @@ class BxNotesModule extends BxDolModule {
             $oProfile = BxDolProfileUndefined::getInstance();
         }
         return $this->_oTemplate->entryAuthor ($aContentInfo, $oProfile);
+    }
+
+	public function serviceGetTimelineData()
+    {
+        return array(
+            'handlers' => array(
+                array('type' => 'insert', 'alert_unit' => $this->_aModule['name'], 'alert_action' => 'added', 'module_name' => $this->_aModule['name'], 'module_method' => 'get_timeline_post', 'module_params' => '', 'module_class' => 'Module',  'groupable' => 0, 'group_by' => ''),
+                array('type' => 'update', 'alert_unit' => $this->_aModule['name'], 'alert_action' => 'edited'),
+                array('type' => 'delete', 'alert_unit' => $this->_aModule['name'], 'alert_action' => 'deleted')
+            ),
+            'alerts' => array(
+                array('unit' => $this->_aModule['name'], 'action' => 'added'),
+                array('unit' => $this->_aModule['name'], 'action' => 'edited'),
+                array('unit' => $this->_aModule['name'], 'action' => 'deleted'),
+            )
+        );
+    }
+    public function serviceGetTimelinePost()
+    {
+    
     }
 
     // ====== ACTION METHODS

+ 6 - 2
modules/boonex/notes/classes/BxNotesNoteForms.php

@@ -65,7 +65,9 @@ class BxNotesNoteForms extends BxDolProfileForms {
         $this->_oModule->isAllowedAdd(true);
 
         // alert
-        bx_alert($this->_oModule->getName(), 'added', $iContentId);
+        //TODO: Pass a valid Note's privacy view group.
+        bx_import('BxDolPrivacy');
+        bx_alert($this->_oModule->getName(), 'added', $iContentId, false, array('privacy_view' => BX_DOL_PG_ALL));
 
         // redirect 
         $this->_redirectAndExit('page.php?i=view-note&id=' . $iContentId);
@@ -117,7 +119,9 @@ class BxNotesNoteForms extends BxDolProfileForms {
         $this->_oModule->isAllowedEdit($aContentInfo, true);
 
         // create an alert
-        bx_alert($this->_oModule->getName(), 'edited', $aContentInfo['id']); 
+        //TODO: Pass a valid Note's privacy view group.
+        bx_import('BxDolPrivacy');
+        bx_alert($this->_oModule->getName(), 'edited', $aContentInfo['id'], false, array('privacy_view' => BX_DOL_PG_MEMBERS)); 
 
         // redirect 
         $this->_redirectAndExit('page.php?i=view-note&id=' . $aContentInfo['id']);