Ejemplo n.º 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";
 }
Ejemplo n.º 2
0
    function addPoints ($method, $params)
    {
		$action = $params[0];
		$username = $params[1];
		$courseid = $params[2];
		$course_name = $params[3];

        $username = utf8_decode ($username);
        $course_name = utf8_decode ($course_name);

        return JoomdleHelperPoints::addPoints ($action, $username, $courseid, $course_name);
    }