示例#1
0
 static function addPoints($action, $username, $course_id, $course_name)
 {
     $comp_params = JComponentHelper::getParams('com_joomdle');
     $user_points = $comp_params->get('user_points');
     switch ($user_points) {
         case 'jomsocial':
             JoomdleHelperPoints::addPoints_jomsocial($action, $username, $course_id, $course_name);
             break;
         case 'ambra':
             JoomdleHelperPoints::addPoints_ambra($action, $username, $course_id, $course_name);
             break;
         default:
             JPluginHelper::importPlugin('joomdlepoints');
             $dispatcher = JDispatcher::getInstance();
             $result = $dispatcher->trigger('OnAddPoints', array($action, $username, $course_id, $course_name));
             $courses = array_shift($result);
             break;
     }
     return "OK";
 }