Minor - flint fixes

pull/2688/head
Julio 7 years ago
parent 2e7fe4dc26
commit 2a0f50f6e0
  1. 62
      plugin/buycourses/src/buy_course_plugin.class.php
  2. 1
      user_portal.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
);
}
}

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

Loading…
Cancel
Save