Browse Source

Minor - flint fixes + replace jquery ready syntax

Julio Montoya 6 years ago
parent
commit
80e36943cc

+ 5 - 5
main/document/edit_odf.php

@@ -76,11 +76,11 @@ $htmlHeadXtra[] = api_get_js('wodotexteditor/wodotexteditor.js');
 $htmlHeadXtra[] = api_get_js('wodotexteditor/localfileeditor.js');
 $htmlHeadXtra[] = api_get_js('wodotexteditor/FileSaver.js');
 $htmlHeadXtra[] = '
-    <script type="text/javascript" charset="utf-8">
-        $(document).on(\'ready\', function() {
-            createEditor(\''.$fileUrl.'\');
-        });
-    </script>
+<script>
+    $(function() {
+        createEditor(\''.$fileUrl.'\');
+    });
+</script>
 ';
 $htmlHeadXtra[] = '
     <style>

+ 0 - 1
main/inc/ajax/social.ajax.php

@@ -1,7 +1,6 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
 use Chamilo\CoreBundle\Entity\Message;
 use Chamilo\CoreBundle\Entity\MessageLikes;
 use ChamiloSession as Session;

+ 28 - 27
main/inc/lib/message.lib.php

@@ -2736,36 +2736,12 @@ class MessageManager
         }
     }
 
-    /**
-     * Execute the SQL necessary to know the number of messages in the database.
-     *
-     * @param int $userId The user for which we need the unread messages count
-     *
-     * @return int The number of unread messages in the database for the given user
-     */
-    private static function getCountNewMessagesFromDB($userId)
-    {
-        if (empty($userId)) {
-            return 0;
-        }
-        $table = Database::get_main_table(TABLE_MESSAGE);
-        $sql = "SELECT COUNT(id) as count 
-                FROM $table
-                WHERE
-                    user_receiver_id=".api_get_user_id()." AND
-                    msg_status = ".MESSAGE_STATUS_UNREAD;
-        $result = Database::query($sql);
-        $row = Database::fetch_assoc($result);
-
-        return $row['count'];
-    }
-
     /**
      * @param int $messageId
      *
-     * @return array
-     *
      * @throws \Doctrine\ORM\Query\QueryException
+     *
+     * @return array
      */
     public static function countLikesAndDislikes($messageId, $userId)
     {
@@ -2800,8 +2776,9 @@ class MessageManager
      * @param int $userId
      * @param int $groupId   Optional.
      *
-     * @return string
      * @throws \Doctrine\ORM\Query\QueryException
+     *
+     * @return string
      */
     public static function getLikesButton($messageId, $userId, $groupId = 0)
     {
@@ -2834,4 +2811,28 @@ class MessageManager
 
         return $btnLike.PHP_EOL.$btnDislike;
     }
+
+    /**
+     * Execute the SQL necessary to know the number of messages in the database.
+     *
+     * @param int $userId The user for which we need the unread messages count
+     *
+     * @return int The number of unread messages in the database for the given user
+     */
+    private static function getCountNewMessagesFromDB($userId)
+    {
+        if (empty($userId)) {
+            return 0;
+        }
+        $table = Database::get_main_table(TABLE_MESSAGE);
+        $sql = "SELECT COUNT(id) as count 
+                FROM $table
+                WHERE
+                    user_receiver_id=".api_get_user_id()." AND
+                    msg_status = ".MESSAGE_STATUS_UNREAD;
+        $result = Database::query($sql);
+        $row = Database::fetch_assoc($result);
+
+        return $row['count'];
+    }
 }

+ 0 - 1
main/inc/lib/social.lib.php

@@ -1905,7 +1905,6 @@ class SocialManager extends UserManager
 
         $isOwnWall = $currentUserId == $userIdLoop || $currentUserId == $receiverId;
         if ($isOwnWall) {
-
             $comment .= Display::url(
                     Display::returnFontAwesomeIcon('trash', '', true),
                 'javascript:void(0)',