Completed
Push — 1.11.x ( d00fca...f1f062 )
by José
28:05
created
main/cron/lang/langstats.class.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
                     return false; //cannot use if sqlite not installed
31 31
                 }
32 32
                 if (empty($file)) {
33
-                    $file = api_get_path(SYS_ARCHIVE_PATH) . '/langstasdb';
33
+                    $file = api_get_path(SYS_ARCHIVE_PATH).'/langstasdb';
34 34
                 }
35 35
                 if (is_file($file) && is_writeable($file)) {
36 36
                     $this->db = new SQLite3($file, SQLITE3_OPEN_READWRITE);
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
                         $this->db = new SQLite3($file);
40 40
                     } catch (Exception $e) {
41 41
                         $this->error = 'DatabaseCreateError';
42
-                        error_log('Exception: ' . $e->getMessage());
42
+                        error_log('Exception: '.$e->getMessage());
43 43
                         return false;
44 44
                     }
45 45
                     $err = $this->db->exec(
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             $num = $row[3];
105 105
             $num++;
106 106
             $res = $this->db->query(
107
-                'UPDATE lang_freq SET term_count = ' . $num . ' WHERE id = ' . $row[0]
107
+                'UPDATE lang_freq SET term_count = '.$num.' WHERE id = '.$row[0]
108 108
             );
109 109
             if ($res === false) {
110 110
                 $this->error = 'CouldNotUpdateTerm';
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     public function get_popular_terms($num = 1000)
137 137
     {
138 138
         $res = $this->db->query(
139
-            'SELECT * FROM lang_freq ORDER BY term_count DESC LIMIT ' . $num
139
+            'SELECT * FROM lang_freq ORDER BY term_count DESC LIMIT '.$num
140 140
         );
141 141
         $list = array();
142 142
         while ($row = $res->fetchArray()) {
@@ -163,16 +163,16 @@  discard block
 block discarded – undo
163 163
      */
164 164
     public function get_variables_origin()
165 165
     {
166
-        $path = api_get_path(SYS_LANG_PATH) . 'english/';
166
+        $path = api_get_path(SYS_LANG_PATH).'english/';
167 167
         $vars = array();
168 168
         $priority = array('trad4all');
169 169
         foreach ($priority as $file) {
170 170
             $list = SubLanguageManager::get_all_language_variable_in_file(
171
-                $path . $file . '.inc.php',
171
+                $path.$file.'.inc.php',
172 172
                 true
173 173
             );
174 174
             foreach ($list as $var => $trad) {
175
-                $vars[$var] = $file . '.inc.php';
175
+                $vars[$var] = $file.'.inc.php';
176 176
             }
177 177
         }
178 178
         $files = scandir($path);
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
                 continue;
182 182
             }
183 183
             $list = SubLanguageManager::get_all_language_variable_in_file(
184
-                $path . $file,
184
+                $path.$file,
185 185
                 true
186 186
             );
187 187
             foreach ($list as $var => $trad) {
Please login to merge, or discard this patch.
main/cron/lang/list_unused_langvars.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $res = preg_match_all('/get_lang\(\'(\\w*)\'\)/', $line, $myTerms);
44 44
         if ($res > 0) {
45 45
             foreach ($myTerms[1] as $term) {
46
-                if (substr($term, 0, 4)=='lang') {
46
+                if (substr($term, 0, 4) == 'lang') {
47 47
                     $term = substr($term, 4);
48 48
                 }
49 49
                 $usedTerms[$term] = $shortFile;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             $res = preg_match_all('/\{[\'"](\\w*)[\'"]\|get_lang\}/', $line, $myTerms);
54 54
             if ($res > 0) {
55 55
                 foreach ($myTerms[1] as $term) {
56
-                    if (substr($term, 0, 4)=='lang') {
56
+                    if (substr($term, 0, 4) == 'lang') {
57 57
                         $term = substr($term, 4);
58 58
                     }
59 59
                     $usedTerms[$term] = $shortFile;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 // Compare defined terms VS used terms. Used terms should be smaller than
68 68
 // defined terms, and this should prove the concept that there are much
69 69
 // more variables than what we really use
70
-if (count($usedTerms)<1) {
70
+if (count($usedTerms) < 1) {
71 71
   die("No used terms<br />\n");
72 72
 } else {
73 73
   echo "The following terms were defined but never used: <br />\n<table>";
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 $i = 1;
76 76
 foreach ($defined_terms as $term => $file) {
77 77
   // remove "lang" prefix just in case
78
-  if (substr($term,0,4)=='lang') { $term = substr($term,4); }
78
+  if (substr($term, 0, 4) == 'lang') { $term = substr($term, 4); }
79 79
   if (!isset($usedTerms[$term])) {
80 80
     echo "<tr><td>$i</td><td>$term</td></tr>\n";
81 81
     $i++;
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
     $list = scandir($base_path);
89 89
     $files = array();
90 90
     foreach ($list as $item) {
91
-    	if (substr($item,0,1)=='.') {continue;}
92
-        $special_dirs = array(api_get_path(SYS_TEST_PATH),api_get_path(SYS_COURSE_PATH),api_get_path(SYS_LANG_PATH),api_get_path(SYS_ARCHIVE_PATH));
93
-        if (in_array($base_path.$item.'/',$special_dirs)) {continue;}
91
+    	if (substr($item, 0, 1) == '.') {continue; }
92
+        $special_dirs = array(api_get_path(SYS_TEST_PATH), api_get_path(SYS_COURSE_PATH), api_get_path(SYS_LANG_PATH), api_get_path(SYS_ARCHIVE_PATH));
93
+        if (in_array($base_path.$item.'/', $special_dirs)) {continue; }
94 94
         if (is_dir($base_path.$item)) {
95
-        	$files = array_merge($files,get_all_php_files($base_path.$item.'/'));
95
+        	$files = array_merge($files, get_all_php_files($base_path.$item.'/'));
96 96
         } else {
97 97
             //only analyse php files
98
-                $sub = substr($item,-4);
98
+                $sub = substr($item, -4);
99 99
         	if ($sub == '.php' or $sub == '.tpl') {
100 100
                     $files[] = $base_path.$item;
101 101
         	}
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -68,18 +68,18 @@  discard block
 block discarded – undo
68 68
 // defined terms, and this should prove the concept that there are much
69 69
 // more variables than what we really use
70 70
 if (count($usedTerms)<1) {
71
-  die("No used terms<br />\n");
71
+    die("No used terms<br />\n");
72 72
 } else {
73
-  echo "The following terms were defined but never used: <br />\n<table>";
73
+    echo "The following terms were defined but never used: <br />\n<table>";
74 74
 }
75 75
 $i = 1;
76 76
 foreach ($defined_terms as $term => $file) {
77
-  // remove "lang" prefix just in case
78
-  if (substr($term,0,4)=='lang') { $term = substr($term,4); }
79
-  if (!isset($usedTerms[$term])) {
77
+    // remove "lang" prefix just in case
78
+    if (substr($term,0,4)=='lang') { $term = substr($term,4); }
79
+    if (!isset($usedTerms[$term])) {
80 80
     echo "<tr><td>$i</td><td>$term</td></tr>\n";
81 81
     $i++;
82
-  }
82
+    }
83 83
 }
84 84
 echo "</table>\n";
85 85
 
@@ -88,17 +88,17 @@  discard block
 block discarded – undo
88 88
     $list = scandir($base_path);
89 89
     $files = array();
90 90
     foreach ($list as $item) {
91
-    	if (substr($item,0,1)=='.') {continue;}
91
+        if (substr($item,0,1)=='.') {continue;}
92 92
         $special_dirs = array(api_get_path(SYS_TEST_PATH),api_get_path(SYS_COURSE_PATH),api_get_path(SYS_LANG_PATH),api_get_path(SYS_ARCHIVE_PATH));
93 93
         if (in_array($base_path.$item.'/',$special_dirs)) {continue;}
94 94
         if (is_dir($base_path.$item)) {
95
-        	$files = array_merge($files,get_all_php_files($base_path.$item.'/'));
95
+            $files = array_merge($files,get_all_php_files($base_path.$item.'/'));
96 96
         } else {
97 97
             //only analyse php files
98 98
                 $sub = substr($item,-4);
99
-        	if ($sub == '.php' or $sub == '.tpl') {
99
+            if ($sub == '.php' or $sub == '.tpl') {
100 100
                     $files[] = $base_path.$item;
101
-        	}
101
+            }
102 102
         }
103 103
     }
104 104
     $list = null;
Please login to merge, or discard this patch.
main/cron/fix_online_time.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package chamilo.cron
7 7
  * @author Imanol Losada <[email protected]>
8 8
  */
9
-require_once __DIR__ . '/../inc/global.inc.php';
9
+require_once __DIR__.'/../inc/global.inc.php';
10 10
 
11 11
 /**
12 12
  * Get ids of COURSEMANAGERs that are inside a course right now
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 function getTeachersInCourseIds()
16 16
 {
17 17
     $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
18
-    $joinStatement = ' JOIN ' . Database::get_main_table(TABLE_MAIN_USER) . ' ON login_user_id = user_id';
18
+    $joinStatement = ' JOIN '.Database::get_main_table(TABLE_MAIN_USER).' ON login_user_id = user_id';
19 19
     return Database::select(
20
-        'login_user_id', $table . $joinStatement,
20
+        'login_user_id', $table.$joinStatement,
21 21
         array(
22 22
             'where' => array(
23 23
                 'c_id IS NOT NULL AND status = ?' => array(
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     $dataBaseCurrentHour = array_shift($utcResult);
45 45
     $maximumIdleTimeInCourse = date(
46 46
         'Y-m-d H:i:s',
47
-        strtotime($dataBaseCurrentHour . ' ' . $timeLimit)
47
+        strtotime($dataBaseCurrentHour.' '.$timeLimit)
48 48
     );
49 49
     $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
50 50
     $onLineTrackTable = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             array(
70 70
                 'logout_course_date' => date(
71 71
                     'Y-m-d H:i:s',
72
-                    strtotime($currentTeacherData['logout_course_date'] . ' ' . $extraTime)
72
+                    strtotime($currentTeacherData['logout_course_date'].' '.$extraTime)
73 73
                 )
74 74
             ),
75 75
             array(
Please login to merge, or discard this patch.
main/cron/fix_fill_blank.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 $execute = isset($_GET['execute']) ? $_GET['execute'] : null;
11 11
 $courseId = isset($_GET['c_id']) ? $_GET['c_id'] : null;
12
-$questionId  = isset($_GET['question_id']) ? $_GET['question_id'] : null;
12
+$questionId = isset($_GET['question_id']) ? $_GET['question_id'] : null;
13 13
 
14 14
 $sql2 = "SELECT * FROM $table WHERE answer LIKE '%[%]%'";
15 15
 
Please login to merge, or discard this patch.
main/dashboard/index.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@
 block discarded – undo
20 20
 
21 21
 // current section
22 22
 $this_section = SECTION_DASHBOARD;
23
-unset($_SESSION['this_section']);//for hmtl editor repository
23
+unset($_SESSION['this_section']); //for hmtl editor repository
24 24
 
25 25
 // get actions
26 26
 $actions = array('listing', 'store_user_block', 'disable_block');
27 27
 $action = 'listing';
28
-if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
28
+if (isset($_GET['action']) && in_array($_GET['action'], $actions)) {
29 29
 	$action = $_GET['action'];
30 30
 }
31 31
 
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 $actions = array('listing', 'store_user_block', 'disable_block');
27 27
 $action = 'listing';
28 28
 if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
29
-	$action = $_GET['action'];
29
+    $action = $_GET['action'];
30 30
 }
31 31
 
32 32
 // load styles from dashboard plugins
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 $dashboard_controller = new DashboardController();
38 38
 
39 39
 if (isset($_GET['path'])) {
40
-	$path = $_GET['path'];
40
+    $path = $_GET['path'];
41 41
 }
42 42
 
43 43
 // distpacher actions to controller
Please login to merge, or discard this patch.
main/dashboard/dashboard.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,23 +14,23 @@  discard block
 block discarded – undo
14 14
 $views = array('blocks', 'list');
15 15
 
16 16
 if(isset($_GET['view']) && in_array($_GET['view'], $views)){
17
-	$dashboard_view = $_GET['view'];
17
+    $dashboard_view = $_GET['view'];
18 18
 }
19 19
 
20 20
 $link_blocks_view = $link_list_view = null;
21 21
 
22 22
 if (isset($dashboard_view) && $dashboard_view == 'list') {
23
-	$link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'.
24
-		Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
23
+    $link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'.
24
+        Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
25 25
 } else {
26
-	$link_list_view = '<a href="'.api_get_self().'?view=list">'.
27
-		Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
26
+    $link_list_view = '<a href="'.api_get_self().'?view=list">'.
27
+        Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
28 28
 }
29 29
 
30 30
 $configuration_link = null;
31 31
 if (api_is_platform_admin()) {
32
-	$configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">'
33
-	.Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>';
32
+    $configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">'
33
+    .Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>';
34 34
 }
35 35
 
36 36
 echo '<div class="actions">';
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
     }
88 88
 
89 89
 } else {
90
-	// block dashboard list
91
-	if (isset($success)) {
92
-		Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully'));
93
-	}
94
-	$user_id = api_get_user_id();
95
-	DashboardManager::display_user_dashboard_list($user_id);
90
+    // block dashboard list
91
+    if (isset($success)) {
92
+        Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully'));
93
+    }
94
+    $user_id = api_get_user_id();
95
+    DashboardManager::display_user_dashboard_list($user_id);
96 96
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 // menu actions for dashboard views
14 14
 $views = array('blocks', 'list');
15 15
 
16
-if(isset($_GET['view']) && in_array($_GET['view'], $views)){
16
+if (isset($_GET['view']) && in_array($_GET['view'], $views)) {
17 17
 	$dashboard_view = $_GET['view'];
18 18
 }
19 19
 
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 
22 22
 if (isset($dashboard_view) && $dashboard_view == 'list') {
23 23
 	$link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'.
24
-		Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
24
+		Display::return_icon('blocks.png', get_lang('DashboardBlocks'), '', ICON_SIZE_MEDIUM).'</a>';
25 25
 } else {
26 26
 	$link_list_view = '<a href="'.api_get_self().'?view=list">'.
27
-		Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
27
+		Display::return_icon('edit.png', get_lang('EditBlocks'), '', ICON_SIZE_MEDIUM).'</a>';
28 28
 }
29 29
 
30 30
 $configuration_link = null;
31 31
 if (api_is_platform_admin()) {
32 32
 	$configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">'
33
-	.Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>';
33
+	.Display::return_icon('settings.png', get_lang('ConfigureDashboardPlugin'), '', ICON_SIZE_MEDIUM).'</a>';
34 34
 }
35 35
 
36 36
 echo '<div class="actions">';
Please login to merge, or discard this patch.
main/timeline/index.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 $column_model   = array(
49 49
                         array('name'=>'name',           'index'=>'name',        'width'=>'120',   'align'=>'left'),
50 50
                         array('name'=>'actions',        'index'=>'actions',     'width'=>'100',  'align'=>'left', 'sortable'=>'false')
51
-                       );
51
+                        );
52 52
 //Autowidth
53 53
 $extra_params['autowidth'] = 'true';
54 54
 //height auto
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -23,19 +23,19 @@  discard block
 block discarded – undo
23 23
 
24 24
 switch ($action) {
25 25
     case 'add':
26
-        $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
27
-        $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add'));
26
+        $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
27
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
28 28
         break;
29 29
     case 'edit':
30
-        $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
31
-        $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit'));
30
+        $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
31
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
32 32
         break;
33 33
     case 'add_item':
34
-        $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
35
-        $interbreadcrumb[]=array('url' => '#','name' => get_lang('TimelineItem'));
34
+        $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Timeline'));
35
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('TimelineItem'));
36 36
         break;
37 37
     default:
38
-        $interbreadcrumb[]=array('url' => '#','name' => get_lang('Timeline'));
38
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Timeline'));
39 39
 }
40 40
 
41 41
 //jqgrid will use this URL to do the selects
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 
47 47
 //Column config
48 48
 $column_model   = array(
49
-                        array('name'=>'name',           'index'=>'name',        'width'=>'120',   'align'=>'left'),
50
-                        array('name'=>'actions',        'index'=>'actions',     'width'=>'100',  'align'=>'left', 'sortable'=>'false')
49
+                        array('name'=>'name', 'index'=>'name', 'width'=>'120', 'align'=>'left'),
50
+                        array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left', 'sortable'=>'false')
51 51
                        );
52 52
 //Autowidth
53 53
 $extra_params['autowidth'] = 'true';
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 $extra_params['height'] = 'auto';
56 56
 
57 57
 //With this function we can add actions to the jgrid (edit, delete, etc)
58
-$htmlHeadXtra[] ='
58
+$htmlHeadXtra[] = '
59 59
 <script>
60 60
 $(function() {
61 61
     // grid definition see the $timeline->display() function
62
-    '.Display::grid_js('timelines',  $url,$columns,$column_model,$extra_params, array(), null,true).'
62
+    '.Display::grid_js('timelines', $url, $columns, $column_model, $extra_params, array(), null, true).'
63 63
 });
64 64
 </script>';
65 65
 
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
                 $values = $form->exportValues();
81 81
                 $res    = $timeline->save($values);
82 82
                 if ($res) {
83
-                    $message = Display::return_message(get_lang('ItemAdded'),'success');
83
+                    $message = Display::return_message(get_lang('ItemAdded'), 'success');
84 84
                 }
85 85
             }
86 86
             $content = $timeline->listing();
87 87
         } else {
88
-            $actions .= '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
88
+            $actions .= '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
89 89
             $form->addElement('hidden', 'sec_token');
90 90
             $form->setConstants(array('sec_token' => $token));
91 91
             $content = $form->return_form();
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             }
107 107
             $timeline->display();
108 108
         } else {
109
-            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
109
+            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
110 110
             $form->addElement('hidden', 'sec_token');
111 111
             $form->setConstants(array('sec_token' => $token));
112 112
             $content = $form->return_form();
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             }
129 129
             $timeline->display();
130 130
         } else {
131
-            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
131
+            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
132 132
             $form->addElement('hidden', 'sec_token');
133 133
             $form->setConstants(array('sec_token' => $token));
134 134
             $content = $form->return_form();
Please login to merge, or discard this patch.
main/blog/download.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@
 block discarded – undo
33 33
 $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url;
34 34
 
35 35
 if (! isset($_course)) {
36
-	api_not_allowed(true);
36
+    api_not_allowed(true);
37 37
 }
38 38
 $full_file_name = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/blog/'.$doc_url;
39 39
 
40 40
 //if the rewrite rule asks for a directory, we redirect to the course view
41 41
 if (is_dir($full_file_name)) {
42
-	//remove last slash if present
43
-	while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
44
-	//create the path
45
-	$document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
46
-	//redirect
47
-	header('Location: '.$document_explorer);
42
+    //remove last slash if present
43
+    while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
44
+    //create the path
45
+    $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
46
+    //redirect
47
+    header('Location: '.$document_explorer);
48 48
     exit;
49 49
 }
50 50
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@
 block discarded – undo
40 40
 //if the rewrite rule asks for a directory, we redirect to the course view
41 41
 if (is_dir($full_file_name)) {
42 42
 	//remove last slash if present
43
-	while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
43
+	while ($doc_url{$dul = strlen($doc_url)-1}=='/') {
44
+	    $doc_url = substr($doc_url,0,$dul);
45
+	}
44 46
 	//create the path
45 47
 	$document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
46 48
 	//redirect
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 session_cache_limiter('public');
13 13
 
14 14
 require_once __DIR__.'/../inc/global.inc.php';
15
-$this_section=SECTION_COURSES;
15
+$this_section = SECTION_COURSES;
16 16
 
17 17
 // IMPORTANT to avoid caching of documents
18 18
 header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 $doc_url = str_replace(' ', '+', $doc_url);
30 30
 $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url;
31 31
 
32
-if (! isset($_course)) {
32
+if (!isset($_course)) {
33 33
 	api_not_allowed(true);
34 34
 }
35 35
 $full_file_name = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/blog/'.$doc_url;
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 //if the rewrite rule asks for a directory, we redirect to the course view
38 38
 if (is_dir($full_file_name)) {
39 39
 	//remove last slash if present
40
-	while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
40
+	while ($doc_url{$dul = strlen($doc_url) - 1} == '/') $doc_url = substr($doc_url, 0, $dul);
41 41
 	//create the path
42 42
 	$document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
43 43
 	//redirect
Please login to merge, or discard this patch.
main/gradebook/gradebook_display_certificate.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -162,17 +162,17 @@
 block discarded – undo
162 162
 
163 163
     if ($form->validate()) {
164 164
         $officialCode = $form->getSubmitValue('filter');
165
-         if ($officialCode == 'all') {
165
+            if ($officialCode == 'all') {
166 166
             $certificate_list = GradebookUtils::get_list_users_certificates($cat_id);
167 167
         } else {
168
-             $userList = UserManager::getUsersByOfficialCode($officialCode);
169
-             if (!empty($userList)) {
170
-                 $certificate_list = GradebookUtils::get_list_users_certificates(
171
-                     $cat_id,
172
-                     $userList
173
-                 );
174
-             }
175
-         }
168
+                $userList = UserManager::getUsersByOfficialCode($officialCode);
169
+                if (!empty($userList)) {
170
+                    $certificate_list = GradebookUtils::get_list_users_certificates(
171
+                        $cat_id,
172
+                        $userList
173
+                    );
174
+                }
175
+            }
176 176
     } else {
177 177
         $certificate_list = GradebookUtils::get_list_users_certificates($cat_id);
178 178
     }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package chamilo.gradebook
7 7
  */
8 8
 require_once __DIR__.'/../inc/global.inc.php';
9
-$current_course_tool  = TOOL_GRADEBOOK;
9
+$current_course_tool = TOOL_GRADEBOOK;
10 10
 
11 11
 if (!api_is_student_boss()) {
12 12
     api_protect_course_script(true);
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
 ini_set('max_execution_time', 0);
17 17
 
18 18
 //extra javascript functions for in html head:
19
-$htmlHeadXtra[] ="<script>
19
+$htmlHeadXtra[] = "<script>
20 20
 function confirmation() {
21
-	if (confirm(\" " . trim(get_lang('AreYouSureToDelete')) . " ?\")) {
21
+	if (confirm(\" " . trim(get_lang('AreYouSureToDelete'))." ?\")) {
22 22
 	    return true;
23 23
 	} else {
24 24
 	    return false;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     api_not_allowed(true);
32 32
 }
33 33
 
34
-$cat_id = isset($_GET['cat_id']) ? (int)$_GET['cat_id'] : null;
34
+$cat_id = isset($_GET['cat_id']) ? (int) $_GET['cat_id'] : null;
35 35
 $action = isset($_GET['action']) && $_GET['action'] ? $_GET['action'] : null;
36 36
 $filterOfficialCode = isset($_POST['filter']) ? Security::remove_XSS($_POST['filter']) : null;
37 37
 $filterOfficialCodeGet = isset($_GET['filter']) ? Security::remove_XSS($_GET['filter']) : null;
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
 $course_code = api_get_course_id();
74 74
 
75
-$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?',	'name' => get_lang('Gradebook'));
76
-$interbreadcrumb[] = array('url' => '#','name' => get_lang('GradebookListOfStudentsCertificates'));
75
+$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook'));
76
+$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsCertificates'));
77 77
 
78 78
 $this_section = SECTION_COURSES;
79 79
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $certificate = new Certificate($_GET['certificate_id']);
86 86
         $result = $certificate->delete(true);
87 87
         Security::clear_token();
88
-        if ($result ==true) {
88
+        if ($result == true) {
89 89
             Display::display_confirmation_message(get_lang('CertificateRemoved'));
90 90
         } else {
91 91
             Display::display_error_message(get_lang('CertificateNotRemoved'));
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
 
105 105
     //with this fix the teacher only can view 1 gradebook
106 106
     if (api_is_platform_admin()) {
107
-        $stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id());
107
+        $stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id());
108 108
     } else {
109
-        $stud_id= api_get_user_id();
109
+        $stud_id = api_get_user_id();
110 110
     }
111 111
 
112 112
     $total_weight = $cats[0]->get_weight();
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     $alleval = $cats[0]->get_evaluations($stud_id);
116 116
     $alllink = $cats[0]->get_links($stud_id);
117 117
 
118
-    $datagen = new GradebookDataGenerator ($allcat,$alleval, $alllink);
118
+    $datagen = new GradebookDataGenerator($allcat, $alleval, $alllink);
119 119
 
120 120
     $total_resource_weight = 0;
121 121
     if (!empty($datagen)) {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                 $newarray[] = array_slice($data, 1);
133 133
             }
134 134
 
135
-            foreach($newarray as $item) {
135
+            foreach ($newarray as $item) {
136 136
                 $total_resource_weight = $total_resource_weight + $item['2'];
137 137
             }
138 138
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 if ($filter === 'true') {
151 151
     echo '<br />';
152 152
     $options = UserManager::getOfficialCodeGrouped();
153
-    $options =array_merge(array('all' => get_lang('All')), $options);
153
+    $options = array_merge(array('all' => get_lang('All')), $options);
154 154
     $form = new FormValidator(
155 155
         'official_code_filter',
156 156
         'POST',
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
 echo $filterForm;
198 198
 
199
-if (count($certificate_list) == 0 ) {
199
+if (count($certificate_list) == 0) {
200 200
     echo Display::display_warning_message(get_lang('NoResultsAvailable'));
201 201
 } else {
202 202
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             $certificates = Display::url(get_lang('Certificate'), $url, array('target'=>'_blank', 'class' => 'btn btn-default'));
220 220
             echo $certificates;
221 221
             echo '<a onclick="return confirmation();" href="gradebook_display_certificate.php?sec_token='.$token.'&'.api_get_cidreq().'&action=delete&cat_id='.$cat_id.'&certificate_id='.$value_certificate['id'].'">
222
-                    '.Display::return_icon('delete.png',get_lang('Delete')).'
222
+                    '.Display::return_icon('delete.png', get_lang('Delete')).'
223 223
                   </a>';
224 224
             echo '</td></tr>';
225 225
         }
Please login to merge, or discard this patch.