Completed
Push — 1.11.x ( ca7787...41c0f2 )
by José
31:51
created
main/document/show_content.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -90,12 +90,12 @@
 block discarded – undo
90 90
 $file_url_web = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file.'?'.api_get_cidreq();
91 91
 $pathinfo = pathinfo($header_file);
92 92
 
93
-if ($pathinfo['extension']=='swf') {
94
-	$width='83%';
95
-	$height='83%';
93
+if ($pathinfo['extension'] == 'swf') {
94
+	$width = '83%';
95
+	$height = '83%';
96 96
 } else {
97
-	$width='100%';
98
-	$height='100%';
97
+	$width = '100%';
98
+	$height = '100%';
99 99
 }
100 100
 
101 101
 echo '<iframe border="0" frameborder="0" scrolling="no" style="width:'.$width.'; height:'.$height.';background-color:#ffffff;" id="mainFrame" name="mainFrame" src="'.$file_url_web.'?'.api_get_cidreq().'&amp;rand='.mt_rand(1, 1000).'"></iframe>';
Please login to merge, or discard this patch.
main/admin/usergroups.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
 //Add the JS needed to use the jqgrid
16 16
 $htmlHeadXtra[] = api_get_jqgrid_js();
17 17
 // setting breadcrumbs
18
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
18
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
19 19
 $action = isset($_GET['action']) ? $_GET['action'] : null;
20 20
 if ($action == 'add') {
21
-    $interbreadcrumb[] = array('url' => 'usergroups.php','name' => get_lang('Classes'));
22
-    $interbreadcrumb[] = array('url' => '#','name' => get_lang('Add'));
21
+    $interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes'));
22
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
23 23
 } elseif ($action == 'edit') {
24
-    $interbreadcrumb[] = array('url' => 'usergroups.php','name' => get_lang('Classes'));
25
-    $interbreadcrumb[] = array('url' => '#','name' => get_lang('Edit'));
24
+    $interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes'));
25
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
26 26
 } else {
27
-    $interbreadcrumb[] = array('url' => '#','name' => get_lang('Classes'));
27
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Classes'));
28 28
 }
29 29
 
30 30
 // The header.
@@ -55,13 +55,13 @@  discard block
 block discarded – undo
55 55
 );
56 56
 
57 57
 //Column config
58
-$column_model   = array(
59
-    array('name'=>'name',           'index'=>'name',        'width'=>'35',  'align'=>'left'),
60
-    array('name'=>'users',    		'index'=>'users', 		'width'=>'15',  'align'=>'left'),
61
-    array('name'=>'courses',    	'index'=>'courses', 	'width'=>'15',  'align'=>'left'),
62
-    array('name'=>'sessions',    	'index'=>'sessions', 	'width'=>'15',  'align'=>'left'),
63
-    array('name'=>'group_type',    	'index'=>'group_type', 	'width'=>'15',  'align'=>'center'),
64
-    array('name'=>'actions',        'index'=>'actions',     'width'=>'20',  'align'=>'center', 'sortable'=>'false','formatter'=>'action_formatter'),
58
+$column_model = array(
59
+    array('name'=>'name', 'index'=>'name', 'width'=>'35', 'align'=>'left'),
60
+    array('name'=>'users', 'index'=>'users', 'width'=>'15', 'align'=>'left'),
61
+    array('name'=>'courses', 'index'=>'courses', 'width'=>'15', 'align'=>'left'),
62
+    array('name'=>'sessions', 'index'=>'sessions', 'width'=>'15', 'align'=>'left'),
63
+    array('name'=>'group_type', 'index'=>'group_type', 'width'=>'15', 'align'=>'center'),
64
+    array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'center', 'sortable'=>'false', 'formatter'=>'action_formatter'),
65 65
 );
66 66
 
67 67
 //Autowidth
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
 //With this function we can add actions to the jgrid
74 74
 $action_links = 'function action_formatter (cellvalue, options, rowObject) {
75 75
     return \''
76
-    .' <a href="add_users_to_usergroup.php?id=\'+options.rowId+\'">' . Display::return_icon('user_to_class.png', get_lang('SubscribeUsersToClass'), null, ICON_SIZE_MEDIUM) . '</a>'
77
-    .' <a href="add_courses_to_usergroup.php?id=\'+options.rowId+\'">' . Display::return_icon('course_to_class.png', get_lang('SubscribeClassToCourses'), null, ICON_SIZE_MEDIUM) . '</a>'
78
-    .' <a href="add_sessions_to_usergroup.php?id=\'+options.rowId+\'">' . Display::return_icon('sessions_to_class.png', get_lang('SubscribeClassToSessions'), null, ICON_SIZE_MEDIUM) . '</a>'
79
-    .' <a href="?action=edit&id=\'+options.rowId+\'">' . Display::return_icon('edit.png', get_lang('Edit'), null, ICON_SIZE_SMALL) . '</a>'
80
-    .' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?action=delete&id=\'+options.rowId+\'">' . Display::return_icon('delete.png', get_lang('Delete'), null, ICON_SIZE_SMALL) . '</a>\';
76
+    .' <a href="add_users_to_usergroup.php?id=\'+options.rowId+\'">'.Display::return_icon('user_to_class.png', get_lang('SubscribeUsersToClass'), null, ICON_SIZE_MEDIUM).'</a>'
77
+    .' <a href="add_courses_to_usergroup.php?id=\'+options.rowId+\'">'.Display::return_icon('course_to_class.png', get_lang('SubscribeClassToCourses'), null, ICON_SIZE_MEDIUM).'</a>'
78
+    .' <a href="add_sessions_to_usergroup.php?id=\'+options.rowId+\'">'.Display::return_icon('sessions_to_class.png', get_lang('SubscribeClassToSessions'), null, ICON_SIZE_MEDIUM).'</a>'
79
+    .' <a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), null, ICON_SIZE_SMALL).'</a>'
80
+    .' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;"  href="?action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), null, ICON_SIZE_SMALL).'</a>\';
81 81
 }';
82 82
 
83 83
 ?>
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     } else {
129 129
         echo '<div class="actions">';
130 130
         echo '<a href="'.api_get_self().'">'.
131
-                Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
131
+                Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
132 132
         echo '</div>';
133 133
         $token = Security::get_token();
134 134
         $form->addElement('hidden', 'sec_token');
Please login to merge, or discard this patch.
src/Chamilo/PageBundle/Controller/PageController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 
43 43
         return $this->render(
44 44
             '@ChamiloPage/latest.html.twig',
45
-            [ 'pages' => $pagesToShow ]
45
+            ['pages' => $pagesToShow]
46 46
         );
47 47
     }
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Element/SelectAjax.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         $iso = api_get_language_isocode(api_get_interface_language());
26 26
         $languageCondition = '';
27 27
 
28
-        if (file_exists(api_get_path(SYS_PATH) . "web/assets/select2/dist/js/i18n/$iso.js")) {
28
+        if (file_exists(api_get_path(SYS_PATH)."web/assets/select2/dist/js/i18n/$iso.js")) {
29 29
             $html .= api_get_asset("select2/dist/js/i18n/$iso.js");
30 30
             $languageCondition = "language: '$iso',";
31 31
         }
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
         //Get the minimumInputLength for select2
52 52
         $minimumInputLength = $this->getAttribute('minimumInputLength') > 3 ?
53
-            $this->getAttribute('minimumInputLength') :
54
-            3
53
+            $this->getAttribute('minimumInputLength') : 3
55 54
         ;
56 55
 
57 56
         $plHolder = $this->getAttribute('placeholder');
@@ -81,7 +80,7 @@  discard block
 block discarded – undo
81 80
         $multiple = $multiple ? 'true' : 'false';
82 81
 
83 82
         $max = $this->getAttribute('maximumSelectionLength');
84
-        $max = !empty($max) ? "maximumSelectionLength: $max, ": '';
83
+        $max = !empty($max) ? "maximumSelectionLength: $max, " : '';
85 84
 
86 85
         $html .= <<<JS
87 86
             <script>
@@ -125,7 +124,7 @@  discard block
 block discarded – undo
125 124
         $this->removeAttribute('url_function');
126 125
         $this->setAttribute('style', 'width: 100%;');
127 126
 
128
-        return parent::toHtml() . $html;
127
+        return parent::toHtml().$html;
129 128
     }
130 129
 
131 130
     /**
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/extensions/savefile_config.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 api_protect_course_script();
19 19
 api_block_anonymous_users();
20 20
 
21
-if(!isset($_POST['output_svg']) && !isset($_POST['output_png'])) {
22
-    api_not_allowed();//from Chamilo
21
+if (!isset($_POST['output_svg']) && !isset($_POST['output_png'])) {
22
+    api_not_allowed(); //from Chamilo
23 23
     die();
24 24
 }
25 25
 
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 //get SVG-Edit values
46
-$filename = $file;//from svg-edit
47
-$extension = $suffix;// from svg-edit
48
-$content = $contents;//from svg-edit
46
+$filename = $file; //from svg-edit
47
+$extension = $suffix; // from svg-edit
48
+$content = $contents; //from svg-edit
49 49
 
50
-$title = Database::escape_string(str_replace('_',' ',$filename));
50
+$title = Database::escape_string(str_replace('_', ' ', $filename));
51 51
 
52 52
 //get Chamilo variables
53 53
 
54 54
 if (!isset($_SESSION['draw_dir']) && !isset($_SESSION['whereami'])) {
55
-    api_not_allowed();//from Chamilo
55
+    api_not_allowed(); //from Chamilo
56 56
     die();
57 57
 }
58 58
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 $relativeUrlPath = $_SESSION['draw_dir'];
62 62
 $currentTool = $_SESSION['whereami'];
63 63
 $dirBaseDocuments = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
64
-$saveDir=$dirBaseDocuments.$_SESSION['draw_dir'];
64
+$saveDir = $dirBaseDocuments.$_SESSION['draw_dir'];
65 65
 
66 66
 // a bit title security
67 67
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 */
95 95
 
96 96
 //checks if the file exists, then rename the new
97
-if (file_exists($saveDir.'/'.$filename.'.'.$extension) && $currentTool=='document/createdraw') {
97
+if (file_exists($saveDir.'/'.$filename.'.'.$extension) && $currentTool == 'document/createdraw') {
98 98
     $message = get_lang('FileExistsChangeToSave');
99 99
     $params = array(
100 100
         'message' => $message,
@@ -110,21 +110,21 @@  discard block
 block discarded – undo
110 110
 $documentPath = $saveDir.'/'.$drawFileName;
111 111
 
112 112
 //add new document to disk
113
-file_put_contents( $documentPath, $contents );
113
+file_put_contents($documentPath, $contents);
114 114
 
115
-if ($currentTool=='document/createdraw') {
115
+if ($currentTool == 'document/createdraw') {
116 116
     //add document to database
117 117
     $doc_id = add_document($_course, $relativeUrlPath.'/'.$drawFileName, 'file', filesize($documentPath), $title);
118 118
     api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id);
119 119
 
120
-} elseif($currentTool=='document/editdraw') {
120
+} elseif ($currentTool == 'document/editdraw') {
121 121
 
122 122
     //check path
123
-    if (!isset($_SESSION['draw_file'])){
124
-        api_not_allowed();//from Chamilo
123
+    if (!isset($_SESSION['draw_file'])) {
124
+        api_not_allowed(); //from Chamilo
125 125
         die();
126 126
     }
127
-    if ($_SESSION['draw_file'] == $drawFileName ){
127
+    if ($_SESSION['draw_file'] == $drawFileName) {
128 128
         $document_id = DocumentManager::get_document_id($_course, $relativeUrlPath.'/'.$drawFileName);
129 129
         update_existing_document($_course, $document_id, filesize($documentPath), null);
130 130
         api_item_property_update($_course, TOOL_DOCUMENT, $document_id, 'DocumentUpdated', $_user['user_id'], $groupId, null, null, null, $current_session_id);
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/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.