Completed
Push — 1.11.x ( 69878b...1da93a )
by José
64:32 queued 39:16
created
main/admin/ldap_form_add_users_group.php 3 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -29,35 +29,35 @@
 block discarded – undo
29 29
 echo '<input type="hidden" name="confirmed" value="yes">';
30 30
 echo '<table border="0" cellspacing="0" width="100%">';
31 31
 echo '<tr align="center" id="header3">' .
32
-		'<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>' .
33
-		'<td width="40%"><b>'.get_lang('Email').'</b></td>' .
34
-		($is_western_name_order
35
-			? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>' .
36
-			'<td width="15%"><b>'.get_lang('Name').'</b></td>'
37
-			: '<td width="15%"><b>'.get_lang('Name').'</b></td>' .
38
-			'<td width="15%"><b>'.get_lang('FirstName').'</b></td>') .
39
-		'<td width="15%"><b>'.get_lang('Login').'</b></td>' .
40
-	  '</tr>'."\n";
32
+        '<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>' .
33
+        '<td width="40%"><b>'.get_lang('Email').'</b></td>' .
34
+        ($is_western_name_order
35
+            ? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>' .
36
+            '<td width="15%"><b>'.get_lang('Name').'</b></td>'
37
+            : '<td width="15%"><b>'.get_lang('Name').'</b></td>' .
38
+            '<td width="15%"><b>'.get_lang('FirstName').'</b></td>') .
39
+        '<td width="15%"><b>'.get_lang('Login').'</b></td>' .
40
+        '</tr>'."\n";
41 41
 while (list ($key, $val) = each($nom_form)) {
42
-	$nbre=$nbre+1;
43
-	if($nbre & 1) $ndiv=2; else $ndiv=3;
44
-	echo '<tr align="center" id="header'.$ndiv.'">';
45
-	echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>';
46
-	echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>';
47
-	if ($is_western_name_order)	{
48
-		echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
49
-		echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
50
-	} else {
51
-		echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
52
-		echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
53
-	}
54
-	echo '<td>'.$username_form[$key].'<input type="hidden" name="username_form['.$key.']" size="10" value="'.$username_form[$key].'">';
55
-	echo '<input type="hidden" name="tutor_form['.$key.']" value="0">';
56
-	echo '<input type="hidden" name="admin_form['.$key.']" value="1">';
57
-	echo '<input type="hidden" name="password_form['.$key.']"  value="'.$password_form[$key].'">';
58
-	echo '<input type="hidden" name="statut['.$key.']"  value="'.$statut.'">';
59
-	echo '</td>';
60
-	echo '</tr>';
42
+    $nbre=$nbre+1;
43
+    if($nbre & 1) $ndiv=2; else $ndiv=3;
44
+    echo '<tr align="center" id="header'.$ndiv.'">';
45
+    echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>';
46
+    echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>';
47
+    if ($is_western_name_order)	{
48
+        echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
49
+        echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
50
+    } else {
51
+        echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
52
+        echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
53
+    }
54
+    echo '<td>'.$username_form[$key].'<input type="hidden" name="username_form['.$key.']" size="10" value="'.$username_form[$key].'">';
55
+    echo '<input type="hidden" name="tutor_form['.$key.']" value="0">';
56
+    echo '<input type="hidden" name="admin_form['.$key.']" value="1">';
57
+    echo '<input type="hidden" name="password_form['.$key.']"  value="'.$password_form[$key].'">';
58
+    echo '<input type="hidden" name="statut['.$key.']"  value="'.$statut.'">';
59
+    echo '</td>';
60
+    echo '</tr>';
61 61
 }
62 62
 echo '</table>';
63 63
 echo '<br />';
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 /**
10 10
  * This form is included by ldap_import_students.php and ldap_import_students_to_session.php
11 11
  */
12
-$nbre=0;
12
+$nbre = 0;
13 13
 echo '<form name="form" method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'">';
14 14
 if ($statut == 1) {
15 15
     echo get_lang(
@@ -28,23 +28,23 @@  discard block
 block discarded – undo
28 28
 $is_western_name_order = api_is_western_name_order();
29 29
 echo '<input type="hidden" name="confirmed" value="yes">';
30 30
 echo '<table border="0" cellspacing="0" width="100%">';
31
-echo '<tr align="center" id="header3">' .
32
-		'<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>' .
33
-		'<td width="40%"><b>'.get_lang('Email').'</b></td>' .
31
+echo '<tr align="center" id="header3">'.
32
+		'<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>'.
33
+		'<td width="40%"><b>'.get_lang('Email').'</b></td>'.
34 34
 		($is_western_name_order
35
-			? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>' .
35
+			? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>'.
36 36
 			'<td width="15%"><b>'.get_lang('Name').'</b></td>'
37
-			: '<td width="15%"><b>'.get_lang('Name').'</b></td>' .
38
-			'<td width="15%"><b>'.get_lang('FirstName').'</b></td>') .
39
-		'<td width="15%"><b>'.get_lang('Login').'</b></td>' .
37
+			: '<td width="15%"><b>'.get_lang('Name').'</b></td>'.
38
+			'<td width="15%"><b>'.get_lang('FirstName').'</b></td>').
39
+		'<td width="15%"><b>'.get_lang('Login').'</b></td>'.
40 40
 	  '</tr>'."\n";
41 41
 while (list ($key, $val) = each($nom_form)) {
42
-	$nbre=$nbre+1;
43
-	if($nbre & 1) $ndiv=2; else $ndiv=3;
42
+	$nbre = $nbre + 1;
43
+	if ($nbre & 1) $ndiv = 2; else $ndiv = 3;
44 44
 	echo '<tr align="center" id="header'.$ndiv.'">';
45 45
 	echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>';
46 46
 	echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>';
47
-	if ($is_western_name_order)	{
47
+	if ($is_western_name_order) {
48 48
 		echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
49 49
 		echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
50 50
 	} else {
Please login to merge, or discard this patch.
Braces   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,11 @@
 block discarded – undo
40 40
 	  '</tr>'."\n";
41 41
 while (list ($key, $val) = each($nom_form)) {
42 42
 	$nbre=$nbre+1;
43
-	if($nbre & 1) $ndiv=2; else $ndiv=3;
43
+	if($nbre & 1) {
44
+	    $ndiv=2;
45
+	} else {
46
+	    $ndiv=3;
47
+	}
44 48
 	echo '<tr align="center" id="header'.$ndiv.'">';
45 49
 	echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>';
46 50
 	echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>';
Please login to merge, or discard this patch.
main/admin/event_controller.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 $htmlHeadXtra[] = api_get_jqgrid_js();
63 63
 $htmlHeadXtra[] = '<script>
64 64
 $(function() {
65
-    '.Display::grid_js('event_email_template',  $url,$columns,$column_model,$extra_params, array(), $action_links,true).'
65
+    '.Display::grid_js('event_email_template', $url, $columns, $column_model, $extra_params, array(), $action_links, true).'
66 66
 });
67 67
 </script>';
68 68
 
Please login to merge, or discard this patch.
main/admin/filler.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@
 block discarded – undo
53 53
     $result .= '<table>';
54 54
     foreach ($output as $line) {
55 55
         $result .= '<tr>';
56
-	    $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>';
57
-	    $result .= '</tr>';
56
+        $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>';
57
+        $result .= '</tr>';
58 58
     }
59 59
     $result .= '</table>';
60 60
     $result .= '</div>';
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 $nameTools = get_lang('PlatformAdmin');
23 23
 
24 24
 // setting breadcrumbs
25
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => $nameTools);
25
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => $nameTools);
26 26
 
27 27
 // setting the name of the tool
28 28
 $nameTools = get_lang('DataFiller');
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 Display::display_header($nameTools);
48 48
 
49 49
 $result = '';
50
-if (count($output)>0) {
50
+if (count($output) > 0) {
51 51
     $result = '<div class="filler-report">'."\n";
52 52
     $result .= '<h3>'.$output[0]['title'].'</h3>'."\n";
53 53
     $result .= '<table>';
@@ -58,16 +58,16 @@  discard block
 block discarded – undo
58 58
     }
59 59
     $result .= '</table>';
60 60
     $result .= '</div>';
61
-    Display::display_normal_message($result,false);
61
+    Display::display_normal_message($result, false);
62 62
 }
63 63
 ?>
64 64
 <div id="datafiller" class="panel panel-default">
65 65
     <div class="panel-body">
66 66
     <h4><?php echo Display::return_icon('bug.png', get_lang('DataFiller'), null, ICON_SIZE_MEDIUM).' '.get_lang('DataFiller')?></h4>
67
-    <div class="description"><?php echo get_lang('ThisSectionIsOnlyVisibleOnSourceInstalls');?></div>
67
+    <div class="description"><?php echo get_lang('ThisSectionIsOnlyVisibleOnSourceInstalls'); ?></div>
68 68
     <ul class="fillers">
69
-      <li><a href="filler.php?fill=users"><?php echo Display::return_icon('user.png', get_lang('FillUsers'), null, ICON_SIZE_SMALL).' '.get_lang('FillUsers');?></a></li>
70
-      <li><a href="filler.php?fill=courses"><?php echo Display::return_icon('new-course.png', get_lang('FillCourses'), null, ICON_SIZE_SMALL).' '.get_lang('FillCourses');?></a></li>
69
+      <li><a href="filler.php?fill=users"><?php echo Display::return_icon('user.png', get_lang('FillUsers'), null, ICON_SIZE_SMALL).' '.get_lang('FillUsers'); ?></a></li>
70
+      <li><a href="filler.php?fill=courses"><?php echo Display::return_icon('new-course.png', get_lang('FillCourses'), null, ICON_SIZE_SMALL).' '.get_lang('FillCourses'); ?></a></li>
71 71
     </ul>
72 72
     </div>
73 73
 </div>
Please login to merge, or discard this patch.
main/admin/skills_profile.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 $skill_profile   = new SkillProfile();
27 27
 $skill_rel_user  = new SkillRelUser();
28 28
 
29
-$url  = api_get_path(WEB_AJAX_PATH).'skill.ajax.php';
29
+$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php';
30 30
 
31 31
 $tpl = new Template(get_lang('Skills'));
32 32
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 $user_list = array();
64 64
 $count_skills = count($skills);
65 65
 
66
-$users  = $skill_rel_user->get_user_by_skills($skills);
66
+$users = $skill_rel_user->get_user_by_skills($skills);
67 67
 
68 68
 if (!empty($users)) {
69 69
     foreach ($users as $user) {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $user_list[$user['user_id']]['user'] = $user_info;
72 72
         $my_user_skills = $skill_rel_user->get_user_skills($user['user_id']);
73 73
         $user_skills = array();
74
-        $found_counts = 0 ;
74
+        $found_counts = 0;
75 75
         foreach ($my_user_skills as $my_skill) {
76 76
             $found = false;
77 77
             if (in_array($my_skill['skill_id'], $skills)) {
Please login to merge, or discard this patch.
main/admin/system_announcements.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 // Setting the section (for the tabs).
16 16
 $this_section = SECTION_PLATFORM_ADMIN;
17
-$_SESSION['this_section']=$this_section;
17
+$_SESSION['this_section'] = $this_section;
18 18
 
19 19
 $action = isset($_GET['action']) ? $_GET['action'] : null;
20 20
 $action_todo = false;
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 }
36 36
 
37 37
 if (!empty($action)) {
38
-    $interbreadcrumb[] = array ("url" => "system_announcements.php", "name" => get_lang('SystemAnnouncements'));
38
+    $interbreadcrumb[] = array("url" => "system_announcements.php", "name" => get_lang('SystemAnnouncements'));
39 39
     if ($action == 'add') {
40
-        $interbreadcrumb[] = array ("url" => '#', "name" => get_lang('AddAnnouncement'));
40
+        $interbreadcrumb[] = array("url" => '#', "name" => get_lang('AddAnnouncement'));
41 41
     }
42 42
     if ($action == 'edit') {
43
-        $interbreadcrumb[] = array ("url" => '#', "name" => get_lang('Edit'));
43
+        $interbreadcrumb[] = array("url" => '#', "name" => get_lang('Edit'));
44 44
     }
45 45
 } else {
46 46
     $tool_name = get_lang('SystemAnnouncements');
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 }
67 67
 
68 68
 // Actions
69
-switch($action) {
69
+switch ($action) {
70 70
     case 'make_visible':
71 71
     case 'make_invisible':
72 72
         $status = false;
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
 
163 163
     $group = array();
164 164
 
165
-    $group[]= $form->createElement('checkbox', 'visible_teacher', null, get_lang('Teacher'));
166
-    $group[]= $form->createElement('checkbox', 'visible_student', null, get_lang('Student'));
167
-    $group[]= $form->createElement('checkbox', 'visible_guest', null, get_lang('Guest'));
165
+    $group[] = $form->createElement('checkbox', 'visible_teacher', null, get_lang('Teacher'));
166
+    $group[] = $form->createElement('checkbox', 'visible_student', null, get_lang('Student'));
167
+    $group[] = $form->createElement('checkbox', 'visible_guest', null, get_lang('Guest'));
168 168
 
169 169
     $form->addGroup($group, null, get_lang('Visible'));
170 170
 
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
 
188 188
     $form->addElement('checkbox', 'send_mail', null, get_lang('SendMail'));
189 189
 
190
-    if (isset($_REQUEST['action']) && $_REQUEST['action']=='add') {
190
+    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') {
191 191
         $form->addElement('checkbox', 'add_to_calendar', null, get_lang('AddToCalendar'));
192
-        $text=get_lang('AddNews');
193
-        $class='add';
192
+        $text = get_lang('AddNews');
193
+        $class = 'add';
194 194
         $form->addElement('hidden', 'action', 'add');
195 195
 
196 196
     } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') {
197
-        $text=get_lang('EditNews');
198
-        $class='save';
197
+        $text = get_lang('EditNews');
198
+        $class = 'save';
199 199
         $form->addElement('hidden', 'action', 'edit');
200 200
     }
201 201
     $form->addElement('checkbox', 'send_email_test', null, get_lang('SendOnlyAnEmailToMySelfToTest'));
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 
294 294
 if ($show_announcement_list) {
295 295
     $announcements = SystemAnnouncementManager :: get_all_announcements();
296
-    $announcement_data = array ();
296
+    $announcement_data = array();
297 297
     foreach ($announcements as $index => $announcement) {
298 298
         $row = array();
299 299
         $row[] = $announcement->id;
@@ -301,9 +301,9 @@  discard block
 block discarded – undo
301 301
         $row[] = $announcement->title;
302 302
         $row[] = api_convert_and_format_date($announcement->date_start);
303 303
         $row[] = api_convert_and_format_date($announcement->date_end);
304
-        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_TEACHER."&action=". ($announcement->visible_teacher ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_teacher  ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
305
-        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_STUDENT."&action=". ($announcement->visible_student  ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student  ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
306
-        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_GUEST."&action=". ($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest  ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
304
+        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_TEACHER."&action=".($announcement->visible_teacher ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_teacher ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
305
+        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_STUDENT."&action=".($announcement->visible_student ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
306
+        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_GUEST."&action=".($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
307 307
 
308 308
         $row[] = $announcement->lang;
309 309
         $row[] = "<a href=\"?action=edit&id=".$announcement->id."\">".Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)."</a> <a href=\"?action=delete&id=".$announcement->id."\"  onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."')) return false;\">".Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL)."</a>";
Please login to merge, or discard this patch.
main/course_description/add.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 $i=1;
21 21
 echo '<div class="actions" style="margin-bottom:30px">';
22 22
 echo '<a href="index.php?'.api_get_cidreq().'">'.
23
-	Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM).
24
-	'</a>';
23
+    Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM).
24
+    '</a>';
25 25
 ksort($categories);
26 26
 foreach ($categories as $id => $title) {
27 27
     if ($i == ADD_BLOCK) {
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
 
39 39
 // error messages
40 40
 if (isset($error) && intval($error) == 1) {
41
-	Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
41
+    Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
42 42
 }
43 43
 
44 44
 // default header title form
45 45
 $header = '';
46 46
 $description_type = intval($description_type);
47 47
 if ($description_type >= ADD_BLOCK) {
48
-	$header = $default_description_titles[ADD_BLOCK];
48
+    $header = $default_description_titles[ADD_BLOCK];
49 49
 }
50 50
 
51 51
 // display form
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 
74 74
 // display default questions
75 75
 if (isset ($question[$description_type])) {
76
-	$message = '<strong>'.get_lang('QuestionPlan').'</strong><br />';
77
-	$message .= $question[$description_type];
78
-	Display::display_normal_message($message, false);
76
+    $message = '<strong>'.get_lang('QuestionPlan').'</strong><br />';
77
+    $message .= $question[$description_type];
78
+    Display::display_normal_message($message, false);
79 79
 }
80 80
 $form->display();
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,26 +11,26 @@
 block discarded – undo
11 11
 api_protect_course_script(true);
12 12
 
13 13
 // display categories
14
-$categories = array ();
14
+$categories = array();
15 15
 foreach ($default_description_titles as $id => $title) {
16 16
     $categories[$id] = $title;
17 17
 }
18 18
 $categories[ADD_BLOCK] = get_lang('NewBloc');
19 19
 
20
-$i=1;
20
+$i = 1;
21 21
 echo '<div class="actions" style="margin-bottom:30px">';
22 22
 echo '<a href="index.php?'.api_get_cidreq().'">'.
23
-	Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM).
23
+	Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ToolCourseDescription'), '', ICON_SIZE_MEDIUM).
24 24
 	'</a>';
25 25
 ksort($categories);
26 26
 foreach ($categories as $id => $title) {
27 27
     if ($i == ADD_BLOCK) {
28 28
         echo '<a href="index.php?'.api_get_cidreq().'&action=add">'.
29
-            Display::return_icon($default_description_icon[$id], $title, '',ICON_SIZE_MEDIUM).'</a>';
29
+            Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
30 30
         break;
31 31
     } else {
32 32
         echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'.
33
-            Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>';
33
+            Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
34 34
         $i++;
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
main/blog/blog.php 3 patches
Indentation   +277 added lines, -277 removed lines patch added patch discarded remove patch
@@ -41,180 +41,180 @@  discard block
 block discarded – undo
41 41
 $safe_task_description  = isset($_POST['task_description']) ? Security::remove_XSS($_POST['task_description']) : null;
42 42
 
43 43
 if (!empty($_POST['new_post_submit'])) {
44
-	Blog:: create_post(
45
-		$_POST['title'],
46
-		$_POST['full_text'],
47
-		$_POST['post_file_comment'],
48
-		$blog_id
49
-	);
50
-	$return_message = array('type' => 'confirmation', 'message' => get_lang('BlogAdded'));
44
+    Blog:: create_post(
45
+        $_POST['title'],
46
+        $_POST['full_text'],
47
+        $_POST['post_file_comment'],
48
+        $blog_id
49
+    );
50
+    $return_message = array('type' => 'confirmation', 'message' => get_lang('BlogAdded'));
51 51
 }
52 52
 if (!empty($_POST['edit_post_submit'])) {
53
-	Blog:: edit_post(
54
-		$_POST['post_id'],
55
-		$_POST['title'],
56
-		$_POST['full_text'],
57
-		$blog_id
58
-	);
59
-	$return_message = array('type' => 'confirmation', 'message' => get_lang('BlogEdited'));
53
+    Blog:: edit_post(
54
+        $_POST['post_id'],
55
+        $_POST['title'],
56
+        $_POST['full_text'],
57
+        $blog_id
58
+    );
59
+    $return_message = array('type' => 'confirmation', 'message' => get_lang('BlogEdited'));
60 60
 }
61 61
 
62 62
 if (!empty($_POST['new_comment_submit'])) {
63
-	Blog:: create_comment(
64
-		$_POST['title'],
65
-		$_POST['comment'],
66
-		$_POST['post_file_comment'],
67
-		$blog_id,
68
-		$_GET['post_id'],
69
-		$_POST['comment_parent_id']
70
-	);
71
-	$return_message = array('type' => 'confirmation', 'message' => get_lang('CommentAdded'));
63
+    Blog:: create_comment(
64
+        $_POST['title'],
65
+        $_POST['comment'],
66
+        $_POST['post_file_comment'],
67
+        $blog_id,
68
+        $_GET['post_id'],
69
+        $_POST['comment_parent_id']
70
+    );
71
+    $return_message = array('type' => 'confirmation', 'message' => get_lang('CommentAdded'));
72 72
 }
73 73
 
74 74
 if (!empty($_POST['new_task_submit'])) {
75
-	Blog:: create_task(
76
-		$blog_id,
77
-		$safe_task_name,
78
-		$safe_task_description,
79
-		(isset($_POST['chkArticleDelete']) ? $_POST['chkArticleDelete'] : null),
80
-		(isset($_POST['chkArticleEdit']) ? $_POST['chkArticleEdit'] : null),
81
-		(isset($_POST['chkCommentsDelete']) ? $_POST['chkCommentsDelete'] : null),
82
-		(isset($_POST['task_color']) ? $_POST['task_color'] : null)
83
-	);
84
-	$return_message = array('type' => 'confirmation', 'message' => get_lang('TaskCreated'));
75
+    Blog:: create_task(
76
+        $blog_id,
77
+        $safe_task_name,
78
+        $safe_task_description,
79
+        (isset($_POST['chkArticleDelete']) ? $_POST['chkArticleDelete'] : null),
80
+        (isset($_POST['chkArticleEdit']) ? $_POST['chkArticleEdit'] : null),
81
+        (isset($_POST['chkCommentsDelete']) ? $_POST['chkCommentsDelete'] : null),
82
+        (isset($_POST['task_color']) ? $_POST['task_color'] : null)
83
+    );
84
+    $return_message = array('type' => 'confirmation', 'message' => get_lang('TaskCreated'));
85 85
 }
86 86
 
87 87
 if (isset($_POST['edit_task_submit'])) {
88
-	Blog:: edit_task(
89
-		$_POST['blog_id'],
90
-		$_POST['task_id'],
91
-		$safe_task_name,
92
-		$safe_task_description,
93
-		$_POST['chkArticleDelete'],
94
-		$_POST['chkArticleEdit'],
95
-		$_POST['chkCommentsDelete'],
96
-		$_POST['task_color']
97
-	);
98
-	$return_message = array(
99
-		'type' => 'confirmation',
100
-		'message' => get_lang('TaskEdited')
101
-	);
88
+    Blog:: edit_task(
89
+        $_POST['blog_id'],
90
+        $_POST['task_id'],
91
+        $safe_task_name,
92
+        $safe_task_description,
93
+        $_POST['chkArticleDelete'],
94
+        $_POST['chkArticleEdit'],
95
+        $_POST['chkCommentsDelete'],
96
+        $_POST['task_color']
97
+    );
98
+    $return_message = array(
99
+        'type' => 'confirmation',
100
+        'message' => get_lang('TaskEdited')
101
+    );
102 102
 }
103 103
 
104 104
 if (!empty($_POST['assign_task_submit'])) {
105
-	Blog:: assign_task(
106
-		$blog_id,
107
-		$_POST['task_user_id'],
108
-		$_POST['task_task_id'],
109
-		$_POST['task_day']
110
-	);
111
-	$return_message = array(
112
-		'type' => 'confirmation',
113
-		'message' => get_lang('TaskAssigned')
114
-	);
105
+    Blog:: assign_task(
106
+        $blog_id,
107
+        $_POST['task_user_id'],
108
+        $_POST['task_task_id'],
109
+        $_POST['task_day']
110
+    );
111
+    $return_message = array(
112
+        'type' => 'confirmation',
113
+        'message' => get_lang('TaskAssigned')
114
+    );
115 115
 }
116 116
 
117 117
 if (isset($_POST['assign_task_edit_submit'])) {
118
-	Blog:: edit_assigned_task(
119
-		$blog_id,
120
-		$_POST['task_user_id'],
121
-		$_POST['task_task_id'],
122
-		$_POST['task_day'],
123
-		$_POST['old_user_id'],
124
-		$_POST['old_task_id'],
125
-		$_POST['old_target_date']
126
-	);
127
-	$return_message = array(
128
-		'type' => 'confirmation',
129
-		'message' => get_lang('AssignedTaskEdited')
130
-	);
118
+    Blog:: edit_assigned_task(
119
+        $blog_id,
120
+        $_POST['task_user_id'],
121
+        $_POST['task_task_id'],
122
+        $_POST['task_day'],
123
+        $_POST['old_user_id'],
124
+        $_POST['old_task_id'],
125
+        $_POST['old_target_date']
126
+    );
127
+    $return_message = array(
128
+        'type' => 'confirmation',
129
+        'message' => get_lang('AssignedTaskEdited')
130
+    );
131 131
 }
132 132
 if (!empty($_POST['new_task_execution_submit'])) {
133
-	Blog:: create_comment(
134
-		$safe_comment_title,
135
-		$safe_comment_text,
136
-		$blog_id,
137
-		(int)$_GET['post_id'],
138
-		$_POST['comment_parent_id'],
139
-		$_POST['task_id']
140
-	);
141
-	$return_message = array(
142
-		'type' => 'confirmation',
143
-		'message' => get_lang('CommentCreated')
144
-	);
133
+    Blog:: create_comment(
134
+        $safe_comment_title,
135
+        $safe_comment_text,
136
+        $blog_id,
137
+        (int)$_GET['post_id'],
138
+        $_POST['comment_parent_id'],
139
+        $_POST['task_id']
140
+    );
141
+    $return_message = array(
142
+        'type' => 'confirmation',
143
+        'message' => get_lang('CommentCreated')
144
+    );
145 145
 }
146 146
 if (!empty($_POST['register'])) {
147
-	if (is_array($_POST['user'])) {
148
-		foreach ($_POST['user'] as $index => $user_id) {
149
-			Blog :: set_user_subscribed((int)$_GET['blog_id'], $user_id);
150
-		}
151
-	}
147
+    if (is_array($_POST['user'])) {
148
+        foreach ($_POST['user'] as $index => $user_id) {
149
+            Blog :: set_user_subscribed((int)$_GET['blog_id'], $user_id);
150
+        }
151
+    }
152 152
 }
153 153
 if (!empty($_POST['unregister'])) {
154
-	if (is_array($_POST['user'])) {
155
-		foreach ($_POST['user'] as $index => $user_id) {
156
-			Blog :: set_user_unsubscribed((int)$_GET['blog_id'], $user_id);
157
-		}
158
-	}
154
+    if (is_array($_POST['user'])) {
155
+        foreach ($_POST['user'] as $index => $user_id) {
156
+            Blog :: set_user_unsubscribed((int)$_GET['blog_id'], $user_id);
157
+        }
158
+    }
159 159
 }
160 160
 if (!empty($_GET['register'])) {
161
-	Blog :: set_user_subscribed((int)$_GET['blog_id'], (int)$_GET['user_id']);
162
-	$return_message = array('type' => 'confirmation', 'message' => get_lang('UserRegistered'));
163
-	$flag = 1;
161
+    Blog :: set_user_subscribed((int)$_GET['blog_id'], (int)$_GET['user_id']);
162
+    $return_message = array('type' => 'confirmation', 'message' => get_lang('UserRegistered'));
163
+    $flag = 1;
164 164
 }
165 165
 if (!empty($_GET['unregister'])) {
166
-	Blog :: set_user_unsubscribed((int)$_GET['blog_id'], (int)$_GET['user_id']);
166
+    Blog :: set_user_unsubscribed((int)$_GET['blog_id'], (int)$_GET['user_id']);
167 167
 }
168 168
 
169 169
 if (isset($_GET['action']) && $_GET['action'] == 'manage_tasks') {
170
-	if (isset($_GET['do']) && $_GET['do'] == 'delete') {
171
-		Blog :: delete_task($blog_id, (int)$_GET['task_id']);
172
-		$return_message = array('type' => 'confirmation', 'message' => get_lang('TaskDeleted'));
173
-	}
174
-
175
-	if (isset($_GET['do']) && $_GET['do'] == 'delete_assignment') {
176
-		Blog :: delete_assigned_task($blog_id, intval($_GET['task_id']), intval($_GET['user_id']));
177
-		$return_message = array('type' => 'confirmation', 'message' => get_lang('TaskAssignmentDeleted'));
178
-	}
170
+    if (isset($_GET['do']) && $_GET['do'] == 'delete') {
171
+        Blog :: delete_task($blog_id, (int)$_GET['task_id']);
172
+        $return_message = array('type' => 'confirmation', 'message' => get_lang('TaskDeleted'));
173
+    }
174
+
175
+    if (isset($_GET['do']) && $_GET['do'] == 'delete_assignment') {
176
+        Blog :: delete_assigned_task($blog_id, intval($_GET['task_id']), intval($_GET['user_id']));
177
+        $return_message = array('type' => 'confirmation', 'message' => get_lang('TaskAssignmentDeleted'));
178
+    }
179 179
 }
180 180
 
181 181
 if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
182
-	$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
183
-
184
-	if (isset($_GET['do']) && $_GET['do'] == 'delete_comment')	{
185
-		if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_delete', $task_id)) {
186
-			Blog :: delete_comment($blog_id, (int)$_GET['post_id'],(int)$_GET['comment_id']);
187
-			$return_message = array('type' => 'confirmation', 'message' => get_lang('CommentDeleted'));
188
-		} else {
189
-			$error = true;
190
-			$message = get_lang('ActionNotAllowed');
191
-		}
192
-	}
193
-
194
-	if (isset($_GET['do']) && $_GET['do'] == 'delete_article')	{
195
-		if (api_is_allowed('BLOG_'.$blog_id, 'article_delete', $task_id)) {
196
-			Blog :: delete_post($blog_id, (int)$_GET['article_id']);
197
-			$action = ''; // Article is gone, go to blog home
198
-			$return_message = array('type' => 'confirmation', 'message' => get_lang('BlogDeleted'));
199
-		} else {
200
-			$error = true;
201
-			$message = get_lang('ActionNotAllowed');
202
-		}
203
-	}
204
-	if (isset($_GET['do']) && $_GET['do'] == 'rate') {
205
-		if (isset($_GET['type']) && $_GET['type'] == 'post') {
206
-			if (api_is_allowed('BLOG_'.$blog_id, 'article_rate')) {
207
-				Blog :: add_rating('post', $blog_id, (int)$_GET['post_id'], (int)$_GET['rating']);
208
-				$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
209
-			}
210
-		}
211
-		if (isset($_GET['type']) && $_GET['type'] == 'comment') {
212
-			if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_add')) {
213
-				Blog :: add_rating('comment', $blog_id, (int)$_GET['comment_id'], (int)$_GET['rating']);
214
-				$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
215
-			}
216
-		}
217
-	}
182
+    $task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
183
+
184
+    if (isset($_GET['do']) && $_GET['do'] == 'delete_comment')	{
185
+        if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_delete', $task_id)) {
186
+            Blog :: delete_comment($blog_id, (int)$_GET['post_id'],(int)$_GET['comment_id']);
187
+            $return_message = array('type' => 'confirmation', 'message' => get_lang('CommentDeleted'));
188
+        } else {
189
+            $error = true;
190
+            $message = get_lang('ActionNotAllowed');
191
+        }
192
+    }
193
+
194
+    if (isset($_GET['do']) && $_GET['do'] == 'delete_article')	{
195
+        if (api_is_allowed('BLOG_'.$blog_id, 'article_delete', $task_id)) {
196
+            Blog :: delete_post($blog_id, (int)$_GET['article_id']);
197
+            $action = ''; // Article is gone, go to blog home
198
+            $return_message = array('type' => 'confirmation', 'message' => get_lang('BlogDeleted'));
199
+        } else {
200
+            $error = true;
201
+            $message = get_lang('ActionNotAllowed');
202
+        }
203
+    }
204
+    if (isset($_GET['do']) && $_GET['do'] == 'rate') {
205
+        if (isset($_GET['type']) && $_GET['type'] == 'post') {
206
+            if (api_is_allowed('BLOG_'.$blog_id, 'article_rate')) {
207
+                Blog :: add_rating('post', $blog_id, (int)$_GET['post_id'], (int)$_GET['rating']);
208
+                $return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
209
+            }
210
+        }
211
+        if (isset($_GET['type']) && $_GET['type'] == 'comment') {
212
+            if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_add')) {
213
+                Blog :: add_rating('comment', $blog_id, (int)$_GET['comment_id'], (int)$_GET['rating']);
214
+                $return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
215
+            }
216
+        }
217
+    }
218 218
 }
219 219
 /*
220 220
 	DISPLAY
@@ -222,67 +222,67 @@  discard block
 block discarded – undo
222 222
 
223 223
 // Set breadcrumb
224 224
 switch ($action) {
225
-	case 'new_post' :
226
-		$nameTools = get_lang('NewPost');
225
+    case 'new_post' :
226
+        $nameTools = get_lang('NewPost');
227 227
         $interbreadcrumb[] = array(
228 228
             'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
229 229
             "name" => Blog:: get_blog_title($blog_id),
230 230
         );
231
-		Display :: display_header($nameTools, 'Blogs');
232
-		break;
233
-	case 'manage_tasks' :
234
-		$nameTools = get_lang('TaskManager');
231
+        Display :: display_header($nameTools, 'Blogs');
232
+        break;
233
+    case 'manage_tasks' :
234
+        $nameTools = get_lang('TaskManager');
235 235
         $interbreadcrumb[] = array(
236 236
             'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
237 237
             "name" => Blog:: get_blog_title($blog_id),
238 238
         );
239
-		Display :: display_header($nameTools, 'Blogs');
240
-		break;
241
-	case 'manage_members' :
242
-		$nameTools = get_lang('MemberManager');
239
+        Display :: display_header($nameTools, 'Blogs');
240
+        break;
241
+    case 'manage_members' :
242
+        $nameTools = get_lang('MemberManager');
243 243
         $interbreadcrumb[] = array(
244 244
             'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
245 245
             "name" => Blog:: get_blog_title($blog_id),
246 246
         );
247
-		Display :: display_header($nameTools, 'Blogs');
248
-		break;
249
-	case 'manage_rights' :
250
-		$nameTools = get_lang('RightsManager');
247
+        Display :: display_header($nameTools, 'Blogs');
248
+        break;
249
+    case 'manage_rights' :
250
+        $nameTools = get_lang('RightsManager');
251 251
         $interbreadcrumb[] = array(
252 252
             'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
253 253
             'name' => Blog:: get_blog_title($blog_id),
254 254
         );
255
-		Display :: display_header($nameTools, 'Blogs');
256
-		break;
257
-	case 'view_search_result' :
258
-		$nameTools = get_lang('SearchResults');
255
+        Display :: display_header($nameTools, 'Blogs');
256
+        break;
257
+    case 'view_search_result' :
258
+        $nameTools = get_lang('SearchResults');
259 259
         $interbreadcrumb[] = array(
260 260
             'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
261 261
             'name' => Blog:: get_blog_title($blog_id),
262 262
         );
263
-		Display :: display_header($nameTools, 'Blogs');
264
-		break;
265
-	case 'execute_task' :
266
-		$nameTools = get_lang('ExecuteThisTask');
263
+        Display :: display_header($nameTools, 'Blogs');
264
+        break;
265
+    case 'execute_task' :
266
+        $nameTools = get_lang('ExecuteThisTask');
267 267
         $interbreadcrumb[] = array(
268 268
             'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
269 269
             'name' => Blog:: get_blog_title($blog_id),
270 270
         );
271
-		Display :: display_header($nameTools, 'Blogs');
272
-		break;
273
-	default :
274
-		$nameTools = Blog :: get_blog_title($blog_id);
275
-		Display :: display_header($nameTools, 'Blogs');
271
+        Display :: display_header($nameTools, 'Blogs');
272
+        break;
273
+    default :
274
+        $nameTools = Blog :: get_blog_title($blog_id);
275
+        Display :: display_header($nameTools, 'Blogs');
276 276
 }
277 277
 
278 278
 // feedback messages
279 279
 if (!empty($return_message)) {
280
-	if ($return_message['type'] == 'confirmation') {
281
-		Display::display_confirmation_message($return_message['message']);
282
-	}
283
-	if ($return_message['type'] == 'error') {
284
-		Display::display_error_message($return_message['message']);
285
-	}
280
+    if ($return_message['type'] == 'confirmation') {
281
+        Display::display_confirmation_message($return_message['message']);
282
+    }
283
+    if ($return_message['type'] == 'error') {
284
+        Display::display_error_message($return_message['message']);
285
+    }
286 286
 }
287 287
 
288 288
 // actions
@@ -349,12 +349,12 @@  discard block
 block discarded – undo
349 349
 		<?php
350 350
 
351 351
 if (isset($error)) {
352
-	Display :: display_error_message($message);
352
+    Display :: display_error_message($message);
353 353
 }
354 354
 
355 355
 if (isset($flag) && $flag == '1') {
356
-	$action = "manage_tasks";
357
-	Blog :: display_assign_task_form($blog_id);
356
+    $action = "manage_tasks";
357
+    Blog :: display_assign_task_form($blog_id);
358 358
 }
359 359
 
360 360
 $user_task = false;
@@ -362,12 +362,12 @@  discard block
 block discarded – undo
362 362
 $course_id = api_get_course_int_id();
363 363
 
364 364
 if (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) {
365
-	$task_id = (int)$_GET['task_id'];
365
+    $task_id = (int)$_GET['task_id'];
366 366
 } else {
367
-	$task_id = 0;
368
-	$tbl_blogs_tasks_rel_user = Database :: get_course_table(TABLE_BLOGS_TASKS_REL_USER);
367
+    $task_id = 0;
368
+    $tbl_blogs_tasks_rel_user = Database :: get_course_table(TABLE_BLOGS_TASKS_REL_USER);
369 369
 
370
-	$sql = "SELECT COUNT(*) as number
370
+    $sql = "SELECT COUNT(*) as number
371 371
 			FROM ".$tbl_blogs_tasks_rel_user."
372 372
 			WHERE
373 373
 			    c_id = $course_id AND
@@ -375,120 +375,120 @@  discard block
 block discarded – undo
375 375
 				user_id = ".api_get_user_id()." AND
376 376
 				task_id = ".$task_id;
377 377
 
378
-	$result = Database::query($sql);
379
-	$row = Database::fetch_array($result);
378
+    $result = Database::query($sql);
379
+    $row = Database::fetch_array($result);
380 380
 
381
-	if ($row['number'] == 1)
382
-		$user_task = true;
381
+    if ($row['number'] == 1)
382
+        $user_task = true;
383 383
 }
384 384
 
385 385
 switch ($action) {
386
-	case 'new_post':
387
-		if (api_is_allowed('BLOG_'.$blog_id, 'article_add', $user_task ? $task_id : 0)) {
388
-			// we show the form if
389
-			// 1. no post data
390
-			// 2. there is post data and the required field is empty
391
-			if (!$_POST OR (!empty($_POST) AND empty($_POST['title']))) {
392
-				// if there is post data there is certainly an error in the form
393
-				if ($_POST) {
394
-					Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'));
395
-				}
396
-			Blog :: display_form_new_post($blog_id);
397
-		} else {
398
-				if (isset($_GET['filter']) && !empty($_GET['filter'])) {
399
-					Blog :: display_day_results($blog_id, Database::escape_string($_GET['filter']));
400
-				} else {
401
-					Blog :: display_blog_posts($blog_id);
402
-				}
403
-			}
404
-		} else {
405
-			api_not_allowed();
406
-		}
407
-		break;
408
-	case 'view_post' :
409
-		Blog :: display_post($blog_id, intval($_GET['post_id']));
410
-		break;
411
-	case 'edit_post' :
412
-		$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
413
-
414
-		if (api_is_allowed('BLOG_'.$blog_id, 'article_edit', $task_id)) {
415
-			// we show the form if
416
-			// 1. no post data
417
-			// 2. there is post data and the required field is empty
418
-			if (!$_POST OR (!empty($_POST) AND empty($_POST['post_title']))) {
419
-				// if there is post data there is certainly an error in the form
420
-				if ($_POST) {
421
-					Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'));
422
-				}
386
+    case 'new_post':
387
+        if (api_is_allowed('BLOG_'.$blog_id, 'article_add', $user_task ? $task_id : 0)) {
388
+            // we show the form if
389
+            // 1. no post data
390
+            // 2. there is post data and the required field is empty
391
+            if (!$_POST OR (!empty($_POST) AND empty($_POST['title']))) {
392
+                // if there is post data there is certainly an error in the form
393
+                if ($_POST) {
394
+                    Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'));
395
+                }
396
+            Blog :: display_form_new_post($blog_id);
397
+        } else {
398
+                if (isset($_GET['filter']) && !empty($_GET['filter'])) {
399
+                    Blog :: display_day_results($blog_id, Database::escape_string($_GET['filter']));
400
+                } else {
401
+                    Blog :: display_blog_posts($blog_id);
402
+                }
403
+            }
404
+        } else {
405
+            api_not_allowed();
406
+        }
407
+        break;
408
+    case 'view_post' :
409
+        Blog :: display_post($blog_id, intval($_GET['post_id']));
410
+        break;
411
+    case 'edit_post' :
412
+        $task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
413
+
414
+        if (api_is_allowed('BLOG_'.$blog_id, 'article_edit', $task_id)) {
415
+            // we show the form if
416
+            // 1. no post data
417
+            // 2. there is post data and the required field is empty
418
+            if (!$_POST OR (!empty($_POST) AND empty($_POST['post_title']))) {
419
+                // if there is post data there is certainly an error in the form
420
+                if ($_POST) {
421
+                    Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'));
422
+                }
423 423
                 Blog :: display_form_edit_post($blog_id, intval($_GET['post_id']));
424
-			} else {
425
-				if (isset ($_GET['filter']) && !empty ($_GET['filter'])) {
426
-					Blog :: display_day_results($blog_id, Database::escape_string($_GET['filter']));
427
-				} else {
428
-					Blog :: display_blog_posts($blog_id);
429
-				}
430
-			}
431
-		} else {
432
-			api_not_allowed();
433
-		}
434
-
435
-		break;
436
-	case 'manage_members' :
437
-		if (api_is_allowed('BLOG_'.$blog_id, 'member_management')) {
438
-			Blog :: display_form_user_subscribe($blog_id);
439
-			echo '<br /><br />';
440
-			Blog :: display_form_user_unsubscribe($blog_id);
441
-		} else {
442
-			api_not_allowed();
424
+            } else {
425
+                if (isset ($_GET['filter']) && !empty ($_GET['filter'])) {
426
+                    Blog :: display_day_results($blog_id, Database::escape_string($_GET['filter']));
427
+                } else {
428
+                    Blog :: display_blog_posts($blog_id);
429
+                }
430
+            }
431
+        } else {
432
+            api_not_allowed();
433
+        }
434
+
435
+        break;
436
+    case 'manage_members' :
437
+        if (api_is_allowed('BLOG_'.$blog_id, 'member_management')) {
438
+            Blog :: display_form_user_subscribe($blog_id);
439
+            echo '<br /><br />';
440
+            Blog :: display_form_user_unsubscribe($blog_id);
441
+        } else {
442
+            api_not_allowed();
443 443
         }
444 444
 
445
-		break;
446
-	case 'manage_rights' :
447
-		Blog :: display_form_user_rights($blog_id);
448
-		break;
449
-	case 'manage_tasks' :
450
-		if (api_is_allowed('BLOG_'.$blog_id, 'task_management')) {
451
-			if (isset($_GET['do']) && $_GET['do'] == 'add') {
452
-				Blog:: display_new_task_form($blog_id);
453
-			}
454
-			if (isset($_GET['do']) && $_GET['do'] == 'assign') {
455
-				Blog:: display_assign_task_form($blog_id);
456
-			}
457
-			if (isset($_GET['do']) && $_GET['do'] == 'edit') {
458
-				Blog:: display_edit_task_form(
459
-					$blog_id,
460
-					intval($_GET['task_id'])
461
-				);
462
-			}
463
-			if (isset($_GET['do']) && $_GET['do'] == 'edit_assignment') {
464
-				Blog :: display_edit_assigned_task_form($blog_id, intval($_GET['task_id']), intval($_GET['user_id']));
465
-			}
466
-			Blog :: display_task_list($blog_id);
467
-			echo '<br /><br />';
468
-			Blog :: display_assigned_task_list($blog_id);
469
-			echo '<br /><br />';
445
+        break;
446
+    case 'manage_rights' :
447
+        Blog :: display_form_user_rights($blog_id);
448
+        break;
449
+    case 'manage_tasks' :
450
+        if (api_is_allowed('BLOG_'.$blog_id, 'task_management')) {
451
+            if (isset($_GET['do']) && $_GET['do'] == 'add') {
452
+                Blog:: display_new_task_form($blog_id);
453
+            }
454
+            if (isset($_GET['do']) && $_GET['do'] == 'assign') {
455
+                Blog:: display_assign_task_form($blog_id);
456
+            }
457
+            if (isset($_GET['do']) && $_GET['do'] == 'edit') {
458
+                Blog:: display_edit_task_form(
459
+                    $blog_id,
460
+                    intval($_GET['task_id'])
461
+                );
462
+            }
463
+            if (isset($_GET['do']) && $_GET['do'] == 'edit_assignment') {
464
+                Blog :: display_edit_assigned_task_form($blog_id, intval($_GET['task_id']), intval($_GET['user_id']));
465
+            }
466
+            Blog :: display_task_list($blog_id);
467
+            echo '<br /><br />';
468
+            Blog :: display_assigned_task_list($blog_id);
469
+            echo '<br /><br />';
470 470
         } else {
471 471
             api_not_allowed();
472 472
         }
473 473
 
474
-		break;
475
-	case 'execute_task' :
474
+        break;
475
+    case 'execute_task' :
476 476
         if (isset ($_GET['post_id'])) {
477 477
             Blog:: display_post($blog_id, intval($_GET['post_id']));
478 478
         } else {
479 479
             Blog:: display_select_task_post($blog_id, intval($_GET['task_id']));
480 480
         }
481
-		break;
482
-	case 'view_search_result' :
483
-		Blog :: display_search_results($blog_id, Database::escape_string($_GET['q']));
484
-		break;
481
+        break;
482
+    case 'view_search_result' :
483
+        Blog :: display_search_results($blog_id, Database::escape_string($_GET['q']));
484
+        break;
485 485
     case '':
486 486
     default:
487
-		if (isset ($_GET['filter']) && !empty ($_GET['filter'])) {
488
-			Blog :: display_day_results($blog_id, Database::escape_string($_GET['filter']));
489
-		} else {
490
-			Blog :: display_blog_posts($blog_id);
491
-		}
487
+        if (isset ($_GET['filter']) && !empty ($_GET['filter'])) {
488
+            Blog :: display_day_results($blog_id, Database::escape_string($_GET['filter']));
489
+        } else {
490
+            Blog :: display_blog_posts($blog_id);
491
+        }
492 492
         break;
493 493
 }
494 494
 ?>
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 api_protect_course_script(true);
22 22
 
23 23
 $lib_path = api_get_path(LIBRARY_PATH);
24
-$blog_table_attachment 	= Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
24
+$blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
25 25
 
26 26
 $nameTools  = get_lang('Blogs');
27 27
 $DaysShort  = api_get_week_days_short();
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		$safe_comment_title,
135 135
 		$safe_comment_text,
136 136
 		$blog_id,
137
-		(int)$_GET['post_id'],
137
+		(int) $_GET['post_id'],
138 138
 		$_POST['comment_parent_id'],
139 139
 		$_POST['task_id']
140 140
 	);
@@ -146,29 +146,29 @@  discard block
 block discarded – undo
146 146
 if (!empty($_POST['register'])) {
147 147
 	if (is_array($_POST['user'])) {
148 148
 		foreach ($_POST['user'] as $index => $user_id) {
149
-			Blog :: set_user_subscribed((int)$_GET['blog_id'], $user_id);
149
+			Blog :: set_user_subscribed((int) $_GET['blog_id'], $user_id);
150 150
 		}
151 151
 	}
152 152
 }
153 153
 if (!empty($_POST['unregister'])) {
154 154
 	if (is_array($_POST['user'])) {
155 155
 		foreach ($_POST['user'] as $index => $user_id) {
156
-			Blog :: set_user_unsubscribed((int)$_GET['blog_id'], $user_id);
156
+			Blog :: set_user_unsubscribed((int) $_GET['blog_id'], $user_id);
157 157
 		}
158 158
 	}
159 159
 }
160 160
 if (!empty($_GET['register'])) {
161
-	Blog :: set_user_subscribed((int)$_GET['blog_id'], (int)$_GET['user_id']);
161
+	Blog :: set_user_subscribed((int) $_GET['blog_id'], (int) $_GET['user_id']);
162 162
 	$return_message = array('type' => 'confirmation', 'message' => get_lang('UserRegistered'));
163 163
 	$flag = 1;
164 164
 }
165 165
 if (!empty($_GET['unregister'])) {
166
-	Blog :: set_user_unsubscribed((int)$_GET['blog_id'], (int)$_GET['user_id']);
166
+	Blog :: set_user_unsubscribed((int) $_GET['blog_id'], (int) $_GET['user_id']);
167 167
 }
168 168
 
169 169
 if (isset($_GET['action']) && $_GET['action'] == 'manage_tasks') {
170 170
 	if (isset($_GET['do']) && $_GET['do'] == 'delete') {
171
-		Blog :: delete_task($blog_id, (int)$_GET['task_id']);
171
+		Blog :: delete_task($blog_id, (int) $_GET['task_id']);
172 172
 		$return_message = array('type' => 'confirmation', 'message' => get_lang('TaskDeleted'));
173 173
 	}
174 174
 
@@ -181,9 +181,9 @@  discard block
 block discarded – undo
181 181
 if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
182 182
 	$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
183 183
 
184
-	if (isset($_GET['do']) && $_GET['do'] == 'delete_comment')	{
184
+	if (isset($_GET['do']) && $_GET['do'] == 'delete_comment') {
185 185
 		if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_delete', $task_id)) {
186
-			Blog :: delete_comment($blog_id, (int)$_GET['post_id'],(int)$_GET['comment_id']);
186
+			Blog :: delete_comment($blog_id, (int) $_GET['post_id'], (int) $_GET['comment_id']);
187 187
 			$return_message = array('type' => 'confirmation', 'message' => get_lang('CommentDeleted'));
188 188
 		} else {
189 189
 			$error = true;
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
 		}
192 192
 	}
193 193
 
194
-	if (isset($_GET['do']) && $_GET['do'] == 'delete_article')	{
194
+	if (isset($_GET['do']) && $_GET['do'] == 'delete_article') {
195 195
 		if (api_is_allowed('BLOG_'.$blog_id, 'article_delete', $task_id)) {
196
-			Blog :: delete_post($blog_id, (int)$_GET['article_id']);
196
+			Blog :: delete_post($blog_id, (int) $_GET['article_id']);
197 197
 			$action = ''; // Article is gone, go to blog home
198 198
 			$return_message = array('type' => 'confirmation', 'message' => get_lang('BlogDeleted'));
199 199
 		} else {
@@ -204,13 +204,13 @@  discard block
 block discarded – undo
204 204
 	if (isset($_GET['do']) && $_GET['do'] == 'rate') {
205 205
 		if (isset($_GET['type']) && $_GET['type'] == 'post') {
206 206
 			if (api_is_allowed('BLOG_'.$blog_id, 'article_rate')) {
207
-				Blog :: add_rating('post', $blog_id, (int)$_GET['post_id'], (int)$_GET['rating']);
207
+				Blog :: add_rating('post', $blog_id, (int) $_GET['post_id'], (int) $_GET['rating']);
208 208
 				$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
209 209
 			}
210 210
 		}
211 211
 		if (isset($_GET['type']) && $_GET['type'] == 'comment') {
212 212
 			if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_add')) {
213
-				Blog :: add_rating('comment', $blog_id, (int)$_GET['comment_id'], (int)$_GET['rating']);
213
+				Blog :: add_rating('comment', $blog_id, (int) $_GET['comment_id'], (int) $_GET['rating']);
214 214
 				$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
215 215
 			}
216 216
 		}
@@ -289,16 +289,16 @@  discard block
 block discarded – undo
289 289
 echo '<div class=actions>';
290 290
 ?>
291 291
 	<a href="<?php echo api_get_self(); ?>?blog_id=<?php echo $blog_id ?>&<?php echo api_get_cidreq(); ?>" title="<?php echo get_lang('Home') ?>">
292
-    <?php echo Display::return_icon('blog.png', get_lang('Home'),'',ICON_SIZE_MEDIUM); ?></a>
293
-	<?php if(api_is_allowed('BLOG_'.$blog_id, 'article_add')) { ?>
292
+    <?php echo Display::return_icon('blog.png', get_lang('Home'), '', ICON_SIZE_MEDIUM); ?></a>
293
+	<?php if (api_is_allowed('BLOG_'.$blog_id, 'article_add')) { ?>
294 294
     <a href="<?php echo api_get_self(); ?>?action=new_post&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('NewPost') ?>">
295
-    <?php echo Display::return_icon('new_article.png', get_lang('NewPost'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?>
296
-	<?php if(api_is_allowed('BLOG_'.$blog_id, 'task_management')) { ?>
295
+    <?php echo Display::return_icon('new_article.png', get_lang('NewPost'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
296
+	<?php if (api_is_allowed('BLOG_'.$blog_id, 'task_management')) { ?>
297 297
     <a href="<?php echo api_get_self(); ?>?action=manage_tasks&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageTasks') ?>">
298
-    <?php echo Display::return_icon('blog_tasks.png', get_lang('TaskManager'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?>
299
-	<?php if(api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?>
298
+    <?php echo Display::return_icon('blog_tasks.png', get_lang('TaskManager'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
299
+	<?php if (api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?>
300 300
     <a href="<?php echo api_get_self(); ?>?action=manage_members&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageMembers') ?>">
301
-    <?php echo Display::return_icon('blog_admin_users.png', get_lang('MemberManager'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?>
301
+    <?php echo Display::return_icon('blog_admin_users.png', get_lang('MemberManager'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
302 302
 <?php
303 303
 echo '</div>';
304 304
 
@@ -315,8 +315,8 @@  discard block
 block discarded – undo
315 315
             <div class="panel-heading"><?php echo get_lang('Calendar') ?></div>
316 316
             <div class="panel-body">
317 317
                 <?php
318
-                    $month = isset($_GET['month']) ? (int)$_GET['month'] : (int) date('m');
319
-                    $year = isset($_GET['year']) ? (int)$_GET['year'] : date('Y');
318
+                    $month = isset($_GET['month']) ? (int) $_GET['month'] : (int) date('m');
319
+                    $year = isset($_GET['year']) ? (int) $_GET['year'] : date('Y');
320 320
                     Blog::display_minimonthcalendar($month, $year, $blog_id);
321 321
                 ?>
322 322
             </div>
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 $course_id = api_get_course_int_id();
363 363
 
364 364
 if (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) {
365
-	$task_id = (int)$_GET['task_id'];
365
+	$task_id = (int) $_GET['task_id'];
366 366
 } else {
367 367
 	$task_id = 0;
368 368
 	$tbl_blogs_tasks_rel_user = Database :: get_course_table(TABLE_BLOGS_TASKS_REL_USER);
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -378,9 +378,10 @@
 block discarded – undo
378 378
 	$result = Database::query($sql);
379 379
 	$row = Database::fetch_array($result);
380 380
 
381
-	if ($row['number'] == 1)
382
-		$user_task = true;
383
-}
381
+	if ($row['number'] == 1) {
382
+			$user_task = true;
383
+	}
384
+	}
384 385
 
385 386
 switch ($action) {
386 387
 	case 'new_post':
Please login to merge, or discard this patch.
main/gradebook/gradebook_edit_eval.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     null,
21 21
     'edit_eval_form',
22 22
     null,
23
-    api_get_self() . '?editeval=' . Security::remove_XSS($_GET['editeval'])
23
+    api_get_self().'?editeval='.Security::remove_XSS($_GET['editeval'])
24 24
 );
25 25
 if ($form->validate()) {
26 26
     $values = $form->exportValues();
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
     }
46 46
     $eval->set_visible($visible);
47 47
     $eval->save();
48
-    header('Location: '.$_SESSION['gradebook_dest'].'?editeval=&selectcat=' . $eval->get_category_id());
48
+    header('Location: '.$_SESSION['gradebook_dest'].'?editeval=&selectcat='.$eval->get_category_id());
49 49
     exit;
50 50
 }
51
-$selectcat_inter=isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
51
+$selectcat_inter = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
52 52
 $interbreadcrumb[] = array(
53 53
     'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectcat_inter,
54 54
     'name' => get_lang('Gradebook'
Please login to merge, or discard this patch.
main/gradebook/gradebook_add_link.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 GradebookUtils::block_students();
15 15
 
16 16
 $courseCode = isset($_GET['course_code']) ? Security::remove_XSS($_GET['course_code']) : null;
17
-$selectCat =  isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
17
+$selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
18 18
 
19 19
 $course_info = api_get_course_info($courseCode);
20 20
 $tbl_forum_thread = Database :: get_course_table(TABLE_FORUM_THREAD);
Please login to merge, or discard this patch.