Browse Source

Minor - flint fixes

Julio 6 years ago
parent
commit
2a0f50f6e0
2 changed files with 31 additions and 32 deletions
  1. 31 31
      plugin/buycourses/src/buy_course_plugin.class.php
  2. 0 1
      user_portal.php

+ 31 - 31
plugin/buycourses/src/buy_course_plugin.class.php

@@ -2216,6 +2216,37 @@ class BuyCoursesPlugin extends Plugin
         return $return;
     }
 
+    /**
+     * @param array $saleInfo
+     *
+     * @return string
+     */
+    public function getSubscriptionSuccessMessage(array $saleInfo)
+    {
+        switch ($saleInfo['product_type']) {
+            case self::PRODUCT_TYPE_COURSE:
+                $courseInfo = api_get_course_info_by_id($saleInfo['product_id']);
+                $url = api_get_course_url($courseInfo['code']);
+                break;
+            case self::PRODUCT_TYPE_SESSION:
+                $sessionId = (int) $saleInfo['product_id'];
+                $url = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$sessionId;
+                break;
+            default:
+                $url = '#';
+        }
+
+        return Display::return_message(
+            sprintf(
+                $this->get_lang('SubscriptionToCourseXSuccessful'),
+                $url,
+                $saleInfo['product_name']
+            ),
+            'success',
+            false
+        );
+    }
+
     /**
      * Filter the registered courses for show in plugin catalog.
      *
@@ -2542,35 +2573,4 @@ class BuyCoursesPlugin extends Plugin
             ['id = ?' => (int) $serviceSaleId]
         );
     }
-
-    /**
-     * @param array $saleInfo
-     *
-     * @return string
-     */
-    public function getSubscriptionSuccessMessage(array $saleInfo)
-    {
-        switch ($saleInfo['product_type']) {
-            case self::PRODUCT_TYPE_COURSE:
-                $courseInfo = api_get_course_info_by_id($saleInfo['product_id']);
-                $url = api_get_course_url($courseInfo['code']);
-                break;
-            case self::PRODUCT_TYPE_SESSION:
-                $sessionId = (int) $saleInfo['product_id'];
-                $url = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$sessionId;
-                break;
-            default:
-                $url = '#';
-        }
-
-        return Display::return_message(
-            sprintf(
-                $this->get_lang('SubscriptionToCourseXSuccessful'),
-                $url,
-                $saleInfo['product_name']
-            ),
-            'success',
-            false
-        );
-    }
 }

+ 0 - 1
user_portal.php

@@ -303,4 +303,3 @@ Session::erase('session_id');
 Session::erase('id_session');
 Session::erase('studentview');
 api_remove_in_gradebook();
-