Exemple #1
0
 public function addAction(NEWSFEED_CLASS_Action $action)
 {
     if ($this->actionList === null) {
         $this->actionList = array();
     }
     $this->actionList[$action->getId()] = $action;
 }
 public function generateJs($data)
 {
     $js = UTIL_JsGenerator::composeJsString('
         window.ow_newsfeed_feed_list[{$feedAutoId}].actions[{$uniq}] = new NEWSFEED_FeedItem({$autoId}, window.ow_newsfeed_feed_list[{$feedAutoId}]);
         window.ow_newsfeed_feed_list[{$feedAutoId}].actions[{$uniq}].construct({$data});
     ', array('uniq' => $data['entityType'] . '.' . $data['entityId'], 'feedAutoId' => $this->sharedData['feedAutoId'], 'autoId' => $this->autoId, 'id' => $this->action->getId(), 'data' => array('entityType' => $data['entityType'], 'entityId' => $data['entityId'], 'id' => $data['id'], 'updateStamp' => $this->action->getUpdateTime(), 'likes' => !empty($data['features']['system']['likes']) ? $data['features']['system']['likes']['count'] : 0, 'comments' => !empty($data['features']['system']['comments']) ? $data['features']['system']['comments']['count'] : 0, 'cycle' => $data['cycle'], 'displayType' => $this->displayType)));
     OW::getDocument()->addOnloadScript($js, 50);
 }