Passed
Push — 1.10.x ( 5654d2...115d5a )
by Yannick
263:14 queued 212:07
created
main/chat/chat.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 $mycourseid = api_get_course_id();
38 38
 if (!empty($mycourseid) && $mycourseid != -1) {
39
-	$open_chat_window = api_get_course_setting('allow_open_chat_window');
39
+    $open_chat_window = api_get_course_setting('allow_open_chat_window');
40 40
 }
41 41
 
42 42
 $courseCode = Security::remove_XSS($_GET['cidReq']);
@@ -54,21 +54,21 @@  discard block
 block discarded – undo
54 54
 
55 55
 // If it is a group chat then the breadcrumbs.
56 56
 if (!empty($groupId)) {
57
-	$group_properties  = GroupManager :: get_group_properties($groupId);
57
+    $group_properties  = GroupManager :: get_group_properties($groupId);
58 58
     $interbreadcrumb[] = array(
59 59
         'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(),
60 60
         'name' => get_lang('Groups')
61 61
     );
62
-	$interbreadcrumb[] = array(
62
+    $interbreadcrumb[] = array(
63 63
         'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
64 64
         'name' => get_lang('GroupSpace').' '.$group_properties['name']
65 65
     );
66
-	$noPHP_SELF = true;
67
-	$shortBanner = false;
68
-	$add_group_to_title = ' ('.$group_properties['name'].')';
69
-	$groupfilter = 'group_id="'.$groupId.'"';
66
+    $noPHP_SELF = true;
67
+    $shortBanner = false;
68
+    $add_group_to_title = ' ('.$group_properties['name'].')';
69
+    $groupfilter = 'group_id="'.$groupId.'"';
70 70
 } else {
71
-	$groupfilter = 'group_id=0';
71
+    $groupfilter = 'group_id=0';
72 72
 }
73 73
 
74 74
 if (empty($open_chat_window)) {
Please login to merge, or discard this patch.
main/chat/chat_chat.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
         $filename_chat = 'messages-'.$date_now.'.log.html';
79 79
     }
80 80
 
81
-	if (!file_exists($chat_path.$filename_chat)) {
82
-		@fclose(fopen($chat_path.$filename_chat, 'w'));
83
-		if (!api_is_anonymous()) {
84
-			$doc_id = add_document($_course, $basepath_chat.'/'.$filename_chat, 'file', 0, $filename_chat);
81
+    if (!file_exists($chat_path.$filename_chat)) {
82
+        @fclose(fopen($chat_path.$filename_chat, 'w'));
83
+        if (!api_is_anonymous()) {
84
+            $doc_id = add_document($_course, $basepath_chat.'/'.$filename_chat, 'file', 0, $filename_chat);
85 85
             api_item_property_update(
86 86
                 $_course,
87 87
                 TOOL_DOCUMENT,
@@ -107,28 +107,28 @@  discard block
 block discarded – undo
107 107
                 $session_id
108 108
             );
109 109
             item_property_update_on_folder($_course, $basepath_chat, $userId);
110
-		}
111
-	}
110
+        }
111
+    }
112 112
 
113
-	$basename_chat = '';
114
-	if (!empty($group_id)) {
115
-		$basename_chat = 'messages-'.$date_now.'_gid-'.$group_id;
116
-	} else if (!empty($session_id)) {
117
-		$basename_chat = 'messages-'.$date_now.'_sid-'.$session_id;
118
-	} else {
119
-		$basename_chat = 'messages-'.$date_now;
120
-	}
113
+    $basename_chat = '';
114
+    if (!empty($group_id)) {
115
+        $basename_chat = 'messages-'.$date_now.'_gid-'.$group_id;
116
+    } else if (!empty($session_id)) {
117
+        $basename_chat = 'messages-'.$date_now.'_sid-'.$session_id;
118
+    } else {
119
+        $basename_chat = 'messages-'.$date_now;
120
+    }
121 121
 
122
-	if ($reset && $isMaster) {
122
+    if ($reset && $isMaster) {
123 123
 
124
-		$i = 1;
125
-		while (file_exists($chat_path.$basename_chat.'-'.$i.'.log.html')) {
126
-			$i++;
127
-		}
124
+        $i = 1;
125
+        while (file_exists($chat_path.$basename_chat.'-'.$i.'.log.html')) {
126
+            $i++;
127
+        }
128 128
 
129
-		@rename($chat_path.$basename_chat.'.log.html', $chat_path.$basename_chat.'-'.$i.'.log.html');
130
-		@fclose(fopen($chat_path.$basename_chat.'.log.html', 'w'));
131
-		$doc_id = add_document($_course, $basepath_chat.'/'.$basename_chat.'-'.$i.'.log.html', 'file', filesize($chat_path.$basename_chat.'-'.$i.'.log.html'), $basename_chat.'-'.$i.'.log.html');
129
+        @rename($chat_path.$basename_chat.'.log.html', $chat_path.$basename_chat.'-'.$i.'.log.html');
130
+        @fclose(fopen($chat_path.$basename_chat.'.log.html', 'w'));
131
+        $doc_id = add_document($_course, $basepath_chat.'/'.$basename_chat.'-'.$i.'.log.html', 'file', filesize($chat_path.$basename_chat.'-'.$i.'.log.html'), $basename_chat.'-'.$i.'.log.html');
132 132
 
133 133
         api_item_property_update(
134 134
             $_course,
@@ -161,57 +161,57 @@  discard block
 block discarded – undo
161 161
             $basepath_chat.'/'.$basename_chat.'.log.html'
162 162
         );
163 163
 
164
-		update_existing_document($_course, $doc_id, 0);
165
-	}
166
-
167
-	$remove = 0;
168
-	$content = array();
169
-	if (file_exists($chat_path.$basename_chat.'.log.html')) {
170
-		$content = file($chat_path.$basename_chat.'.log.html');
171
-		$nbr_lines = sizeof($content);
172
-		$remove = $nbr_lines - 100;
173
-	}
174
-
175
-	if ($remove < 0) {
176
-		$remove = 0;
177
-	}
178
-
179
-	array_splice($content, 0, $remove);
180
-	require 'header_frame.inc.php';
181
-
182
-	if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonline') {
183
-	    //the caller
184
-		$content[0] = get_lang('CallSent').'<br />'.$content[0];
185
-	}
186
-	if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonlinejoin') {
187
-	    //the joiner (we have to delete the chat request to him when he joins the chat)
188
-		$track_user_table = Database::get_main_table(TABLE_MAIN_USER);
189
-		$sql = "UPDATE $track_user_table SET
164
+        update_existing_document($_course, $doc_id, 0);
165
+    }
166
+
167
+    $remove = 0;
168
+    $content = array();
169
+    if (file_exists($chat_path.$basename_chat.'.log.html')) {
170
+        $content = file($chat_path.$basename_chat.'.log.html');
171
+        $nbr_lines = sizeof($content);
172
+        $remove = $nbr_lines - 100;
173
+    }
174
+
175
+    if ($remove < 0) {
176
+        $remove = 0;
177
+    }
178
+
179
+    array_splice($content, 0, $remove);
180
+    require 'header_frame.inc.php';
181
+
182
+    if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonline') {
183
+        //the caller
184
+        $content[0] = get_lang('CallSent').'<br />'.$content[0];
185
+    }
186
+    if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonlinejoin') {
187
+        //the joiner (we have to delete the chat request to him when he joins the chat)
188
+        $track_user_table = Database::get_main_table(TABLE_MAIN_USER);
189
+        $sql = "UPDATE $track_user_table SET
190 190
                     chatcall_user_id = '',
191 191
                     chatcall_date = '',
192 192
                     chatcall_text=''
193 193
 		        WHERE (user_id = ".$userId.")";
194
-		$result = Database::query($sql);
195
-	}
194
+        $result = Database::query($sql);
195
+    }
196 196
         
197
-	echo '<div id="content-chat"';
198
-	foreach ($content as & $this_line) {
197
+    echo '<div id="content-chat"';
198
+    foreach ($content as & $this_line) {
199 199
         echo $this_line;
200
-	}
201
-	echo '</div>';
202
-	echo '<a name="bottom" style="text-decoration:none;">&nbsp;</a>';
203
-	if ($isMaster || $is_courseCoach) {
204
-		$rand = mt_rand(1, 1000);
205
-		echo '<div id="clear-chat">';
206
-		echo '<a class="btn btn-danger btn-small " href="'.api_get_self().'?rand='.$rand.'&reset=1&'.api_get_cidreq().'#bottom" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmReset'), ENT_QUOTES)).'\')) return false;">'.
200
+    }
201
+    echo '</div>';
202
+    echo '<a name="bottom" style="text-decoration:none;">&nbsp;</a>';
203
+    if ($isMaster || $is_courseCoach) {
204
+        $rand = mt_rand(1, 1000);
205
+        echo '<div id="clear-chat">';
206
+        echo '<a class="btn btn-danger btn-small " href="'.api_get_self().'?rand='.$rand.'&reset=1&'.api_get_cidreq().'#bottom" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmReset'), ENT_QUOTES)).'\')) return false;">'.
207 207
             get_lang('ClearList').
208 208
             '</a>';
209
-		echo '</div>';
210
-	}
209
+        echo '</div>';
210
+    }
211 211
 } else {
212
-	echo '</div>';
213
-	require 'header_frame.inc.php';
214
-	$message = get_lang('CloseOtherSession');
215
-	Display :: display_error_message($message);
212
+    echo '</div>';
213
+    require 'header_frame.inc.php';
214
+    $message = get_lang('CloseOtherSession');
215
+    Display :: display_error_message($message);
216 216
 }
217 217
 require 'footer_frame.inc.php';
Please login to merge, or discard this patch.
main/chat/chat_hidden.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 
36 36
 $extra_condition = '';
37 37
 if (!empty($group_id)) {
38
-	$extra_condition = $group_condition;
38
+    $extra_condition = $group_condition;
39 39
 } else {
40
-	$extra_condition = $session_condition;
40
+    $extra_condition = $session_condition;
41 41
 }
42 42
 
43 43
 $extra_condition.= " AND c_id = $course_id";
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
 $chat_path = '';
47 47
 $document_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
48 48
 if (!empty($group_id)) {
49
-	$group_info = GroupManager :: get_group_properties($group_id);
50
-	$chat_path = $document_path.$group_info['directory'].'/chat_files/';
49
+    $group_info = GroupManager :: get_group_properties($group_id);
50
+    $chat_path = $document_path.$group_info['directory'].'/chat_files/';
51 51
 } else {
52
-	$chat_path = $document_path.'/chat_files/';
52
+    $chat_path = $document_path.'/chat_files/';
53 53
 }
54 54
 
55 55
 // get chat file
56 56
 $basename_chat = '';
57 57
 if (!empty($group_id)) {
58
-	$basename_chat = 'messages-'.$date_now.'_gid-'.$group_id;
58
+    $basename_chat = 'messages-'.$date_now.'_gid-'.$group_id;
59 59
 } elseif (!empty($session_id)) {
60
-	$basename_chat = 'messages-'.$date_now.'_sid-'.$session_id;
60
+    $basename_chat = 'messages-'.$date_now.'_sid-'.$session_id;
61 61
 } else {
62
-	$basename_chat = 'messages-'.$date_now;
62
+    $basename_chat = 'messages-'.$date_now;
63 63
 }
64 64
 
65 65
 $chat_size_old = isset($_POST['chat_size_old']) ? intval($_POST['chat_size_old']) : null;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 $current_time = api_get_utc_datetime();
79 79
 
80 80
 if (Database::num_rows($result) == 0) {
81
-	$query = "INSERT INTO $tbl_chat_connected(c_id, user_id, last_connection,session_id,to_group_id)
81
+    $query = "INSERT INTO $tbl_chat_connected(c_id, user_id, last_connection,session_id,to_group_id)
82 82
 	          VALUES($course_id, '".$userId."','$current_time','$session_id','$group_id')";
83 83
     Database::query($query);
84 84
     $id = Database::insert_id();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         Database::query($sql);
88 88
     }
89 89
 } else {
90
-	$query = "UPDATE $tbl_chat_connected SET
90
+    $query = "UPDATE $tbl_chat_connected SET
91 91
 	          last_connection='".$current_time."'
92 92
 	          WHERE c_id = $course_id AND user_id='".$userId."' AND session_id='$session_id' AND to_group_id='$group_id'";
93 93
     Database::query($query);
Please login to merge, or discard this patch.
main/glossary/index.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 Event::event_access_tool(TOOL_GLOSSARY);
35 35
 
36 36
 function sorter($item1, $item2) {
37
-	if ($item1[2] == $item2[2])
38
-		return 0;
39
-	return $item1[2] < $item2[2] ? -1 : 1;
37
+    if ($item1[2] == $item2[2])
38
+        return 0;
39
+    return $item1[2] < $item2[2] ? -1 : 1;
40 40
 }
41 41
 
42 42
 // Displaying the header
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $list[] = array ($line[0], $line[1]);
81 81
     }
82 82
     $filename = 'glossary_course_'.api_get_course_id();
83
-	Export::arrayToCsv($list, $filename);
83
+    Export::arrayToCsv($list, $filename);
84 84
 }
85 85
 if (isset($_GET['action']) && $_GET['action'] == 'export_to_pdf') {
86 86
     GlossaryManager::export_to_pdf();
Please login to merge, or discard this patch.
main/inc/global_error_message.inc.php 1 patch
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -56,40 +56,40 @@  discard block
 block discarded – undo
56 56
         $theme = 'chamilo';
57 57
     }
58 58
 
59
-	$css_path = 'app/Resources/public/css/';
60
-	$css_web_assets = 'web/assets/';
61
-	$css_web_path = 'web/css/';
59
+    $css_path = 'app/Resources/public/css/';
60
+    $css_web_assets = 'web/assets/';
61
+    $css_web_path = 'web/css/';
62 62
     $themePath = $css_path.'themes/'.$theme.'/default.css';
63 63
     $css_web_fontawesome = $css_web_assets.'fontawesome/css/font-awesome.css';
64
-	$bootstrap_file = $css_web_assets.'bootstrap/dist/css/bootstrap.min.css';
65
-	$css_base_file = $css_web_path.'base.css';
64
+    $bootstrap_file = $css_web_assets.'bootstrap/dist/css/bootstrap.min.css';
65
+    $css_base_file = $css_web_path.'base.css';
66 66
 
67 67
     $css_list = array($bootstrap_file, $css_base_file, $themePath);
68 68
 
69 69
     $web_img = 'main/img';
70
-	$root_sys = str_replace('\\', '/', realpath(dirname(__FILE__).'/../../')).'/';
71
-	$root_rel = htmlentities($_SERVER['PHP_SELF']);
72
-	if (!empty($root_rel)) {
73
-		$pos = strrpos($root_rel, '/');
74
-		$root_rel = substr($root_rel, 0, $pos - strlen($root_rel) + 1);
75
-		if (strpos($root_rel, '/main/') !== false) {
76
-			$pos = 0;
77
-			while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/main/')) !== false) {
78
-				$pos = $test_pos + 1;
79
-			}
80
-			$root_rel = substr($root_rel, 0, $pos);
81
-		} elseif (strpos($root_rel, '/courses/') !== false) {
82
-			$pos = 0;
83
-			while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/courses/')) !== false) {
84
-				$pos = $test_pos + 1;
85
-			}
86
-			$root_rel = substr($root_rel, 0, $pos);
87
-		}
88
-	}
89
-
90
-	$installation_guide_url = $root_rel.'documentation/installation_guide.html';
91
-
92
-	$css_def = '';
70
+    $root_sys = str_replace('\\', '/', realpath(dirname(__FILE__).'/../../')).'/';
71
+    $root_rel = htmlentities($_SERVER['PHP_SELF']);
72
+    if (!empty($root_rel)) {
73
+        $pos = strrpos($root_rel, '/');
74
+        $root_rel = substr($root_rel, 0, $pos - strlen($root_rel) + 1);
75
+        if (strpos($root_rel, '/main/') !== false) {
76
+            $pos = 0;
77
+            while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/main/')) !== false) {
78
+                $pos = $test_pos + 1;
79
+            }
80
+            $root_rel = substr($root_rel, 0, $pos);
81
+        } elseif (strpos($root_rel, '/courses/') !== false) {
82
+            $pos = 0;
83
+            while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/courses/')) !== false) {
84
+                $pos = $test_pos + 1;
85
+            }
86
+            $root_rel = substr($root_rel, 0, $pos);
87
+        }
88
+    }
89
+
90
+    $installation_guide_url = $root_rel.'documentation/installation_guide.html';
91
+
92
+    $css_def = '';
93 93
     foreach ($css_list as $css_item) {
94 94
         $css_base_chamilo_file = $root_sys.$css_item;
95 95
         if (file_exists($css_base_chamilo_file)) {
@@ -97,33 +97,33 @@  discard block
 block discarded – undo
97 97
         }
98 98
     }
99 99
 
100
-	$global_error_message = array();
101
-
102
-	switch ($global_error_code) {
103
-		case 1:
104
-			$global_error_message['section'] = $SectionSystemRequirementsProblem;
105
-			$global_error_message['title'] = $IncorrectPhpVersionTitle;
106
-			$php_version = function_exists('phpversion') ? phpversion() : (defined('PHP_VERSION') ? PHP_VERSION : '');
107
-			$php_version = empty($php_version) ? '' : '(PHP '.$php_version.')';
108
-			$IncorrectPhpVersionDescription = str_replace('%s1', $php_version, $IncorrectPhpVersionDescription);
109
-			$IncorrectPhpVersionDescription = str_replace('%s2', REQUIRED_PHP_VERSION, $IncorrectPhpVersionDescription);
110
-			$pos = strpos($IncorrectPhpVersionDescription, '%s3');
111
-			if ($pos !== false) {
112
-				$length = strlen($IncorrectPhpVersionDescription);
113
-				$read_installation_guide = substr($IncorrectPhpVersionDescription, $pos + 3, $length);
114
-				$IncorrectPhpVersionDescription = substr($IncorrectPhpVersionDescription, 0, $pos);
115
-				$IncorrectPhpVersionDescription .= '<br /><a class="btn btn-default" href="'.$installation_guide_url.'" target="_blank">'.$read_installation_guide.'</a>';
116
-			}
117
-			$global_error_message['description'] = $IncorrectPhpVersionDescription;
118
-			break;
119
-		case 2:
120
-			$global_error_message['section'] = $SectionInstallation;
121
-			$global_error_message['title'] = $InstallationTitle;
122
-			if (($pos = strpos($InstallationDescription, '%s')) === false) {
123
-				$InstallationDescription = 'Click to INSTALL Chamilo %s or read the installation guide';
124
-			}
125
-			$read_installation_guide = substr($InstallationDescription, $pos + 2);
126
-			$InstallationDescription = '<form action="'.$root_rel.'main/install/index.php" method="get">
100
+    $global_error_message = array();
101
+
102
+    switch ($global_error_code) {
103
+        case 1:
104
+            $global_error_message['section'] = $SectionSystemRequirementsProblem;
105
+            $global_error_message['title'] = $IncorrectPhpVersionTitle;
106
+            $php_version = function_exists('phpversion') ? phpversion() : (defined('PHP_VERSION') ? PHP_VERSION : '');
107
+            $php_version = empty($php_version) ? '' : '(PHP '.$php_version.')';
108
+            $IncorrectPhpVersionDescription = str_replace('%s1', $php_version, $IncorrectPhpVersionDescription);
109
+            $IncorrectPhpVersionDescription = str_replace('%s2', REQUIRED_PHP_VERSION, $IncorrectPhpVersionDescription);
110
+            $pos = strpos($IncorrectPhpVersionDescription, '%s3');
111
+            if ($pos !== false) {
112
+                $length = strlen($IncorrectPhpVersionDescription);
113
+                $read_installation_guide = substr($IncorrectPhpVersionDescription, $pos + 3, $length);
114
+                $IncorrectPhpVersionDescription = substr($IncorrectPhpVersionDescription, 0, $pos);
115
+                $IncorrectPhpVersionDescription .= '<br /><a class="btn btn-default" href="'.$installation_guide_url.'" target="_blank">'.$read_installation_guide.'</a>';
116
+            }
117
+            $global_error_message['description'] = $IncorrectPhpVersionDescription;
118
+            break;
119
+        case 2:
120
+            $global_error_message['section'] = $SectionInstallation;
121
+            $global_error_message['title'] = $InstallationTitle;
122
+            if (($pos = strpos($InstallationDescription, '%s')) === false) {
123
+                $InstallationDescription = 'Click to INSTALL Chamilo %s or read the installation guide';
124
+            }
125
+            $read_installation_guide = substr($InstallationDescription, $pos + 2);
126
+            $InstallationDescription = '<form action="'.$root_rel.'main/install/index.php" method="get">
127 127
 			<div class="row"><div class="col-md-12">
128 128
 
129 129
                     <div class="office">
@@ -135,38 +135,38 @@  discard block
 block discarded – undo
135 135
                           </p>
136 136
                     </div>
137 137
             </form>';
138
-			$global_error_message['description'] = $InstallationDescription;
139
-			break;
140
-		case 3:
141
-		case 4:
142
-		case 5:
143
-			$global_error_message['section'] = $SectionDatabaseUnavailable;
144
-			$global_error_message['title'] = $DatabaseUnavailableTitle;
145
-			$global_error_message['description'] = $DatabaseUnavailableDescription;
146
-			break;
147
-		case 6:
148
-			$global_error_message['section'] = $SectionProtection;
149
-			$global_error_message['title'] = $AlreadyInstalledTitle;
150
-			$global_error_message['description'] = $AlreadyInstalledDescription;
151
-			break;
152
-		default:
153
-			$global_error_message['section'] = $SectionTechnicalIssues;
154
-			$global_error_message['title'] = $TechnicalIssuesTitle;
155
-			$global_error_message['description'] = $TechnicalIssuesDescription;
156
-			break;
157
-	}
158
-
159
-	$show_error_codes = defined('SHOW_ERROR_CODES') && SHOW_ERROR_CODES && $global_error_code != 2;
160
-	$global_error_message['code'] = $show_error_codes ? $ErrorCode.': '.$global_error_code.'<br /><br />' : '';
161
-	$global_error_message['details'] = empty($global_error_message['details']) ? '' : ($show_error_codes ? ': '.$global_error_message['details'] : $global_error_message['details']);
162
-	$global_error_message['organisation'] = $Organisation;
163
-	$global_error_message['powered_by'] = $PoweredBy;
164
-	$global_error_message['encoding'] = 'UTF-8';
165
-	$global_error_message['chamilo_logo'] = "data:image/png;base64,".base64_encode(file_get_contents($root_sys.'web/css/themes/'.$theme.'/images/header-logo.png'));
138
+            $global_error_message['description'] = $InstallationDescription;
139
+            break;
140
+        case 3:
141
+        case 4:
142
+        case 5:
143
+            $global_error_message['section'] = $SectionDatabaseUnavailable;
144
+            $global_error_message['title'] = $DatabaseUnavailableTitle;
145
+            $global_error_message['description'] = $DatabaseUnavailableDescription;
146
+            break;
147
+        case 6:
148
+            $global_error_message['section'] = $SectionProtection;
149
+            $global_error_message['title'] = $AlreadyInstalledTitle;
150
+            $global_error_message['description'] = $AlreadyInstalledDescription;
151
+            break;
152
+        default:
153
+            $global_error_message['section'] = $SectionTechnicalIssues;
154
+            $global_error_message['title'] = $TechnicalIssuesTitle;
155
+            $global_error_message['description'] = $TechnicalIssuesDescription;
156
+            break;
157
+    }
158
+
159
+    $show_error_codes = defined('SHOW_ERROR_CODES') && SHOW_ERROR_CODES && $global_error_code != 2;
160
+    $global_error_message['code'] = $show_error_codes ? $ErrorCode.': '.$global_error_code.'<br /><br />' : '';
161
+    $global_error_message['details'] = empty($global_error_message['details']) ? '' : ($show_error_codes ? ': '.$global_error_message['details'] : $global_error_message['details']);
162
+    $global_error_message['organisation'] = $Organisation;
163
+    $global_error_message['powered_by'] = $PoweredBy;
164
+    $global_error_message['encoding'] = 'UTF-8';
165
+    $global_error_message['chamilo_logo'] = "data:image/png;base64,".base64_encode(file_get_contents($root_sys.'web/css/themes/'.$theme.'/images/header-logo.png'));
166 166
 
167 167
     $installChamiloImage = base64_encode(file_get_contents("$root_sys/main/img/install-chamilo.gif"));
168 168
 
169
-	$global_error_message_page =
169
+    $global_error_message_page =
170 170
 <<<EOM
171 171
 <!DOCTYPE html>
172 172
 <html>
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
 		</body>
237 237
 </html>
238 238
 EOM;
239
-	foreach ($global_error_message as $key => $value) {
240
-		$global_error_message_page = str_replace('{'.strtoupper($key).'}', $value, $global_error_message_page);
241
-	}
242
-	header('Content-Type: text/html; charset='.$global_error_message['encoding']);
243
-	die($global_error_message_page);
239
+    foreach ($global_error_message as $key => $value) {
240
+        $global_error_message_page = str_replace('{'.strtoupper($key).'}', $value, $global_error_message_page);
241
+    }
242
+    header('Content-Type: text/html; charset='.$global_error_message['encoding']);
243
+    die($global_error_message_page);
244 244
 }
Please login to merge, or discard this patch.
main/inc/ajax/skill.ajax.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* For licensing terms, see /license.txt */
3 3
 /**
4
- * Responses to AJAX calls
5
- */
4
+         * Responses to AJAX calls
5
+         */
6 6
 
7 7
 require_once '../global.inc.php';
8 8
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                     //$gradebook['name'] = $gradebook['name'];
56 56
                     //$gradebook_list[]  = $gradebook;
57 57
                 } else {
58
-                  //  $gradebook['name'] = $gradebook_list[$gradebook['parent_id']]['name'].' > '.$gradebook['name'];
58
+                    //  $gradebook['name'] = $gradebook_list[$gradebook['parent_id']]['name'].' > '.$gradebook['name'];
59 59
                     //$gradebook_list[]  = $gradebook;
60 60
                 }
61 61
             }
Please login to merge, or discard this patch.
main/inc/ajax/exercise.ajax.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -488,7 +488,7 @@
 block discarded – undo
488 488
                     $remind_list
489 489
                 );
490 490
 
491
-                 // Destruction of the Question object
491
+                    // Destruction of the Question object
492 492
                 unset($objQuestionTmp);
493 493
                 if ($debug) {
494 494
                     error_log(" -- end question -- ");
Please login to merge, or discard this patch.
main/inc/ajax/course_home.ajax.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 /* For licensing terms, see /license.txt */
3 3
 // @todo refactor this script, create a class that manage the jqgrid requests
4 4
 /**
5
- * Responses to AJAX calls
5
+         * Responses to AJAX calls
6 6
 */
7 7
 $action = $_GET['a'];
8 8
 
@@ -63,39 +63,39 @@  discard block
 block discarded – undo
63 63
             echo json_encode($response_data);
64 64
         }
65 65
         break;
66
-	case 'show_course_information' :
67
-		require_once '../global.inc.php';
68
-
69
-		// Get the name of the database course.
70
-		$tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION);
71
-		$course_info = api_get_course_info($_GET['code']);
72
-
73
-		if ($course_info['visibility'] != COURSE_VISIBILITY_OPEN_WORLD) {
74
-			if (api_is_anonymous()) {
75
-				exit;
76
-			}
77
-		}
78
-		//echo Display::tag('h2', $course_info['name']);
79
-		//echo '<br />';
80
-
81
-		$sql = "SELECT * FROM $tbl_course_description
66
+    case 'show_course_information' :
67
+        require_once '../global.inc.php';
68
+
69
+        // Get the name of the database course.
70
+        $tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION);
71
+        $course_info = api_get_course_info($_GET['code']);
72
+
73
+        if ($course_info['visibility'] != COURSE_VISIBILITY_OPEN_WORLD) {
74
+            if (api_is_anonymous()) {
75
+                exit;
76
+            }
77
+        }
78
+        //echo Display::tag('h2', $course_info['name']);
79
+        //echo '<br />';
80
+
81
+        $sql = "SELECT * FROM $tbl_course_description
82 82
 		        WHERE c_id = ".$course_info['real_id']." AND session_id = 0
83 83
 		        ORDER BY id";
84
-		$result = Database::query($sql);
85
-		if (Database::num_rows($result) > 0 ) {
86
-		    while ($description = Database::fetch_object($result)) {
87
-			    $descriptions[$description->id] = $description;
88
-		    }
84
+        $result = Database::query($sql);
85
+        if (Database::num_rows($result) > 0 ) {
86
+            while ($description = Database::fetch_object($result)) {
87
+                $descriptions[$description->id] = $description;
88
+            }
89 89
             // Function that displays the details of the course description in html.
90
-		    echo CourseManager::get_details_course_description_html(
90
+            echo CourseManager::get_details_course_description_html(
91 91
                 $descriptions,
92 92
                 api_get_system_encoding(),
93 93
                 false
94 94
             );
95
-		} else {
96
-		    echo get_lang('NoDescription');
97
-		}
98
-	    break;
95
+        } else {
96
+            echo get_lang('NoDescription');
97
+        }
98
+        break;
99 99
     case 'session_courses_lp_default':
100 100
         /**
101 101
          * @todo this functions need to belong to a class or a special
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $sidx  = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id';
111 111
         $sord  = $_REQUEST['sord'];    //asc or desc
112 112
         if (!in_array($sord, array('asc','desc'))) {
113
-        	$sord = 'desc';
113
+            $sord = 'desc';
114 114
         }
115 115
         $session_id  = intval($_REQUEST['session_id']);
116 116
         $course_id   = intval($_REQUEST['course_id']);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                     $my_session_list[] = $item['id_session'];
126 126
             }
127 127
             if (!in_array($session_id, $my_session_list)) {
128
-            	break;
128
+                break;
129 129
             }
130 130
         }
131 131
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                     $date = '-';
311 311
                 }
312 312
 
313
-                 //Checking LP publicated and expired_on dates
313
+                    //Checking LP publicated and expired_on dates
314 314
 
315 315
                 if (!empty($lp_item['publicated_on']) && $lp_item['publicated_on'] != '0000-00-00 00:00:00') {
316 316
                     $week_data = date('Y', api_strtotime($lp_item['publicated_on'], 'UTC')).' - '.get_week_from_day($lp_item['publicated_on']);
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                     $date = '-';
439 439
                 }
440 440
 
441
-                 //Checking LP publicated and expired_on dates
441
+                    //Checking LP publicated and expired_on dates
442 442
                 if (!empty($lp_item['publicated_on']) && $lp_item['publicated_on'] != '0000-00-00 00:00:00') {
443 443
                     if ($now < api_strtotime($lp_item['publicated_on'], 'UTC')) {
444 444
                         continue;
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 
493 493
         echo json_encode($response);
494 494
         break;
495
-	default:
496
-		echo '';
495
+    default:
496
+        echo '';
497 497
 }
498 498
 exit;
Please login to merge, or discard this patch.
main/inc/ajax/model.ajax.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
         }
732 732
 
733 733
         break;
734
-	case 'get_user_skill_ranking':
734
+    case 'get_user_skill_ranking':
735 735
         $columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank');
736 736
         $result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $whereCondition);
737 737
         $result = msort($result, 'skills_acquired', 'asc');
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
 
1282 1282
             if (!empty($item['certif_min_score']) && !empty($item['document_id'])) {
1283 1283
                 $item['certificates'] = Display::return_icon('accept.png', get_lang('WithCertificate'), array(), ICON_SIZE_SMALL);
1284
-                 $item['has_certificates'] = '1';
1284
+                    $item['has_certificates'] = '1';
1285 1285
             } else {
1286 1286
                 $item['certificates'] = Display::return_icon('warning.png', get_lang('NoCertificate'), array(), ICON_SIZE_SMALL);
1287 1287
                 $item['has_certificates'] = '0';
Please login to merge, or discard this patch.