Proyectos de Subversion LeadersLinked - Services

Rev

Rev 242 | Rev 283 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 242 Rev 243
Línea 226... Línea 226...
226
                    $extension = $parts[ $max -1 ];
226
                    $extension = $parts[ $max -1 ];
227
                    if(in_array($extension, ['mov', 'webm','mp4','mpeg'] )) {
227
                    if(in_array($extension, ['mov', 'webm','mp4','mpeg'] )) {
228
                        $type = 'video';
228
                        $type = 'video';
229
                    } else if(in_array($extension, ['jpg','jpeg','png'] )) {
229
                    } else if(in_array($extension, ['jpg','jpeg','png'] )) {
230
                        $type = 'image';
230
                        $type = 'image';
231
                    } else if(in_array($extension, ['wav', 'mp3', 'pdf'] )) {
231
                    } else if(in_array($extension, ['wav', 'mp3'] )) {
232
                        $type = 'audio';
232
                        $type = 'audio';
-
 
233
                    } else if(in_array($extension, ['pdf'] )) {
-
 
234
                        $type = 'document';
233
                    }
235
                    }
234
                }
236
                }
Línea 235... Línea 237...
235
                
237
                
Línea 771... Línea 773...
771
     * @param int $comment_id
773
     * @param int $comment_id
772
     * @return array
774
     * @return array
773
     */
775
     */
774
    private function renderComment($comment_id, $now)
776
    private function renderComment($comment_id, $now)
775
    {
777
    {
-
 
778
        
-
 
779
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
780
        $currentUser = $currentUserPlugin->getUser();
-
 
781
        
776
        $item = [];
782
        $item = [];
Línea 777... Línea 783...
777
 
783
 
778
        $commentMapper = CommentMapper::getInstance($this->adapter);
784
        $commentMapper = CommentMapper::getInstance($this->adapter);
Línea 790... Línea 796...
790
            $item['user_image'] = $this->url()->fromRoute('storage', ['type' => 'user',  'code' => $user->uuid, 'filename' =>  $user->image],['force_canonical' => true]);
796
            $item['user_image'] = $this->url()->fromRoute('storage', ['type' => 'user',  'code' => $user->uuid, 'filename' =>  $user->image],['force_canonical' => true]);
791
            $item['user_url'] = $this->url()->fromRoute('profile/view', ['id' => $user->uuid]);
797
            $item['user_url'] = $this->url()->fromRoute('profile/view', ['id' => $user->uuid]);
792
            $item['user_name'] = $user->first_name . ' ' . $user->last_name;
798
            $item['user_name'] = $user->first_name . ' ' . $user->last_name;
793
            $item['time_elapsed'] = Functions::timeAgo($record->added_on, $now);
799
            $item['time_elapsed'] = Functions::timeAgo($record->added_on, $now);
794
            $item['comment'] = $record->comment;
800
            $item['comment'] = $record->comment;
795
            $item['link_delete'] = $this->url()->fromRoute('post/comments/delete', ['id' => $post->uuid, 'comment' => $record->uuid]);
801
            $item['link_delete'] = $currentUser->id == $record->user_id ? $this->url()->fromRoute('post/comments/delete', ['id' => $post->uuid, 'comment' => $record->uuid]) : '';
796
        }
802
        }
797
        return $item;
803
        return $item;
798
    }
804
    }
799
}
805
}