Эх сурвалжийг харах

Merge branch '1.10.x' of github.com:chamilo/chamilo-lms into 1.10.x

Julio Montoya 9 жил өмнө
parent
commit
f72306e9bd

+ 5 - 2
main/exercice/hotspot_admin.inc.php

@@ -1024,6 +1024,7 @@ if ($modifyAnswers) {
     <?php
     <?php
     $swf_loaded = $answerType == HOT_SPOT_DELINEATION ? 'hotspot_delineation_admin' : 'hotspot_admin';
     $swf_loaded = $answerType == HOT_SPOT_DELINEATION ? 'hotspot_delineation_admin' : 'hotspot_admin';
     $height = 450;
     $height = 450;
+    $relPath = api_get_path(REL_PATH);
     ?>
     ?>
                 <div id="hotspot-container" class="center-block">
                 <div id="hotspot-container" class="center-block">
                 </div>
                 </div>
@@ -1036,13 +1037,15 @@ if ($modifyAnswers) {
                 new DelineationQuestion({
                 new DelineationQuestion({
                     questionId: <?php echo $modifyAnswers ?>,
                     questionId: <?php echo $modifyAnswers ?>,
                     selector: '#hotspot-container',
                     selector: '#hotspot-container',
-                    for: 'admin'
+                    for: 'admin',
+                    relpath: '<?php echo $relPath ?>'
                 });
                 });
             <?php } else { ?>
             <?php } else { ?>
                 new HotspotQuestion({
                 new HotspotQuestion({
                     questionId: <?php echo $modifyAnswers ?>,
                     questionId: <?php echo $modifyAnswers ?>,
                     selector: '#hotspot-container',
                     selector: '#hotspot-container',
-                    for: 'admin'
+                    for: 'admin',
+                    relpath: '<?php echo $relPath ?>'
                 });
                 });
             <?php } ?>
             <?php } ?>
         });
         });

+ 14 - 6
main/inc/lib/javascript/hotspot/js/hotspot.js

@@ -1,5 +1,7 @@
 window.HotspotQuestion = (function () {
 window.HotspotQuestion = (function () {
     return function (settings) {
     return function (settings) {
+
+
         var HotspotModel = function (attributes) {
         var HotspotModel = function (attributes) {
             this.attributes = attributes;
             this.attributes = attributes;
             this.id = 0;
             this.id = 0;
@@ -53,6 +55,9 @@ window.HotspotQuestion = (function () {
                 this.set('height', y - startY);
                 this.set('height', y - startY);
             }
             }
         };
         };
+
+
+
         SquareModel.decode = function (hotspotInfo) {
         SquareModel.decode = function (hotspotInfo) {
             var coords = hotspotInfo.coord.split('|'),
             var coords = hotspotInfo.coord.split('|'),
                 position = coords[0].split(';'),
                 position = coords[0].split(';'),
@@ -268,6 +273,7 @@ window.HotspotQuestion = (function () {
                 self.render();
                 self.render();
             });
             });
         };
         };
+
         HotspotSVG.prototype.render = function () {
         HotspotSVG.prototype.render = function () {
             var newEl = null;
             var newEl = null;
 
 
@@ -321,6 +327,7 @@ window.HotspotQuestion = (function () {
                 self.render();
                 self.render();
             });
             });
         };
         };
+
         AnswerSVG.prototype.render = function () {
         AnswerSVG.prototype.render = function () {
             this.circleEl.setAttribute('cx', this.model.get('x'));
             this.circleEl.setAttribute('cx', this.model.get('x'));
             this.circleEl.setAttribute('cy', this.model.get('y'));
             this.circleEl.setAttribute('cy', this.model.get('y'));
@@ -349,6 +356,7 @@ window.HotspotQuestion = (function () {
 
 
             $('.input-group').removeClass('active');
             $('.input-group').removeClass('active');
         };
         };
+
         HotspotSelect.prototype.render = function () {
         HotspotSelect.prototype.render = function () {
             var self = this,
             var self = this,
                 $el = $(this.el);
                 $el = $(this.el);
@@ -1119,13 +1127,13 @@ window.HotspotQuestion = (function () {
 
 
         switch (config.for) {
         switch (config.for) {
             case 'admin':
             case 'admin':
-                xhrQuestion = $.getJSON('/main/exercice/hotspot_actionscript_admin.as.php', {
+                xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_actionscript_admin.as.php', {
                     modifyAnswers: parseInt(config.questionId)
                     modifyAnswers: parseInt(config.questionId)
                 });
                 });
                 break;
                 break;
 
 
             case 'user':
             case 'user':
-                xhrQuestion = $.getJSON('/main/exercice/hotspot_actionscript.as.php', {
+                xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_actionscript.as.php', {
                     modifyAnswers: parseInt(config.questionId),
                     modifyAnswers: parseInt(config.questionId),
                     exe_id: parseInt(config.exerciseId)
                     exe_id: parseInt(config.exerciseId)
                 });
                 });
@@ -1134,7 +1142,7 @@ window.HotspotQuestion = (function () {
             case 'solution':
             case 'solution':
                 //no break
                 //no break
             case 'preview':
             case 'preview':
-                xhrQuestion = $.getJSON('/main/exercice/hotspot_answers.as.php', {
+                xhrQuestion = $.getJSON(config.relPath+'main/exercice/hotspot_answers.as.php', {
                     modifyAnswers: parseInt(config.questionId),
                     modifyAnswers: parseInt(config.questionId),
                     exe_id: parseInt(config.exerciseId)
                     exe_id: parseInt(config.exerciseId)
                 });
                 });
@@ -1732,13 +1740,13 @@ window.DelineationQuestion = (function () {
 
 
             switch (config.for) {
             switch (config.for) {
                 case 'admin':
                 case 'admin':
-                    xhrQuestion = $.getJSON('/main/exercice/hotspot_actionscript_admin.as.php', {
+                    xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_actionscript_admin.as.php', {
                         modifyAnswers: parseInt(config.questionId)
                         modifyAnswers: parseInt(config.questionId)
                     });
                     });
                     break;
                     break;
 
 
                 case 'user':
                 case 'user':
-                    xhrQuestion = $.getJSON('/main/exercice/hotspot_actionscript.as.php', {
+                    xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_actionscript.as.php', {
                         modifyAnswers: parseInt(config.questionId)
                         modifyAnswers: parseInt(config.questionId)
                     });
                     });
                     break;
                     break;
@@ -1746,7 +1754,7 @@ window.DelineationQuestion = (function () {
                 case 'solution':
                 case 'solution':
                     //no break
                     //no break
                 case 'preview':
                 case 'preview':
-                    xhrQuestion = $.getJSON('/main/exercice/hotspot_answers.as.php', {
+                    xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_answers.as.php', {
                         modifyAnswers: parseInt(config.questionId),
                         modifyAnswers: parseInt(config.questionId),
                         exe_id: parseInt(config.exerciseId)
                         exe_id: parseInt(config.exerciseId)
                     });
                     });

+ 3 - 0
main/inc/lib/usermanager.lib.php

@@ -4972,6 +4972,9 @@ EOF;
         $atts = array()
         $atts = array()
     ) {
     ) {
         $url = 'http://www.gravatar.com/avatar/';
         $url = 'http://www.gravatar.com/avatar/';
+        if (!empty($_SERVER['HTTPS'])) {
+            $url = 'https://secure.gravatar.com/avatar/';
+        }
         $url .= md5( strtolower( trim( $email ) ) );
         $url .= md5( strtolower( trim( $email ) ) );
         $url .= "?s=$s&d=$d&r=$r";
         $url .= "?s=$s&d=$d&r=$r";
         if ( $img ) {
         if ( $img ) {

+ 8 - 5
main/newscorm/learnpath.class.php

@@ -5942,15 +5942,18 @@ class learnpath
         $postDir = isset($_POST['dir']) ? $_POST['dir'] : '';
         $postDir = isset($_POST['dir']) ? $_POST['dir'] : '';
         $dir = isset ($_GET['dir']) ? $_GET['dir'] : $postDir; // Please, do not modify this dirname formatting.
         $dir = isset ($_GET['dir']) ? $_GET['dir'] : $postDir; // Please, do not modify this dirname formatting.
         // Please, do not modify this dirname formatting.
         // Please, do not modify this dirname formatting.
-        if (strstr($dir, '..'))
+        if (strstr($dir, '..')) {
             $dir = '/';
             $dir = '/';
-        if ($dir[0] == '.')
+        }
+        if (!empty($dir[0]) && $dir[0] == '.') {
             $dir = substr($dir, 1);
             $dir = substr($dir, 1);
-        if ($dir[0] != '/')
+        }
+        if (!empty($dir[0]) && $dir[0] != '/') {
             $dir = '/' . $dir;
             $dir = '/' . $dir;
-        if ($dir[strlen($dir) - 1] != '/')
+        }
+        if ($dir[strlen($dir) - 1] != '/') {
             $dir .= '/';
             $dir .= '/';
-
+        }
         $filepath = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document' . $dir;
         $filepath = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document' . $dir;
 
 
         if (empty($_POST['dir']) && empty($_GET['dir'])) {
         if (empty($_POST['dir']) && empty($_GET['dir'])) {