Completed
Push — 1.11.x ( 6904fa...6a92e6 )
by José
525:44 queued 484:20
created
main/messages/view_message.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,22 +6,22 @@  discard block
 block discarded – undo
6 6
 $cidReset = true;
7 7
 require_once '../inc/global.inc.php';
8 8
 api_block_anonymous_users();
9
-if (api_get_setting('allow_message_tool')!='true') {
9
+if (api_get_setting('allow_message_tool') != 'true') {
10 10
 	api_not_allowed();
11 11
 }
12 12
 
13 13
 if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') {
14 14
 	$this_section = SECTION_SOCIAL;
15
-	$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
16
-	$interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox'));
15
+	$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social'));
16
+	$interbreadcrumb[] = array('url' => 'inbox.php?f=social', 'name' => get_lang('Inbox'));
17 17
 } else {
18 18
 	$this_section = SECTION_MYPROFILE;
19
-	$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
19
+	$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile'));
20 20
 }
21 21
 
22 22
 $social_right_content = '';
23 23
 
24
-if (isset($_GET['f']) && $_GET['f']=='social') {
24
+if (isset($_GET['f']) && $_GET['f'] == 'social') {
25 25
 	$social_parameter = '?f=social';
26 26
 } else {
27 27
 	if (api_get_setting('extended_profile') == 'true') {
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
 		}
34 34
 		if (api_get_setting('allow_message_tool') == 'true') {
35 35
 		    $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
36
-                Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
36
+                Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>';
37 37
             $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
38
-                Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
38
+                Display::return_icon('inbox.png', get_lang('Inbox')).'</a>';
39 39
             $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
40
-                Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
40
+                Display::return_icon('outbox.png', get_lang('Outbox')).'</a>';
41 41
 		}
42 42
 		$social_right_content .= '</div>';
43 43
 	}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     $show_menu = 'messages_inbox';
54 54
 }
55 55
 
56
-$message  = '';
56
+$message = '';
57 57
 
58 58
 // LEFT COLUMN
59 59
 if (api_get_setting('allow_social_tool') == 'true') {
Please login to merge, or discard this patch.
main/webservices/cm_webservice.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public static function setErrorHandler($handler)
51 51
     {
52
-		if($handler instanceof WSErrorHandler) {
52
+		if ($handler instanceof WSErrorHandler) {
53 53
 			self::$_handler = $handler;
54 54
 		}
55 55
 	}
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
 		// if we are behind a reverse proxy, assume it will send the
121 121
 		// HTTP_X_FORWARDED_FOR header and use this IP instead
122 122
 		if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
123
-		  list($ip1,$ip2) = split(',',$_SERVER['HTTP_X_FORWARDED_FOR']);
123
+		  list($ip1, $ip2) = split(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
124 124
 		  $ip = trim($ip1);
125 125
 		}
126 126
 		$security_key = $ip.$this->_configuration['security_key'];
127 127
 
128
-		if(!api_is_valid_secret_key($secret_key, $security_key)) {
128
+		if (!api_is_valid_secret_key($secret_key, $security_key)) {
129 129
 			return new WSCMError(1, "API key is invalid");
130 130
 		} else {
131 131
 			return null;
@@ -195,15 +195,15 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	protected function getUserId($user_id_field_name, $user_id_value)
197 197
     {
198
-		if($user_id_field_name == "chamilo_user_id") {
199
-			if(UserManager::is_user_id_valid(intval($user_id_value))) {
198
+		if ($user_id_field_name == "chamilo_user_id") {
199
+			if (UserManager::is_user_id_valid(intval($user_id_value))) {
200 200
 				return intval($user_id_value);
201 201
 			} else {
202 202
 				return new WSCMError(100, "User not found");
203 203
 			}
204 204
 		} else {
205 205
 			$user_id = UserManager::get_user_id_from_original_id($user_id_value, $user_id_field_name);
206
-			if($user_id == 0) {
206
+			if ($user_id == 0) {
207 207
 				return new WSCMError(100, "User not found");
208 208
 			} else {
209 209
 				return $user_id;
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 	 */
223 223
 	protected function getCourseId($course_id_field_name, $course_id_value)
224 224
     {
225
-		if($course_id_field_name == "chamilo_course_id") {
226
-			if(CourseManager::get_course_code_from_course_id(intval($course_id_value)) != null) {
225
+		if ($course_id_field_name == "chamilo_course_id") {
226
+			if (CourseManager::get_course_code_from_course_id(intval($course_id_value)) != null) {
227 227
 				return intval($course_id_value);
228 228
 			} else {
229 229
 				return new WSCMError(200, "Course not found");
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
250 250
 	protected function getSessionId($session_id_field_name, $session_id_value)
251 251
 	{
252 252
 		if ($session_id_field_name == "chamilo_session_id") {
253
-			$session = SessionManager::fetch((int)$session_id_value);
254
-			if(!empty($session)) {
253
+			$session = SessionManager::fetch((int) $session_id_value);
254
+			if (!empty($session)) {
255 255
 				return intval($session_id_value);
256 256
 			} else {
257 257
 				return new WSCMError(300, "Session not found");
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 				$session_id_value,
262 262
 				$session_id_field_name
263 263
 			);
264
-			if($session_id == 0) {
264
+			if ($session_id == 0) {
265 265
 				return new WSCMError(300, "Session not found");
266 266
 			} else {
267 267
 				return $session_id;
Please login to merge, or discard this patch.
main/admin/statistics/index.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         <script>
21 21
             $(document).ready(function() {
22 22
                 $.ajax({
23
-                    url: "'. api_get_path(WEB_CODE_PATH) .'inc/ajax/statistics.ajax.php?a=recentlogins",
23
+                    url: "'. api_get_path(WEB_CODE_PATH).'inc/ajax/statistics.ajax.php?a=recentlogins",
24 24
                     type: "POST",
25 25
                     success: function(data) {
26 26
                         Chart.defaults.global.responsive = true;
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 // users ...
51 51
 $tools[$strUsers]['report=users'] = get_lang('CountUsers');
52 52
 $tools[$strUsers]['report=recentlogins'] = get_lang('Logins');
53
-$tools[$strUsers]['report=logins&amp;type=month'] = get_lang('Logins') . ' (' . get_lang('PeriodMonth') . ')';
54
-$tools[$strUsers]['report=logins&amp;type=day'] = get_lang('Logins') . ' (' . get_lang('PeriodDay') . ')';
55
-$tools[$strUsers]['report=logins&amp;type=hour'] = get_lang('Logins') . ' (' . get_lang('PeriodHour') . ')';
56
-$tools[$strUsers]['report=pictures'] = get_lang('CountUsers') . ' (' . get_lang('UserPicture') . ')';
53
+$tools[$strUsers]['report=logins&amp;type=month'] = get_lang('Logins').' ('.get_lang('PeriodMonth').')';
54
+$tools[$strUsers]['report=logins&amp;type=day'] = get_lang('Logins').' ('.get_lang('PeriodDay').')';
55
+$tools[$strUsers]['report=logins&amp;type=hour'] = get_lang('Logins').' ('.get_lang('PeriodHour').')';
56
+$tools[$strUsers]['report=pictures'] = get_lang('CountUsers').' ('.get_lang('UserPicture').')';
57 57
 $tools[$strUsers]['report=no_login_users'] = get_lang('StatsUsersDidNotLoginInLastPeriods');
58 58
 $tools[$strUsers]['report=zombies'] = get_lang('Zombies');
59 59
 
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
 echo '<table><tr>';
69 69
 foreach ($tools as $section => $items) {
70 70
     echo '<td style="vertical-align:top;">';
71
-    echo '<h3>' . $section . '</h3>';
71
+    echo '<h3>'.$section.'</h3>';
72 72
     echo '<ul>';
73 73
     foreach ($items as $key => $value) {
74
-        echo '<li><a href="index.php?' . $key . '">' . $value . '</a></li>';
74
+        echo '<li><a href="index.php?'.$key.'">'.$value.'</a></li>';
75 75
     }
76 76
     echo '</ul>';
77 77
     echo '</td>';
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 echo '</tr></table>';
80 80
 
81 81
 $course_categories = Statistics::getCourseCategories();
82
-echo '<br/><br/>';//@todo: spaces between elements should be handled in the css, br should be removed if only there for presentation
82
+echo '<br/><br/>'; //@todo: spaces between elements should be handled in the css, br should be removed if only there for presentation
83 83
 
84 84
 switch ($report) {
85 85
     case 'courses':
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         Statistics::printStats(get_lang('Students'), $students);
122 122
         break;
123 123
     case 'recentlogins':
124
-        echo '<h2>'. sprintf(get_lang('LastXDays'), '15') . '</h2>';
124
+        echo '<h2>'.sprintf(get_lang('LastXDays'), '15').'</h2>';
125 125
         echo '<canvas class="col-md-12" id="canvas" height="100px" style="margin-bottom: 20px"></canvas>';
126 126
         Statistics::printRecentLoginStats();
127 127
         Statistics::printRecentLoginStats(true);
Please login to merge, or discard this patch.
main/inc/lib/javascript/svgedit/svg-editor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * @since 25/september/2010
6 6
  */
7 7
 
8
-require_once '../../../../inc/global.inc.php';//hack for Chamilo
8
+require_once '../../../../inc/global.inc.php'; //hack for Chamilo
9 9
 api_protect_course_script();
10 10
 api_block_anonymous_users();
11 11
 if (!isset($_SESSION['draw_dir'])) {
Please login to merge, or discard this patch.
main/inc/lib/javascript/svgedit/extensions/savefile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 		exit;
9 9
 	}
10 10
 	$svg = $_POST['output_svg'];
11
-	$filename = (isset($_POST['filename']) && !empty($_POST['filename']) ? preg_replace('@[\\\\/:*?"<>|]@u', '_', $_POST['filename']) : 'saved') . '.svg'; // These characters are indicated as prohibited by Windows
11
+	$filename = (isset($_POST['filename']) && !empty($_POST['filename']) ? preg_replace('@[\\\\/:*?"<>|]@u', '_', $_POST['filename']) : 'saved').'.svg'; // These characters are indicated as prohibited by Windows
12 12
 
13 13
 	$fh = fopen($filename, 'w') or die("Can't open file");
14 14
 	fwrite($fh, $svg);
Please login to merge, or discard this patch.
main/inc/lib/javascript/svgedit/extensions/imagelib/users.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 		$slideshow_extension = strrchr($file, '.');
26 26
 		$slideshow_extension = strtolower($slideshow_extension);
27 27
 		if (in_array($slideshow_extension, $accepted_extensions)) {
28
-			$png_svg_files[] =$file;
28
+			$png_svg_files[] = $file;
29 29
 		}
30 30
 	}
31 31
 }
32 32
 $style = '<style>';
33 33
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";';
34 34
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";';
35
-$style .='</style>';
35
+$style .= '</style>';
36 36
 
37 37
 ?>
38 38
 <!doctype html>
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
 if (!empty($png_svg_files)) {
49 49
 	echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
50 50
 	echo '<ul>';
51
-	foreach($png_svg_files as $filename) {
51
+	foreach ($png_svg_files as $filename) {
52 52
 		$image = $user_disk_path.$filename;
53 53
 
54
-		if (strpos($filename, "svg")){
54
+		if (strpos($filename, "svg")) {
55 55
 			$new_sizes['width'] = 60;
56 56
 			$new_sizes['height'] = 60;
57 57
 		} else {
Please login to merge, or discard this patch.
main/inc/lib/javascript/svgedit/extensions/imagelib/groups.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $slideshow_extension = strrchr($file, '.');
48 48
         $slideshow_extension = strtolower($slideshow_extension);
49 49
         if (in_array($slideshow_extension, $accepted_extensions)) {
50
-            $png_svg_files[] =$file;
50
+            $png_svg_files[] = $file;
51 51
         }
52 52
     }
53 53
 }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 $style = '<style>';
56 56
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";';
57 57
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";';
58
-$style .='</style>';
58
+$style .= '</style>';
59 59
 
60 60
 ?>
61 61
 <!doctype html>
@@ -68,15 +68,15 @@  discard block
 block discarded – undo
68 68
 if ((
69 69
         $group_properties['doc_state'] == 2 &&
70 70
         ($is_allowed_to_edit || GroupManager :: is_user_in_group($_user['user_id'], $groupId))) || $group_properties['doc_state'] == 1
71
-){
71
+) {
72 72
 
73 73
 	if (!empty($png_svg_files)) {
74 74
 		echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
75 75
 		echo '<ul>';
76
-		foreach($png_svg_files as $filename) {
76
+		foreach ($png_svg_files as $filename) {
77 77
 			$image = $group_disk_path.$filename;
78 78
 
79
-			if (strpos($filename, "svg")){
79
+			if (strpos($filename, "svg")) {
80 80
 				$new_sizes['width'] = 60;
81 81
 				$new_sizes['height'] = 60;
82 82
 			} else {
Please login to merge, or discard this patch.
main/inc/lib/javascript/svgedit/extensions/imagelib/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
14 14
 
15
-$curdirpath='/images/gallery'; //path of library directory
15
+$curdirpath = '/images/gallery'; //path of library directory
16 16
 
17 17
 $course_info = api_get_course_info();
18 18
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		$slideshow_extension = strrchr($file, '.');
37 37
 		$slideshow_extension = strtolower($slideshow_extension);
38 38
 		if (in_array($slideshow_extension, $accepted_extensions)) {
39
-			$png_svg_files[] =$file;
39
+			$png_svg_files[] = $file;
40 40
 		}
41 41
 	}
42 42
 }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 $style = '<style>';
48 48
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";';
49 49
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";';
50
-$style .='</style>';
50
+$style .= '</style>';
51 51
 
52 52
 ?>
53 53
 <!doctype html>
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
 if (!empty($png_svg_files)) {
60 60
 	echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
61 61
 	echo '<ul>';
62
-	foreach($png_svg_files as $filename) {
63
-		$image=$disk_path.$filename;
62
+	foreach ($png_svg_files as $filename) {
63
+		$image = $disk_path.$filename;
64 64
 
65
-		if (strpos($filename, "svg")){
65
+		if (strpos($filename, "svg")) {
66 66
 			$new_sizes['width'] = 60;
67 67
 			$new_sizes['height'] = 60;
68 68
 		}
Please login to merge, or discard this patch.
main/document/create_draw.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 $groupId = api_get_group_id();
72 72
 
73 73
 if (!empty($groupId)) {
74
-	$interbreadcrumb[] = array (
74
+	$interbreadcrumb[] = array(
75 75
         "url" => "../group/group_space.php?".api_get_cidreq(),
76 76
         "name" => get_lang('GroupSpace')
77 77
     );
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 echo '<div class="actions">';
134 134
 echo '<a href="document.php?id='.$document_id.'">'.
135
-    Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
135
+    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
136 136
 echo '</div>';
137 137
 
138 138
 if (api_browser_support('svg')) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	$langsvgedit = api_get_language_isocode();
143 143
 	$langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit;
144 144
 	$langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'javascript/svgedit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en';
145
-	$svg_url= api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?lang='.$langsvgedit;
145
+	$svg_url = api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?lang='.$langsvgedit;
146 146
 	?>
147 147
 	<script>
148 148
 		document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo  $svg_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>');
Please login to merge, or discard this patch.