Completed
Pull Request — 1.11.x (#1628)
by José
97:30 queued 69:06
created
plugin/tour/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@
 block discarded – undo
5 5
  * @author Angel Fernando Quiroz Campos <[email protected]>
6 6
  * @package chamilo.plugin.tour
7 7
  */
8
-require_once __DIR__ . '/config.php';
8
+require_once __DIR__.'/config.php';
9 9
 
10
-$pluginPath = api_get_path(SYS_PLUGIN_PATH) . 'tour/';
11
-$pluginWebPath = api_get_path(WEB_PLUGIN_PATH) . 'tour/';
10
+$pluginPath = api_get_path(SYS_PLUGIN_PATH).'tour/';
11
+$pluginWebPath = api_get_path(WEB_PLUGIN_PATH).'tour/';
12 12
 
13 13
 $userId = api_get_user_id();
14 14
 
Please login to merge, or discard this patch.
plugin/tour/src/tour_plugin.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,8 +129,8 @@
 block discarded – undo
129 129
      */
130 130
     public function getTourConfig()
131 131
     {
132
-        $pluginPath = api_get_path(SYS_PLUGIN_PATH) . 'tour/';
133
-        $jsonContent = file_get_contents($pluginPath . 'config/tour.json');
132
+        $pluginPath = api_get_path(SYS_PLUGIN_PATH).'tour/';
133
+        $jsonContent = file_get_contents($pluginPath.'config/tour.json');
134 134
         $jsonData = json_decode($jsonContent, true);
135 135
 
136 136
         return $jsonData;
Please login to merge, or discard this patch.
plugin/tour/config.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 define('TABLE_TOUR_LOG', 'plugin_tour_log');
11 11
 
12
-require_once api_get_path(SYS_PATH) . 'main/inc/global.inc.php';
13
-require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
14
-require_once api_get_path(SYS_PLUGIN_PATH) . 'tour/src/tour_plugin.class.php';
12
+require_once api_get_path(SYS_PATH).'main/inc/global.inc.php';
13
+require_once api_get_path(LIBRARY_PATH).'plugin.class.php';
14
+require_once api_get_path(SYS_PLUGIN_PATH).'tour/src/tour_plugin.class.php';
15 15
 // Edit the config/tour.json file to add more pages or more elements to the guide
Please login to merge, or discard this patch.
plugin/tour/ajax/steps.ajax.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@
 block discarded – undo
6 6
  * @package chamilo.plugin.tour
7 7
  */
8 8
 require_once __DIR__.'/../../../main/inc/global.inc.php';
9
-require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
10
-require_once api_get_path(SYS_PLUGIN_PATH) . 'tour/src/tour_plugin.class.php';
9
+require_once api_get_path(LIBRARY_PATH).'plugin.class.php';
10
+require_once api_get_path(SYS_PLUGIN_PATH).'tour/src/tour_plugin.class.php';
11 11
 
12 12
 if (!api_is_anonymous()) {
13 13
     $currentPageClass = isset($_GET['page_class']) ? $_GET['page_class'] : '';
Please login to merge, or discard this patch.
main/document/edit_paint.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -33,26 +33,26 @@  discard block
 block discarded – undo
33 33
     $my_cur_dir_path = isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : null;
34 34
 }
35 35
 
36
-$dir= str_replace('\\', '/', $dir);//and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
36
+$dir = str_replace('\\', '/', $dir); //and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
37 37
 
38 38
 /* Constants & Variables */
39
-$current_session_id=api_get_session_id();
39
+$current_session_id = api_get_session_id();
40 40
 //path for pixlr save
41
-$_SESSION['paint_dir']=Security::remove_XSS($dir);
42
-if($_SESSION['paint_dir']=='/'){
43
-    $_SESSION['paint_dir']='';
41
+$_SESSION['paint_dir'] = Security::remove_XSS($dir);
42
+if ($_SESSION['paint_dir'] == '/') {
43
+    $_SESSION['paint_dir'] = '';
44 44
 }
45
-$_SESSION['paint_file']=basename(Security::remove_XSS($file_path));
45
+$_SESSION['paint_file'] = basename(Security::remove_XSS($file_path));
46 46
 
47 47
 $get_file = Security::remove_XSS($file_path);
48 48
 
49 49
 $file = basename($get_file);
50 50
 
51
-$temp_file = explode(".",$file);
52
-$filename=$temp_file[0];
53
-$nameTools = get_lang('EditDocument') . ': '.$filename;
51
+$temp_file = explode(".", $file);
52
+$filename = $temp_file[0];
53
+$nameTools = get_lang('EditDocument').': '.$filename;
54 54
 
55
-$courseDir   = $_course['path'].'/document';
55
+$courseDir = $_course['path'].'/document';
56 56
 
57 57
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
58 58
 
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
 $is_certificate_mode = DocumentManager::is_certificate_mode($dir);
97 97
 
98 98
 if (!$is_certificate_mode)
99
-	$interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
99
+	$interbreadcrumb[] = array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
100 100
 else
101
-	$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
101
+	$interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
102 102
 
103 103
 // Interbreadcrumb for the current directory root path
104 104
 if (empty($document_data['parents'])) {
105 105
     $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
106 106
 } else {
107
-    foreach($document_data['parents'] as $document_sub_data) {
107
+    foreach ($document_data['parents'] as $document_sub_data) {
108 108
         if ($document_data['title'] == $document_sub_data['title']) {
109 109
             continue;
110 110
         }
@@ -124,33 +124,33 @@  discard block
 block discarded – undo
124 124
 Display :: display_header($nameTools, 'Doc');
125 125
 echo '<div class="actions">';
126 126
 echo '<a href="document.php?id='.$parent_id.'&'.api_get_cidreq().'">'.
127
-    Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
127
+    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
128 128
 echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'&'.api_get_cidreq().'&origin=editpaint">'.
129
-    Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comment'),'',ICON_SIZE_MEDIUM).'</a>';
129
+    Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comment'), '', ICON_SIZE_MEDIUM).'</a>';
130 130
 echo '</div>';
131 131
 
132 132
 ///pixlr
133
-$title=$file;//disk name. No sql name because pixlr return this when save
133
+$title = $file; //disk name. No sql name because pixlr return this when save
134 134
 $pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
135
-$langpixlr  = api_get_language_isocode();
135
+$langpixlr = api_get_language_isocode();
136 136
 $langpixlr = isset($pixlr_code_translation_table[$langpixlr]) ? $pixlredit_code_translation_table[$langpixlr] : $langpixlr;
137
-$loc=$langpixlr;// deprecated ?? TODO:check pixlr read user browser
137
+$loc = $langpixlr; // deprecated ?? TODO:check pixlr read user browser
138 138
 
139
-$exit_path=api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
140
-$_SESSION['exit_pixlr']= Security::remove_XSS($parent_id);
139
+$exit_path = api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
140
+$_SESSION['exit_pixlr'] = Security::remove_XSS($parent_id);
141 141
 
142
-$referrer="Chamilo";
142
+$referrer = "Chamilo";
143 143
 
144
-$target_path=api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
145
-$target=$target_path;
144
+$target_path = api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
145
+$target = $target_path;
146 146
 
147
-$locktarget="true";
148
-$locktitle="false";
147
+$locktarget = "true";
148
+$locktitle = "false";
149 149
 
150
-if ($_SERVER['HTTP_HOST']=="localhost") {
151
-	$path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml';
150
+if ($_SERVER['HTTP_HOST'] == "localhost") {
151
+	$path_and_file = api_get_path(SYS_PATH).'/crossdomain.xml';
152 152
 	if (!file_exists($path_and_file)) {
153
-		$crossdomain='<?xml version="1.0"?>
153
+		$crossdomain = '<?xml version="1.0"?>
154 154
 			<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
155 155
 			<cross-domain-policy>
156 156
 				<allow-access-from domain="cdn.pixlr.com" />
@@ -159,23 +159,23 @@  discard block
 block discarded – undo
159 159
 			</cross-domain-policy>';//more open domain="*"
160 160
 		@file_put_contents($path_and_file, $crossdomain);
161 161
 	}
162
-	$credentials="true";
162
+	$credentials = "true";
163 163
 }
164 164
 else {
165
-	$credentials="false";
165
+	$credentials = "false";
166 166
 }
167 167
 
168 168
 //make temp images
169
-$temp_folder=api_get_path(SYS_ARCHIVE_PATH).'temp/images';
169
+$temp_folder = api_get_path(SYS_ARCHIVE_PATH).'temp/images';
170 170
 if (!file_exists($temp_folder)) {
171
-    @mkdir($temp_folder, api_get_permissions_for_new_directories(), true);//TODO:check $permissions value, now empty;
171
+    @mkdir($temp_folder, api_get_permissions_for_new_directories(), true); //TODO:check $permissions value, now empty;
172 172
 }
173 173
 
174 174
 //make htaccess with allow from all, and file index.html into temp/images
175
-$htaccess=api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
175
+$htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
176 176
 if (!file_exists($htaccess)) {
177 177
 
178
-	$htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
178
+	$htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes";
179 179
 
180 180
 	$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w');
181 181
 	if ($fp) {
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
 	}
185 185
 }
186 186
 
187
-$html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
187
+$html_index = api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
188 188
 if (!file_exists($html_index)) {
189
-	$html_index_content="<html><head></head><body></body></html>";
189
+	$html_index_content = "<html><head></head><body></body></html>";
190 190
 	$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w');
191 191
 	if ($fp) {
192 192
 		fwrite($fp, $html_index_content);
@@ -195,20 +195,20 @@  discard block
 block discarded – undo
195 195
 }
196 196
 
197 197
 //encript temp name file
198
-$name_crip=sha1(uniqid());//encript
199
-$findext= explode(".", $file);
200
-$extension= $findext[count($findext)-1];
201
-$file_crip=$name_crip.'.'.$extension;
198
+$name_crip = sha1(uniqid()); //encript
199
+$findext = explode(".", $file);
200
+$extension = $findext[count($findext) - 1];
201
+$file_crip = $name_crip.'.'.$extension;
202 202
 
203 203
 //copy file to temp/images directory
204
-$from=$filepath.$file;
205
-$to=api_get_path(SYS_ARCHIVE_PATH).'temp/images/'.$file_crip;
204
+$from = $filepath.$file;
205
+$to = api_get_path(SYS_ARCHIVE_PATH).'temp/images/'.$file_crip;
206 206
 copy($from, $to);
207
-$_SESSION['temp_realpath_image']=$to;
207
+$_SESSION['temp_realpath_image'] = $to;
208 208
 
209 209
 //load image to url
210
-$to_url=api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
211
-$image=urlencode($to_url);
210
+$to_url = api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
211
+$image = urlencode($to_url);
212 212
 $pixlr_url = api_get_protocol().'://pixlr.com/editor/?title='.$title.'&image='.$image.'&loc='.$loc.'&referrer='.$referrer.'&target='.$target.'&exit='.$exit_path.'&locktarget='.$locktarget.'&locktitle='.$locktitle.'&credentials='.$credentials;
213 213
 
214 214
 //make frame an send image
Please login to merge, or discard this patch.
main/document/create_paint.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -129,27 +129,27 @@
 block discarded – undo
129 129
 
130 130
 // pixlr
131 131
 // max size 1 Mb ??
132
-$title = urlencode(utf8_encode(get_lang('NewImage')));//TODO:check
132
+$title = urlencode(utf8_encode(get_lang('NewImage'))); //TODO:check
133 133
 //
134 134
 $image = Display::returnIconPath('canvas1024x768.png');
135 135
 //
136 136
 $pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
137
-$langpixlr  = api_get_language_isocode();
137
+$langpixlr = api_get_language_isocode();
138 138
 $langpixlr = isset($pixlr_code_translation_table[$langpixlr]) ? $pixlredit_code_translation_table[$langpixlr] : $langpixlr;
139
-$loc=$langpixlr;// deprecated ?? TODO:check pixlr read user browser
140
-
141
-$exit_path=api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
142
-$_SESSION['exit_pixlr']=$document_data['path'];
143
-$referrer="Chamilo";
144
-$target_path=api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
145
-$target=$target_path;
146
-$locktarget="true";
147
-$locktitle="false";
148
-
149
-if ($_SERVER['HTTP_HOST']=="localhost") {
150
-	$path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml';
139
+$loc = $langpixlr; // deprecated ?? TODO:check pixlr read user browser
140
+
141
+$exit_path = api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
142
+$_SESSION['exit_pixlr'] = $document_data['path'];
143
+$referrer = "Chamilo";
144
+$target_path = api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
145
+$target = $target_path;
146
+$locktarget = "true";
147
+$locktitle = "false";
148
+
149
+if ($_SERVER['HTTP_HOST'] == "localhost") {
150
+	$path_and_file = api_get_path(SYS_PATH).'/crossdomain.xml';
151 151
 	if (!file_exists($path_and_file)) {
152
-		$crossdomain='<?xml version="1.0"?>
152
+		$crossdomain = '<?xml version="1.0"?>
153 153
 			<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
154 154
 			<cross-domain-policy>
155 155
 				<allow-access-from domain="cdn.pixlr.com" />
Please login to merge, or discard this patch.
src/Chamilo/FaqBundle/Entity/Question.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
      */
220 220
     public function getEntityIdentifier()
221 221
     {
222
-        return 'GenjFaqBundle:Question:' . $this->getId();
222
+        return 'GenjFaqBundle:Question:'.$this->getId();
223 223
     }
224 224
 
225 225
     /**
Please login to merge, or discard this patch.
main/auth/external_login/facebook.init.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,5 +22,5 @@
 block discarded – undo
22 22
  * See facebook section of the auth.conf.php file
23 23
  */
24 24
 
25
-require dirname(__FILE__) . '/../../../app/config/auth.conf.php';
25
+require dirname(__FILE__).'/../../../app/config/auth.conf.php';
26 26
 
Please login to merge, or discard this patch.
main/mySpace/company_reports.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     api_not_allowed(true);
17 17
 }
18 18
 
19
-$interbreadcrumb[] = array ('url' => api_is_student_boss()?'#':'index.php', 'name' => get_lang('MySpace'));
19
+$interbreadcrumb[] = array('url' => api_is_student_boss() ? '#' : 'index.php', 'name' => get_lang('MySpace'));
20 20
 $tool_name = get_lang('Report');
21 21
 
22 22
 $this_section = SECTION_TRACKING;
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
 //Column config
44 44
 $column_model = array(
45
-    array('name'=>'course',         'index'=>'title',       'width'=>'180', 'align'=>'left', 'wrap_cell' => 'true'),
46
-    array('name'=>'user',           'index'=>'user',        'width'=>'100', 'align'=>'left','sortable'=>'false', 'wrap_cell' => 'true'),
47
-    array('name'=>'email',          'index'=>'email',       'width'=>'100', 'align'=>'left','sortable'=>'false', 'wrap_cell' => 'true'),
48
-    array('name'=>'time',           'index'=>'time',        'width'=>'50',  'align'=>'left','sortable'=>'false'),
49
-    array('name'=>'certificate',    'index'=>'certificate', 'width'=>'50',  'align'=>'left','sortable'=>'false'),
50
-    array('name'=>'progress_100',   'index'=>'progress_100',       'width'=>'50',  'align'=>'left','sortable'=>'false'),
51
-    array('name'=>'progress',       'index'=>'progress',    'width'=>'50',  'align'=>'left','sortable'=>'false')
45
+    array('name'=>'course', 'index'=>'title', 'width'=>'180', 'align'=>'left', 'wrap_cell' => 'true'),
46
+    array('name'=>'user', 'index'=>'user', 'width'=>'100', 'align'=>'left', 'sortable'=>'false', 'wrap_cell' => 'true'),
47
+    array('name'=>'email', 'index'=>'email', 'width'=>'100', 'align'=>'left', 'sortable'=>'false', 'wrap_cell' => 'true'),
48
+    array('name'=>'time', 'index'=>'time', 'width'=>'50', 'align'=>'left', 'sortable'=>'false'),
49
+    array('name'=>'certificate', 'index'=>'certificate', 'width'=>'50', 'align'=>'left', 'sortable'=>'false'),
50
+    array('name'=>'progress_100', 'index'=>'progress_100', 'width'=>'50', 'align'=>'left', 'sortable'=>'false'),
51
+    array('name'=>'progress', 'index'=>'progress', 'width'=>'50', 'align'=>'left', 'sortable'=>'false')
52 52
 );
53 53
 
54 54
 if (!empty($extra_fields)) {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 }
68 68
 
69 69
 if (api_is_student_boss()) {
70
-    $column_model[] = array('name'=>'group', 'index'=>'group', 'width'=>'50', 'align'=>'left','sortable'=>'false');
70
+    $column_model[] = array('name'=>'group', 'index'=>'group', 'width'=>'50', 'align'=>'left', 'sortable'=>'false');
71 71
     $columns[] = get_lang('Group');
72 72
 }
73 73
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 $htmlHeadXtra[] = '<script>
80 80
 $(function() {
81
-    '.Display::grid_js('user_course_report',  $url, $columns, $column_model, $extra_params, array(), null, true).'
81
+    '.Display::grid_js('user_course_report', $url, $columns, $column_model, $extra_params, array(), null, true).'
82 82
     jQuery("#user_course_report").jqGrid("navGrid","#user_course_report_pager",{
83 83
         view:false,
84 84
         edit:false,
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
 if (api_is_student_boss()) {
103 103
     $actions .= Display::url(
104 104
         Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM),
105
-        api_get_path(WEB_CODE_PATH) . "auth/my_progress.php"
105
+        api_get_path(WEB_CODE_PATH)."auth/my_progress.php"
106 106
     );
107 107
     $actions .= Display::url(
108 108
         Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM),
109
-        api_get_path(WEB_CODE_PATH) . "mySpace/student.php"
109
+        api_get_path(WEB_CODE_PATH)."mySpace/student.php"
110 110
     );
111 111
     $actions .= Display::url(
112 112
         Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM),
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             [],
120 120
             ICON_SIZE_MEDIUM
121 121
         ),
122
-        api_get_path(WEB_CODE_PATH) . "gradebook/certificate_report.php"
122
+        api_get_path(WEB_CODE_PATH)."gradebook/certificate_report.php"
123 123
     );
124 124
 }
125 125
 
@@ -130,13 +130,13 @@  discard block
 block discarded – undo
130 130
 }
131 131
 $content .= Display::url(
132 132
     get_lang("CompanyReportResumed"),
133
-    api_get_path(WEB_CODE_PATH) . "mySpace/company_reports_resumed.php",
133
+    api_get_path(WEB_CODE_PATH)."mySpace/company_reports_resumed.php",
134 134
     array(
135 135
         'class' => 'btn btn-success'
136 136
     )
137 137
 );
138 138
 $content .= '</div>';
139
-$content .= '<h1 class="page-header">' . get_lang('CompanyReport') . '</h1>';
139
+$content .= '<h1 class="page-header">'.get_lang('CompanyReport').'</h1>';
140 140
 $content .= Display::grid_html('user_course_report');
141 141
 
142 142
 $tpl = new Template($tool_name);
Please login to merge, or discard this patch.