Exemplo n.º 1
0
 public function desktopItemRender(OW_Event $e)
 {
     $params = $e->getParams();
     $data = $e->getData();
     if (!empty($data['attachment']) && !empty($data['attachment']['oembed'])) {
         $oembed = array_filter($data['attachment']['oembed']);
         if (!empty($oembed)) {
             //$canDelete = $params['createActivity']['userId'] == OW::getUser()->getId();
             $canDelete = false;
             $oembedCmp = new BASE_CMP_OembedAttachment($data['attachment']['oembed'], $canDelete);
             $oembedCmp->setContainerClass('newsfeed_attachment');
             $oembedCmp->setDeleteBtnClass('newsfeed_attachment_remove');
             $data['assign']['attachment'] = array('template' => 'attachment', 'vars' => array('content' => $oembedCmp->render()));
         }
     }
     $e->setData($data);
 }
Exemplo n.º 2
0
 protected function processList($commentList)
 {
     $arrayToAssign = array();
     /* @var $value BOL_Comment */
     foreach ($commentList as $value) {
         $this->userIdList[] = $value->getUserId();
         $this->commentIdList[] = $value->getId();
     }
     $userAvatarArrayList = empty($this->staticData['avatars']) ? $this->avatarService->getDataForUserAvatars($this->userIdList) : $this->staticData['avatars'];
     /* @var $value BOL_Comment */
     foreach ($commentList as $value) {
         $cmItemArray = array('displayName' => $userAvatarArrayList[$value->getUserId()]['title'], 'avatarUrl' => $userAvatarArrayList[$value->getUserId()]['src'], 'profileUrl' => $userAvatarArrayList[$value->getUserId()]['url'], 'content' => $value->getMessage(), 'date' => UTIL_DateTime::formatDate($value->getCreateStamp()), 'userId' => $value->getUserId(), 'commentId' => $value->getId(), 'avatar' => $userAvatarArrayList[$value->getUserId()]);
         $contentAdd = '';
         if ($value->getAttachment() !== null) {
             $tempCmp = new BASE_CMP_OembedAttachment((array) json_decode($value->getAttachment()), $this->isOwnerAuthorized);
             $contentAdd .= '<div class="ow_attachment ow_small" id="att' . $value->getId() . '">' . $tempCmp->render() . '</div>';
         }
         $cmItemArray['content_add'] = $contentAdd;
         $event = new BASE_CLASS_EventProcessCommentItem('base.comment_item_process', $value, $cmItemArray);
         OW::getEventManager()->trigger($event);
         $arrayToAssign[] = $event->getDataArr();
     }
     return $arrayToAssign;
 }
Exemplo n.º 3
0
 public function addVideo($params)
 {
     $cmp = new BASE_CMP_OembedAttachment(array('type' => 'video', 'html' => $_POST['code']), true);
     exit(json_encode(array('cmp' => $cmp->render(), 'uid' => $params['uid'], 'genId' => uniqid('attchvi' . md5($params['uid'])), 'type' => 'video', 'code' => $_POST['code'])));
 }