Completed
Push — master ( 5da9ea...eef579 )
by Angel Fernando Quiroz
50:18 queued 17:36
created
src/Chamilo/CoreBundle/Framework/PageController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         if (!isset($user_selected_language)) {
218 218
             $user_selected_language = $platformLanguage;
219 219
         }
220
-        $home_menu = @(string)file_get_contents($sys_path.$home.'home_menu_'.$user_selected_language.'.html');
220
+        $home_menu = @(string) file_get_contents($sys_path.$home.'home_menu_'.$user_selected_language.'.html');
221 221
         if (!empty($home_menu)) {
222 222
             $home_menu_content = api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
223 223
             $this->show_right_block(
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
         $home                   = api_get_home_path();
266 266
 
267 267
         // Notice
268
-        $home_notice = @(string)file_get_contents($sys_path.$home.'home_notice_'.$user_selected_language.'.html');
268
+        $home_notice = @(string) file_get_contents($sys_path.$home.'home_notice_'.$user_selected_language.'.html');
269 269
         if (empty($home_notice)) {
270
-            $home_notice = @(string)file_get_contents($sys_path.$home.'home_notice.html');
270
+            $home_notice = @(string) file_get_contents($sys_path.$home.'home_notice.html');
271 271
         }
272 272
 
273 273
         if (!empty($home_notice)) {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
         $home_top_temp = null;
376 376
 
377 377
         if (!empty($_GET['include']) && preg_match('/^[a-zA-Z0-9_-]*\.html$/', $_GET['include'])) {
378
-            $open = @(string)file_get_contents(api_get_path(SYS_PATH).$home.$_GET['include']);
378
+            $open = @(string) file_get_contents(api_get_path(SYS_PATH).$home.$_GET['include']);
379 379
             $html = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
380 380
         } else {
381 381
             $user_selected_language = api_get_user_language();
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
         $loadDirs = api_get_setting('document.show_documents_preview') == 'true' ? true : false;
869 869
         $start    = ($page - 1) * $this->maxPerPage;
870 870
 
871
-        $nbResults = (int)CourseManager::displayPersonalCourseCategories($user_id, $filter, $loadDirs, true);
871
+        $nbResults = (int) CourseManager::displayPersonalCourseCategories($user_id, $filter, $loadDirs, true);
872 872
 
873 873
         $html = CourseManager::displayPersonalCourseCategories(
874 874
             $user_id,
@@ -1228,7 +1228,7 @@  discard block
 block discarded – undo
1228 1228
 
1229 1229
         if ($loadHistory) {
1230 1230
             // Load sessions in category in *history*.
1231
-            $nbResults = (int)UserManager::get_sessions_by_category(
1231
+            $nbResults = (int) UserManager::get_sessions_by_category(
1232 1232
                 $user_id,
1233 1233
                 true,
1234 1234
                 true,
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
             );
1250 1250
         } else {
1251 1251
             // Load sessions in category.
1252
-            $nbResults = (int)UserManager::get_sessions_by_category(
1252
+            $nbResults = (int) UserManager::get_sessions_by_category(
1253 1253
                 $user_id,
1254 1254
                 false,
1255 1255
                 true,
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Controller/Admin/PluginsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 
55 55
             if (is_file($file)) {
56 56
                 $pluginInfo = require $file;
57
-                var_dump($pluginInfo);exit;
57
+                var_dump($pluginInfo); exit;
58 58
                 $allPluginsList[] = $pluginInfo;
59 59
             }
60 60
         }
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Controller/UserPortalController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@
 block discarded – undo
228 228
                     get_lang('PickACourseAsATemplateForThisNewCourse'),
229 229
                 ],
230 230
                 null,
231
-                ['url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course']
231
+                ['url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course']
232 232
             );
233 233
         }
234 234
 
Please login to merge, or discard this patch.
plugin/vchamilo/cli/bulkcreatenodes.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 echo "Chamilo Bulk Nodes Creation v.1.0\n";
14 14
 echo "=================================\n";
15 15
 require_once('../../../main/inc/global.inc.php');
16
-require_once('clilib.php');       // cli only functions
16
+require_once('clilib.php'); // cli only functions
17 17
 // Ensure errors are well explained
18 18
 ini_set('debug_display', 1);
19 19
 ini_set('debug_level', E_ALL);
@@ -68,26 +68,26 @@  discard block
 block discarded – undo
68 68
 
69 69
 if (!empty($options['config'])) {
70 70
     echo "Loading config : ".$options['config'];
71
-    if (!file_exists($options['config'])){
71
+    if (!file_exists($options['config'])) {
72 72
         cli_error('Config file mentioned but not found');
73 73
     }
74 74
 
75 75
     $content = file($options['config']);
76
-    foreach($content as $l) {
76
+    foreach ($content as $l) {
77 77
         if (preg_match('/^\s+$/', $l)) continue; // Empty lines.
78 78
         if (preg_match('/^[#\/!;]/', $l)) continue; // Comments (any form).
79 79
         if (preg_match('/^(.*?)=(.*)$/', $l, $matches)) {
80
-            if (in_array($matches[1], $expectedoptions)){
80
+            if (in_array($matches[1], $expectedoptions)) {
81 81
                 $options[trim($matches[1])] = trim($matches[2]);
82 82
             }
83 83
         }
84 84
     }
85 85
 }
86 86
 
87
-require_once($_configuration['root_sys'].'local/classes/database.class.php');       // cli only functions
88
-require_once($_configuration['root_sys'].'local/classes/textlib.class.php');       // cli only functions
89
-require_once($_configuration['root_sys'].'local/classes/mootochamlib.php');       // moodle like API
90
-require_once($_configuration['root_sys'] . '/plugin/vchamilo/lib/vchamilo_plugin.class.php');
87
+require_once($_configuration['root_sys'].'local/classes/database.class.php'); // cli only functions
88
+require_once($_configuration['root_sys'].'local/classes/textlib.class.php'); // cli only functions
89
+require_once($_configuration['root_sys'].'local/classes/mootochamlib.php'); // moodle like API
90
+require_once($_configuration['root_sys'].'/plugin/vchamilo/lib/vchamilo_plugin.class.php');
91 91
 
92 92
 global $DB;
93 93
 if ($options['verbose']) echo "building database manager\n";
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 // Get main admin for further replacement.
118 118
 $admin = $DB->get_record('user', array('username' => 'admin'));
119 119
 
120
-foreach($nodes as $data) {
120
+foreach ($nodes as $data) {
121 121
 
122 122
     ctrace('Making node '.$data->root_web);
123 123
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                 $settingrec->access_url = 1;
164 164
                 $settingrec->selected_value = $value;
165 165
                 ctrace("Setting up {$settingrec->variable}|{$settingrec->subkey} to $value\n");
166
-                if ($oldrec = $NDB->get_record('settings_current', array('variable' => $settingrec->variable, 'subkey' => $settingrec->subkey, 'type' => $settingrec->type))){
166
+                if ($oldrec = $NDB->get_record('settings_current', array('variable' => $settingrec->variable, 'subkey' => $settingrec->subkey, 'type' => $settingrec->type))) {
167 167
                     $settingrec->id = $oldrec->id;
168 168
                     $NDB->update_record('settings_current', $settingrec, 'id');
169 169
                 } else {
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
     
209 209
     if ($interactive) {
210 210
         $input = readline("Continue (y/n|r) ?\n");
211
-        if ($input == 'r' || $input == 'R'){
211
+        if ($input == 'r' || $input == 'R') {
212 212
             // do nothing, just continue
213
-        } elseif ($input == 'n' || $input == 'N'){
213
+        } elseif ($input == 'n' || $input == 'N') {
214 214
             echo "finishing\n";
215 215
             exit;
216 216
         }
Please login to merge, or discard this patch.
main/ticket/course_user_list.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@
 block discarded – undo
38 38
 $courseSelect = Display::select('course_id', $arrCourseList, 0, array(), false);
39 39
 $courseControl = Display::div($courseSelect, array('class' => 'controls'));
40 40
 
41
-$userDiv = Display::div($userLabel . " " . $userControl, array('class' => 'control-group'));
42
-$courseDiv = Display::div($courseLabel . " " . $courseControl, array('class' => 'control-group'));
41
+$userDiv = Display::div($userLabel." ".$userControl, array('class' => 'control-group'));
42
+$courseDiv = Display::div($courseLabel." ".$courseControl, array('class' => 'control-group'));
43 43
 echo $userDiv;
44 44
 echo $courseDiv;
45 45
 
Please login to merge, or discard this patch.
main/exercise/hotspot_lang_conversion.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
 
14 14
 $hotspot_lang_file = api_get_path(SYS_LANG_PATH);
15 15
 
16
-if(isset($_GET['lang'])) {
16
+if (isset($_GET['lang'])) {
17 17
 	//$search = array('../','\\0','\\');
18 18
 	$lang = urldecode($_GET['lang']);
19 19
 	if (preg_match('/^[a-zA-Z0-9\._-]+$/', $lang)) {
20 20
 		//$lang = str_replace($search,$replace,urldecode($_GET['lang']));
21
-		if(file_exists($hotspot_lang_file . $lang . '/hotspot.inc.php'))
22
-			$hotspot_lang_file .= $lang . '/hotspot.inc.php';
21
+		if (file_exists($hotspot_lang_file.$lang.'/hotspot.inc.php'))
22
+			$hotspot_lang_file .= $lang.'/hotspot.inc.php';
23 23
 		else
24 24
 			$hotspot_lang_file .= 'english/hotspot.inc.php';
25 25
 	} else {
@@ -33,25 +33,25 @@  discard block
 block discarded – undo
33 33
 
34 34
 $temp = array();
35 35
 
36
-foreach($file as $value)
36
+foreach ($file as $value)
37 37
 {
38 38
 	$explode = explode('=', $value);
39 39
 
40
-	if(count($explode) > 1)
40
+	if (count($explode) > 1)
41 41
 	{
42 42
 		$explode[0] = trim($explode[0]);
43
-		$explode[0] = '&' . substr($explode[0], 1, strlen($explode[0]));
43
+		$explode[0] = '&'.substr($explode[0], 1, strlen($explode[0]));
44 44
 
45 45
 		$explode[1] = trim($explode[1]);
46 46
 		$explode[1] = substr($explode[1], 0, strlen($explode[1]) - 1);
47 47
 		$explode[1] = str_replace('"', '', $explode[1]);
48 48
 
49
-		$temp[] = $explode[0] . '=' . $explode[1];
49
+		$temp[] = $explode[0].'='.$explode[1];
50 50
 	}
51 51
 }
52 52
 
53
-foreach($temp as $value)
53
+foreach ($temp as $value)
54 54
 {
55
-	echo $value . ' ';
55
+	echo $value.' ';
56 56
 }
57 57
 ?>
Please login to merge, or discard this patch.
main/lp/lp_ajax_initialize.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -101,21 +101,21 @@  discard block
 block discarded – undo
101 101
 	$myobjectives = json_encode($phpobjectives);
102 102
 
103 103
     $return .=
104
-            "olms.score=".$myscore.";" .
105
-            "olms.max=".$mymax.";" .
106
-            "olms.min=".$mymin.";" .
107
-            "olms.lesson_status='".$mylesson_status."';" .
108
-            "olms.lesson_location='".$mylesson_location."';" .
109
-            "olms.session_time='".$mysession_time."';" .
110
-            "olms.suspend_data='".$mysuspend_data."';" .
111
-            "olms.total_time = '".$mytotal_time."';" .
112
-            "olms.mastery_score = '".$mymastery_score."';" .
113
-            "olms.max_time_allowed = '".$mymax_time_allowed."';" .
114
-            "olms.launch_data = '".$mylaunch_data."';" .
115
-            "olms.interactions = new Array(".$myistring.");" .
104
+            "olms.score=".$myscore.";".
105
+            "olms.max=".$mymax.";".
106
+            "olms.min=".$mymin.";".
107
+            "olms.lesson_status='".$mylesson_status."';".
108
+            "olms.lesson_location='".$mylesson_location."';".
109
+            "olms.session_time='".$mysession_time."';".
110
+            "olms.suspend_data='".$mysuspend_data."';".
111
+            "olms.total_time = '".$mytotal_time."';".
112
+            "olms.mastery_score = '".$mymastery_score."';".
113
+            "olms.max_time_allowed = '".$mymax_time_allowed."';".
114
+            "olms.launch_data = '".$mylaunch_data."';".
115
+            "olms.interactions = new Array(".$myistring.");".
116 116
             //"olms.item_objectives = new Array();" .
117
-            "olms.item_objectives = ".$myobjectives.";" .
118
-            "olms.G_lastError = 0;" .
117
+            "olms.item_objectives = ".$myobjectives.";".
118
+            "olms.G_lastError = 0;".
119 119
             "olms.G_LastErrorMessage = 'No error';".
120 120
             "olms.finishSignalReceived = 0;";
121 121
     /*
@@ -144,22 +144,22 @@  discard block
 block discarded – undo
144 144
     $mycore_exit = $mylpi->get_core_exit();
145 145
 
146 146
     $return .=
147
-            "olms.lms_lp_id=".$lp_id.";" .
148
-            "olms.lms_item_id=".$next_item.";" .
149
-            "olms.lms_old_item_id=0;" .
150
-            "olms.lms_initialized=0;" .
151
-            "olms.lms_view_id=".$view_id.";" .
152
-            "olms.lms_user_id=".$user_id.";" .
153
-            "olms.next_item=".$next_item.";" . // This one is very important to replace possible literal strings.
154
-            "olms.lms_next_item=".$mynext.";" .
155
-            "olms.lms_previous_item=".$myprevious.";" .
156
-            "olms.lms_item_type = '".$myitemtype."';" .
157
-            "olms.lms_item_credit = '".$mycredit."';" .
158
-            "olms.lms_item_lesson_mode = '".$mylesson_mode."';" .
159
-            "olms.lms_item_launch_data = '".$mylaunch_data."';" .
160
-            "olms.lms_item_interactions_count = '".$myinteractions_count."';" .
161
-            "olms.lms_item_objectives_count = '".$myinteractions_count."';" .
162
-            "olms.lms_item_core_exit = '".$mycore_exit."';" .
147
+            "olms.lms_lp_id=".$lp_id.";".
148
+            "olms.lms_item_id=".$next_item.";".
149
+            "olms.lms_old_item_id=0;".
150
+            "olms.lms_initialized=0;".
151
+            "olms.lms_view_id=".$view_id.";".
152
+            "olms.lms_user_id=".$user_id.";".
153
+            "olms.next_item=".$next_item.";".// This one is very important to replace possible literal strings.
154
+            "olms.lms_next_item=".$mynext.";".
155
+            "olms.lms_previous_item=".$myprevious.";".
156
+            "olms.lms_item_type = '".$myitemtype."';".
157
+            "olms.lms_item_credit = '".$mycredit."';".
158
+            "olms.lms_item_lesson_mode = '".$mylesson_mode."';".
159
+            "olms.lms_item_launch_data = '".$mylaunch_data."';".
160
+            "olms.lms_item_interactions_count = '".$myinteractions_count."';".
161
+            "olms.lms_item_objectives_count = '".$myinteractions_count."';".
162
+            "olms.lms_item_core_exit = '".$mycore_exit."';".
163 163
             "olms.asset_timer = 0;";
164 164
 
165 165
     $mylp->set_error_msg('');
Please login to merge, or discard this patch.
main/lp/storageapi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         and sco_id = '$sv_sco'
104 104
         and course_id = '$sv_course'
105 105
         and sv_key = '$sv_key'
106
-        order by sv_value ".($sv_asc ? "ASC": "DESC")." limit $sv_length";
106
+        order by sv_value ".($sv_asc ? "ASC" : "DESC")." limit $sv_length";
107 107
 //	$sql_data = "select sv.user_id as user_id, sv_key as variable, sv_value as value
108 108
 //		from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." sv
109 109
 //		where sv.user_id in (select u2.user_id from ($sql_leaders) u2)
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         and search.sco_id = '$sv_sco'
136 136
         and search.course_id = '$sv_course'
137 137
         and search.sv_key = '$sv_key'
138
-        and list.sv_value ".($sv_asc ? "<=": ">=")." search.sv_value
138
+        and list.sv_value ".($sv_asc ? "<=" : ">=")." search.sv_value
139 139
         and list.sco_id = search.sco_id
140 140
         and list.course_id = search.course_id
141 141
         and list.sv_key = search.sv_key
Please login to merge, or discard this patch.
main/lp/aicc_api.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -78,33 +78,33 @@  discard block
 block discarded – undo
78 78
 var commit = false ;
79 79
 
80 80
 // Strictly SCORM variables.
81
-var score=<?php echo $oItem->get_score();?>;
82
-var max=<?php echo $oItem->get_max();?>;
83
-var min=<?php echo $oItem->get_min();?>;
84
-var lesson_status='<?php echo $oItem->get_status();?>';
85
-var session_time='<?php echo $oItem->get_scorm_time('js');?>';
86
-var suspend_data = '<?php echo $oItem->get_suspend_data();?>';
87
-var lesson_location = '<?php echo $oItem->get_lesson_location();?>';
88
-var total_time = '<?php echo $oItem->get_scorm_time('js');?>';
81
+var score=<?php echo $oItem->get_score(); ?>;
82
+var max=<?php echo $oItem->get_max(); ?>;
83
+var min=<?php echo $oItem->get_min(); ?>;
84
+var lesson_status='<?php echo $oItem->get_status(); ?>';
85
+var session_time='<?php echo $oItem->get_scorm_time('js'); ?>';
86
+var suspend_data = '<?php echo $oItem->get_suspend_data(); ?>';
87
+var lesson_location = '<?php echo $oItem->get_lesson_location(); ?>';
88
+var total_time = '<?php echo $oItem->get_scorm_time('js'); ?>';
89 89
 
90 90
 // Chamilo internal variables.
91 91
 var saved_lesson_status = 'not attempted';
92
-var lms_lp_id = <?php echo $oLP->get_id();?>;
93
-var lms_item_id = <?php echo $oItem->get_id();?>;
92
+var lms_lp_id = <?php echo $oLP->get_id(); ?>;
93
+var lms_item_id = <?php echo $oItem->get_id(); ?>;
94 94
 //var lms_new_item_id = 0; //temporary value (only there between a load_item() and a LMSInitialize())
95 95
 var lms_been_synchronized = 0;
96 96
 var lms_initialized = 0;
97 97
 var lms_total_lessons = <?php echo $oLP->get_total_items_count(); ?>;
98
-var lms_complete_lessons = <?php echo $oLP->get_complete_items_count();?>;
99
-var lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode;?>';
98
+var lms_complete_lessons = <?php echo $oLP->get_complete_items_count(); ?>;
99
+var lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode; ?>';
100 100
 if(lms_progress_bar_mode == ''){lms_progress_bar_mode='%';}
101
-var lms_view_id = '<?php echo $oLP->get_view();?>';
101
+var lms_view_id = '<?php echo $oLP->get_view(); ?>';
102 102
 if(lms_view_id == ''){ lms_view_id = 1;}
103
-var lms_user_id = '<?php echo $_user['user_id'];?>';
104
-var lms_next_item = '<?php echo $oLP->get_next_item_id();?>';
105
-var lms_previous_item = '<?php echo $oLP->get_previous_item_id();?>';
106
-var lms_lp_type = '<?php echo $oLP->get_type();?>';
107
-var lms_item_type = '<?php echo $oItem->get_type();?>';
103
+var lms_user_id = '<?php echo $_user['user_id']; ?>';
104
+var lms_next_item = '<?php echo $oLP->get_next_item_id(); ?>';
105
+var lms_previous_item = '<?php echo $oLP->get_previous_item_id(); ?>';
106
+var lms_lp_type = '<?php echo $oLP->get_type(); ?>';
107
+var lms_item_type = '<?php echo $oItem->get_type(); ?>';
108 108
 
109 109
 // Backup for old values.
110 110
 var old_score = 0;
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
     }else if(param == 'cmi.core.lesson_mode'){
163 163
         result='normal';
164 164
     }else if(param == 'cmi.suspend_data'){
165
-        result='<?php echo $oItem->get_suspend_data();?>';
165
+        result='<?php echo $oItem->get_suspend_data(); ?>';
166 166
     }else if(param == 'cmi.launch_data'){
167 167
         result='';
168 168
     }else if(param == 'cmi.objectives._count'){
169
-        result='<?php echo $oItem->get_view_count();?>';
169
+        result='<?php echo $oItem->get_view_count(); ?>';
170 170
     }
171 171
     /*
172 172
     // Switch not working??? WTF???
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
             result='normal';
228 228
             break;
229 229
         case 'cmi.suspend_data'		:
230
-            result='<?php echo $oItem->get_suspend_data();?>';
230
+            result='<?php echo $oItem->get_suspend_data(); ?>';
231 231
             break;
232 232
         case 'cmi.launch_data'		:
233 233
             result='';
234 234
             break;
235 235
         case 'cmi.objectives._count':
236
-            result='<?php echo $oItem->get_view_count();?>';
236
+            result='<?php echo $oItem->get_view_count(); ?>';
237 237
             break;
238 238
         default 					:
239 239
             result='';
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
     $url = $_SERVER['HTTP_HOST'].$self;
286 286
     $url = substr($url, 0, -14); // 14 is the length of this file's name (/scorm_api.php).
287 287
     echo $url;
288
-    ?>/lp_controller.php?<?php echo api_get_cidreq(); ?>&action=save&lp_id=<?php echo $oLP->get_id();?>&" + param + "";
288
+    ?>/lp_controller.php?<?php echo api_get_cidreq(); ?>&action=save&lp_id=<?php echo $oLP->get_id(); ?>&" + param + "";
289 289
     logit_lms('saving data (status='+lesson_status+')',1);
290 290
     xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score, max, min, lesson_status, session_time, suspend_data, lesson_location);
291 291
     //xajax_update_pgs();
Please login to merge, or discard this patch.