public static function newComment($comment, $attachment) { $room = self::getRoom(); $userId = OC_User::getUser(); if (USER_CONVERSATIONS_ATTACHMENTS && OCP\Share::isEnabled() && !empty($attachment)) { self::shareAttachment($attachment); } $query = OCP\DB::prepare('INSERT INTO *PREFIX*conversations (room,author,date,text,attachment) VALUES (?,?,?,?,?)'); $query->execute(array($room, $userId, date('Y-m-d H:i:s'), trim($comment), $attachment)); self::setRoomTime(); return true; }
<?php } ?> <div id="app-content"> <form id="new-comment" data-room="<?php p($_['active_room']); ?> "> <textarea id="new-comment-text" placeholder="<?php p($l->t("Message")); ?> ..." tabindex="1"></textarea> <div id="new-comment-buttons" style="display:none"> <?php if (USER_CONVERSATIONS_ATTACHMENTS && $_['active_room'] != "group:default" && OCP\Share::isEnabled()) { ?> <div id="new-comment-attachment" data-attachment="" style="display:none"></div> <a href="#" title="<?php p($l->t("Add file")); ?> " id="add-attachment"><img class="svg" alt="" src="<?php p(OC::$WEBROOT . '/core/img/places/folder.svg'); ?> " /></a> <?php } ?> <input type="submit" class="button" value="<?php p($l->t("Submit")); ?>