Completed
Push — 1.11.x ( 55a6a1...a914dc )
by José
60:32 queued 35:06
created
src/Chamilo/ThemeBundle/EventListener/NavbarTaskListDemoListener.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
     protected function getTasks()
27 27
     {
28 28
         return array(
29
-         new TaskModel('make stuff', 30, TaskModel::COLOR_GREEN),
30
-         new TaskModel('make more stuff', 60),
31
-         new TaskModel('some more tasks to do', 10, TaskModel::COLOR_RED)
29
+            new TaskModel('make stuff', 30, TaskModel::COLOR_GREEN),
30
+            new TaskModel('make more stuff', 60),
31
+            new TaskModel('some more tasks to do', 10, TaskModel::COLOR_RED)
32 32
         );
33 33
 
34 34
     }
Please login to merge, or discard this patch.
main/inc/lib/geometry.lib.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
      *        for all j in [O..max[y][ : for all i in bords[$j] :
57 57
      *            (i,j) is a point inside an edge of the polygone
58 58
      */
59
-	$bord_lenght = $max['x'];
59
+    $bord_lenght = $max['x'];
60 60
     if ($max['y'] > $bord_lenght) {
61
-     	$bord_lenght = $max['y'];
61
+            $bord_lenght = $max['y'];
62 62
     }
63 63
 
64 64
     //$bords = array_fill(0, $bord_lenght-1, array()); // building this array
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
     /* adding the first point of the polygone */
68 68
     if (is_array($bords[$poly[0]['y']])) //avoid warning
69
-    	array_push($bords[$poly[0]['y']], $poly[0]['x']);
69
+        array_push($bords[$poly[0]['y']], $poly[0]['x']);
70 70
 
71 71
     $i = 1; // we re-use $i and $old_pente bellow the loop
72 72
     $old_pente=0;
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
             if ($poly[$i-1]['x'] == $poly[$i]['x'])
79 79
                 continue; // twice the same point
80 80
             else {    //  infinite elevation of the edge
81
-            	if (is_array($bords[$poly[$i]['y']]))
82
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
81
+                if (is_array($bords[$poly[$i]['y']]))
82
+                    array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
83 83
                 $old_pente=0;
84 84
                 continue;
85 85
             }
86 86
         }
87 87
 
88
-		//echo 'point:'.$poly[$i]['y']; bug here
88
+        //echo 'point:'.$poly[$i]['y']; bug here
89 89
         // adding the point as a part of an edge
90 90
         if (is_array($bords[$poly[$i]['y']])) //avoid warning
91 91
         array_push($bords[$poly[$i]['y']], $poly[$i]['x']);
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
         if ($i>1)
103 103
             if (($old_pente<0 && $pente>0)
104 104
                     || ($old_pente>0 && $pente<0)) {
105
-				if (is_array($bords[$poly[$i]['y']])) //avoid warning
106
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
105
+                if (is_array($bords[$poly[$i]['y']])) //avoid warning
106
+                    array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
107 107
 
108 108
                 if (DEBUG)
109 109
                     echo '*('.$poly[$i]['x'].
110 110
                         ';'.$poly[$i]['y'].')   ';
111
-        	}
111
+            }
112 112
 
113 113
         /* detect the direction of the elevation in Y */
114 114
         $dy_inc = ($poly[$i]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1;
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
         // elevation between $poly[0]['x'] and $poly[1]['x'])
138 138
         $rest = $poly[0]['y']-$poly[1]['y'];
139 139
         if ($rest!=0)
140
-        	$pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest);
140
+            $pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest);
141 141
         else
142
-			$pente1 = 0;
142
+            $pente1 = 0;
143 143
 
144 144
         // elevation between $poly[$i-1]['x'] and $poly[0]['x'])
145 145
         $pente = ($poly[$i-1]['x']-$poly[0]['x'])/
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
 
152 152
         // doubling the first point if needed (see above)
153 153
         if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) {
154
-        	if (is_array($bords[$poly[$i - 1]['y']]))
155
-            	array_push($bords[$poly[$i - 1]['y']],  round($poly[$i - 1]['x']));
154
+            if (is_array($bords[$poly[$i - 1]['y']]))
155
+                array_push($bords[$poly[$i - 1]['y']],  round($poly[$i - 1]['x']));
156 156
             //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
157 157
         }
158 158
         //  doubling the last point if neededd
159 159
         if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) {
160
-        	if (is_array($bords[$poly[$i-1]['y']])) //avoid warning
161
-            	array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x']));
160
+            if (is_array($bords[$poly[$i-1]['y']])) //avoid warning
161
+                array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x']));
162 162
             //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
163 163
         }
164 164
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     for ($i = 0; $i<$n; $i++) {  // Y
186 186
         //error_log(__FILE__.' - Border Num '.$i,0);
187 187
         if (is_array($bords[$i])) {
188
-       		sort($bords[$i]);
188
+                sort($bords[$i]);
189 189
         }
190 190
 
191 191
         for ($j = 0; $j<sizeof($bords[$i]);$j+=2) { // bords
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
             for ($k = round($bords[$i][$j]); $k<=$bords[$i][$j+1];$k++) {
197 197
                 $res[$k][$i] = true; //filling the array with trues
198 198
                 if ($test == 1)  {
199
-                	/*how to draw the polygon in a human way:
199
+                    /*how to draw the polygon in a human way:
200 200
                 	In ubuntu : sudo apt-get install gnuplot
201 201
                 	Create an empty file with all points with the result of this echos (No commas, no point, no headers)
202 202
                 	In gnuplot:
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                 	For 2 polygons:  plot "/home/jmontoya/test", "/home/jmontoya/test2"
205 205
                 	A new window will appear with the plot
206 206
                 	*/
207
-                	echo $k.'  '.$i; echo '<br />';
207
+                    echo $k.'  '.$i; echo '<br />';
208 208
                 }
209 209
             }
210 210
         }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         list($x,$y) = explode(';',$pcoord);
309 309
         $points[] = array('x'=>$x,'y'=>$y);
310 310
     }
311
-	return $points;
311
+    return $points;
312 312
 }
313 313
 
314 314
 /**
@@ -321,11 +321,11 @@  discard block
 block discarded – undo
321 321
     $mx = 0;
322 322
     $my = 0;
323 323
     foreach ($coords1 as $coord) {
324
-    	if ($coord['x'] > $mx) {
324
+        if ($coord['x'] > $mx) {
325 325
             $mx = $coord['x'];
326
-    	}
326
+        }
327 327
         if ($coord['y'] > $my) {
328
-        	$my = $coord['y'];
328
+            $my = $coord['y'];
329 329
         }
330 330
     }
331 331
     foreach ($coords2 as $coord) {
Please login to merge, or discard this patch.
main/admin/access_urls.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,12 +85,12 @@
 block discarded – undo
85 85
     }
86 86
 }
87 87
 if(!empty($url_string)) {
88
-	Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false);
88
+    Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false);
89 89
 }
90 90
 
91 91
 // checking the current installation
92 92
 if ($current_access_url_id==-1) {
93
-	Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH));
93
+    Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH));
94 94
 } elseif(api_is_platform_admin()) {
95 95
     $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id);
96 96
     if ($quant==0) {
Please login to merge, or discard this patch.
main/admin/ldap_import_students_to_session.php 1 patch
Indentation   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -53,93 +53,93 @@  discard block
 block discarded – undo
53 53
 //if ($annee == "" && $composante == "" && $etape == "") {
54 54
 if (empty($annee) && empty($id_session))
55 55
 {
56
-		Display::display_header($tool_name);
57
-		echo '<div style="align:center">';
58
-		echo Display::return_icon('group.gif', get_lang('LDAPSelectFilterOnUsersOU')).' '.get_lang('LDAPSelectFilterOnUsersOU');
59
-		echo '<form method="get" action="'.api_get_self().'"><br />';
60
-		echo '<em>'.get_lang('LDAPOUAttributeFilter').' :</em> ';
61
-		echo '<input  type="text" name="annee" size="4" maxlength="30" value="'.$annee_base.'"> ';
62
-		echo '<input type="submit" value="'.get_lang('Submit').'">';
63
-		echo '</form>';
64
-		echo '</div>';
56
+        Display::display_header($tool_name);
57
+        echo '<div style="align:center">';
58
+        echo Display::return_icon('group.gif', get_lang('LDAPSelectFilterOnUsersOU')).' '.get_lang('LDAPSelectFilterOnUsersOU');
59
+        echo '<form method="get" action="'.api_get_self().'"><br />';
60
+        echo '<em>'.get_lang('LDAPOUAttributeFilter').' :</em> ';
61
+        echo '<input  type="text" name="annee" size="4" maxlength="30" value="'.$annee_base.'"> ';
62
+        echo '<input type="submit" value="'.get_lang('Submit').'">';
63
+        echo '</form>';
64
+        echo '</div>';
65 65
 
66 66
 }
67 67
 elseif(!empty($annee) && empty($id_session))
68 68
 {
69
-	Display::display_header($tool_name);
70
-	echo '<div style="align:center">';
71
-	echo Display::return_icon(
72
-			'course.png',
73
-			get_lang('SelectSessionToImportUsersTo')).' '.get_lang('SelectSessionToImportUsersTo').'<br />';
74
-	echo '<form method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'"><br />';
75
-	echo '<select name="id_session">';
76
-
77
-	$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
78
-	$sql = "SELECT id,name,nbr_courses,access_start_date,access_end_date " .
79
-		" FROM $tbl_session ".
80
-		" ORDER BY name";
81
-	$result = Database::query($sql);
82
-
83
-	$sessions=Database::store_result($result);
84
-	$nbr_results=count($sessions);
85
-	foreach($sessions as $row) {
86
-		echo '<option value="'.$row['id'].'">'.api_htmlentities($row['name']).' ('.$row['access_start_date'].' - '.$row['access_end_date'].')</option>';
87
-	}
88
-	echo '</select>';
89
-	echo '<input type="submit" value="'.get_lang('Submit').'">';
90
-	echo '</form>';
91
-	echo '</div>';
69
+    Display::display_header($tool_name);
70
+    echo '<div style="align:center">';
71
+    echo Display::return_icon(
72
+            'course.png',
73
+            get_lang('SelectSessionToImportUsersTo')).' '.get_lang('SelectSessionToImportUsersTo').'<br />';
74
+    echo '<form method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'"><br />';
75
+    echo '<select name="id_session">';
76
+
77
+    $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
78
+    $sql = "SELECT id,name,nbr_courses,access_start_date,access_end_date " .
79
+        " FROM $tbl_session ".
80
+        " ORDER BY name";
81
+    $result = Database::query($sql);
82
+
83
+    $sessions=Database::store_result($result);
84
+    $nbr_results=count($sessions);
85
+    foreach($sessions as $row) {
86
+        echo '<option value="'.$row['id'].'">'.api_htmlentities($row['name']).' ('.$row['access_start_date'].' - '.$row['access_end_date'].')</option>';
87
+    }
88
+    echo '</select>';
89
+    echo '<input type="submit" value="'.get_lang('Submit').'">';
90
+    echo '</form>';
91
+    echo '</div>';
92 92
 }
93 93
 // form4  annee != 0; composante != 0 etape != 0
94 94
 //elseif ($annee <> "" && $composante <> "" && $etape <> "" && $listeok != 'yes') {
95 95
 elseif (!empty($annee) && !empty($id_session) && empty($_POST['confirmed']))
96 96
 {
97
-	Display::display_header($tool_name);
98
-	echo '<div style="align: center;">';
99
-	echo '<br />';
100
-	echo '<br />';
101
-	echo '<h3>'.Display::return_icon('group.gif', get_lang('SelectStudents')).' '.get_lang('SelectStudents').'</h3>';
102
-	//echo "Connection ...";
103
-	$ds = ldap_connect($ldap_host, $ldap_port) or die(get_lang('LDAPConnectionError'));
104
-	ldap_set_version($ds);
105
-
106
-	if ($ds) {
107
-
108
-		$r = false;
109
-		$res = ldap_handle_bind($ds, $r);
110
-
111
-		//$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "(|(edupersonprimaryorgunitdn=ou=$etape,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn)(edupersonprimaryorgunitdn=ou=02PEL,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn))");
112
-		//echo "(ou=*$annee,ou=$composante)";
113
-		$sr = @ ldap_search($ds, $ldap_basedn, "(ou=*$annee)");
114
-
115
-		$info = ldap_get_entries($ds, $sr);
116
-
117
-		for ($key = 0; $key < $info["count"]; $key ++) {
118
-			$nom_form[] = $info[$key]["sn"][0];
119
-			$prenom_form[] = $info[$key]["givenname"][0];
120
-			$email_form[] = $info[$key]["mail"][0];
121
-			// Get uid from dn
122
-			//$dn_array=ldap_explode_dn($info[$key]["dn"],1);
123
-			//$username_form[] = $dn_array[0]; // uid is first key
124
-			$username_form[] = $info[$key]['uid'][0];
125
-			$outab[] = $info[$key]["eduPersonPrimaryAffiliation"][0]; // Ici "student"
126
-			//$val = ldap_get_values_len($ds, $entry, "userPassword");
127
-			//$password_form[] = $val[0];
128
-			$password_form[] = $info[$key]['userPassword'][0];
129
-		}
130
-		ldap_unbind($ds);
131
-
132
-		/*-----------------------------------------------*/
133
-
134
-		asort($nom_form);
135
-		reset($nom_form);
136
-
137
-		$statut=5;
138
-		include ('ldap_form_add_users_group.php');
139
-	} else {
140
-		echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>';
141
-	}
142
-	echo '<br /><br />';
97
+    Display::display_header($tool_name);
98
+    echo '<div style="align: center;">';
99
+    echo '<br />';
100
+    echo '<br />';
101
+    echo '<h3>'.Display::return_icon('group.gif', get_lang('SelectStudents')).' '.get_lang('SelectStudents').'</h3>';
102
+    //echo "Connection ...";
103
+    $ds = ldap_connect($ldap_host, $ldap_port) or die(get_lang('LDAPConnectionError'));
104
+    ldap_set_version($ds);
105
+
106
+    if ($ds) {
107
+
108
+        $r = false;
109
+        $res = ldap_handle_bind($ds, $r);
110
+
111
+        //$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "(|(edupersonprimaryorgunitdn=ou=$etape,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn)(edupersonprimaryorgunitdn=ou=02PEL,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn))");
112
+        //echo "(ou=*$annee,ou=$composante)";
113
+        $sr = @ ldap_search($ds, $ldap_basedn, "(ou=*$annee)");
114
+
115
+        $info = ldap_get_entries($ds, $sr);
116
+
117
+        for ($key = 0; $key < $info["count"]; $key ++) {
118
+            $nom_form[] = $info[$key]["sn"][0];
119
+            $prenom_form[] = $info[$key]["givenname"][0];
120
+            $email_form[] = $info[$key]["mail"][0];
121
+            // Get uid from dn
122
+            //$dn_array=ldap_explode_dn($info[$key]["dn"],1);
123
+            //$username_form[] = $dn_array[0]; // uid is first key
124
+            $username_form[] = $info[$key]['uid'][0];
125
+            $outab[] = $info[$key]["eduPersonPrimaryAffiliation"][0]; // Ici "student"
126
+            //$val = ldap_get_values_len($ds, $entry, "userPassword");
127
+            //$password_form[] = $val[0];
128
+            $password_form[] = $info[$key]['userPassword'][0];
129
+        }
130
+        ldap_unbind($ds);
131
+
132
+        /*-----------------------------------------------*/
133
+
134
+        asort($nom_form);
135
+        reset($nom_form);
136
+
137
+        $statut=5;
138
+        include ('ldap_form_add_users_group.php');
139
+    } else {
140
+        echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>';
141
+    }
142
+    echo '<br /><br />';
143 143
     echo '<a href="ldap_import_students.php?annee=">'.get_lang('BackToNewSearch').'</a>';
144 144
     echo '<br /><br />';
145 145
     echo '</div>';
@@ -147,23 +147,23 @@  discard block
 block discarded – undo
147 147
 }
148 148
 elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes'))
149 149
 {
150
-	$id=$_POST['username_form'];
151
-	$UserList=array();
152
-	$userid_match_login = array();
153
-	foreach ($id as $form_index=>$user_id)
154
-	{
155
-		if(is_array($_POST['checkboxes']) && in_array($form_index,array_values($_POST['checkboxes'])))
156
-		{
157
-			$tmp = ldap_add_user($user_id);
158
-			$UserList[]= $tmp;
159
-			$userid_match_login[$tmp] = $user_id;
160
-		}
161
-	}
162
-	if (!empty($_POST['id_session'])) {
163
-		$num = 0;
164
-		$tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
165
-		$tbl_session	  = Database::get_main_table(TABLE_MAIN_SESSION);
166
-		foreach ($UserList as $user_id) {
150
+    $id=$_POST['username_form'];
151
+    $UserList=array();
152
+    $userid_match_login = array();
153
+    foreach ($id as $form_index=>$user_id)
154
+    {
155
+        if(is_array($_POST['checkboxes']) && in_array($form_index,array_values($_POST['checkboxes'])))
156
+        {
157
+            $tmp = ldap_add_user($user_id);
158
+            $UserList[]= $tmp;
159
+            $userid_match_login[$tmp] = $user_id;
160
+        }
161
+    }
162
+    if (!empty($_POST['id_session'])) {
163
+        $num = 0;
164
+        $tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
165
+        $tbl_session	  = Database::get_main_table(TABLE_MAIN_SESSION);
166
+        foreach ($UserList as $user_id) {
167 167
                     $res_user = Database::insert(
168 168
                         $tbl_session_user,
169 169
                         [
@@ -175,15 +175,15 @@  discard block
 block discarded – undo
175 175
                     if ($res_user !== false) {
176 176
                         $num++;
177 177
                     }
178
-		}
179
-
180
-		if($num>0) {
181
-			$sql = 'UPDATE '.$tbl_session.' SET nbr_users = (nbr_users + '.$num.') WHERE id = '.intval($id_session);
182
-			$res = Database::query($sql);
183
-		}
184
-		header('Location: resume_session.php?id_session='.Security::remove_XSS($_POST['id_session']));
185
-	}
186
-	/*
178
+        }
179
+
180
+        if($num>0) {
181
+            $sql = 'UPDATE '.$tbl_session.' SET nbr_users = (nbr_users + '.$num.') WHERE id = '.intval($id_session);
182
+            $res = Database::query($sql);
183
+        }
184
+        header('Location: resume_session.php?id_session='.Security::remove_XSS($_POST['id_session']));
185
+    }
186
+    /*
187 187
 	else
188 188
 	{
189 189
 		Display :: display_header($tool_name);
@@ -202,13 +202,13 @@  discard block
 block discarded – undo
202 202
 		Display :: display_normal_message($message,false);
203 203
 	}
204 204
 	*/
205
-	else
206
-	{
207
-		Display::display_header($tool_name);
208
-		$message=get_lang('NoUserAdded');
209
-		Display :: display_normal_message($message,false);
210
-	}
211
-	echo '<br /><br />';
205
+    else
206
+    {
207
+        Display::display_header($tool_name);
208
+        $message=get_lang('NoUserAdded');
209
+        Display :: display_normal_message($message,false);
210
+    }
211
+    echo '<br /><br />';
212 212
     echo '<a href="ldap_import_students.php?annee=&composante=&etape=">'.get_lang('BackToNewSearch').'</a>';
213 213
     echo '<br /><br />';
214 214
 }
Please login to merge, or discard this patch.
main/admin/ldap_import_students.php 1 patch
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -56,19 +56,19 @@  discard block
 block discarded – undo
56 56
 //if ($annee == "" && $composante == "" && $etape == "") {
57 57
 if (empty($annee) && empty($course))
58 58
 {
59
-		Display::display_header($tool_name);
60
-		echo '<div style="align:center">';
61
-		Display::display_icon('group.gif', get_lang('LDAPSelectFilterOnUsersOU'));
62
-		echo get_lang('LDAPSelectFilterOnUsersOU');
63
-		//echo '<em>'.get_lang('ToDoThisYouMustEnterYearComponentAndComponentStep').'</em><br />';
64
-		///echo get_lang('FollowEachOfTheseStepsStepByStep').'<br />';
65
-
66
-		echo '<form method="get" action="'.api_get_self().'"><br />';
67
-		echo '<em>'.get_lang('LDAPOUAttributeFilter').' :</em> ';
68
-		echo '<input  type="text" name="annee" size="4" maxlength="30" value="'.$annee_base.'"><br />';
69
-		echo '<input type="submit" value="'.get_lang('Submit').'">';
70
-		echo '</form>';
71
-		echo '</div>';
59
+        Display::display_header($tool_name);
60
+        echo '<div style="align:center">';
61
+        Display::display_icon('group.gif', get_lang('LDAPSelectFilterOnUsersOU'));
62
+        echo get_lang('LDAPSelectFilterOnUsersOU');
63
+        //echo '<em>'.get_lang('ToDoThisYouMustEnterYearComponentAndComponentStep').'</em><br />';
64
+        ///echo get_lang('FollowEachOfTheseStepsStepByStep').'<br />';
65
+
66
+        echo '<form method="get" action="'.api_get_self().'"><br />';
67
+        echo '<em>'.get_lang('LDAPOUAttributeFilter').' :</em> ';
68
+        echo '<input  type="text" name="annee" size="4" maxlength="30" value="'.$annee_base.'"><br />';
69
+        echo '<input type="submit" value="'.get_lang('Submit').'">';
70
+        echo '</form>';
71
+        echo '</div>';
72 72
 
73 73
 }
74 74
 /*
@@ -200,71 +200,71 @@  discard block
 block discarded – undo
200 200
 */
201 201
 elseif(!empty($annee) && empty($course))
202 202
 {
203
-	Display::display_header($tool_name);
204
-	echo '<div style="align:center">';
205
-	echo Display::return_icon('course.png', get_lang('SelectCourseToImportUsersTo')).' '.get_lang('SelectCourseToImportUsersTo').'<br />';
206
-	echo '<form method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'"><br />';
207
-	echo '<select name="course">';
208
-	$courses = CourseManager::get_courses_list();
209
-	foreach($courses as $row)
210
-	{
211
-		echo '<option value="'.$row['code'].'">'.api_htmlentities($row['title']).'</option>';
212
-	}
213
-	echo '</select>';
214
-	echo '<input type="submit" value="'.get_lang('Submit').'">';
215
-	echo '</form>';
216
-	echo '</div>';
203
+    Display::display_header($tool_name);
204
+    echo '<div style="align:center">';
205
+    echo Display::return_icon('course.png', get_lang('SelectCourseToImportUsersTo')).' '.get_lang('SelectCourseToImportUsersTo').'<br />';
206
+    echo '<form method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'"><br />';
207
+    echo '<select name="course">';
208
+    $courses = CourseManager::get_courses_list();
209
+    foreach($courses as $row)
210
+    {
211
+        echo '<option value="'.$row['code'].'">'.api_htmlentities($row['title']).'</option>';
212
+    }
213
+    echo '</select>';
214
+    echo '<input type="submit" value="'.get_lang('Submit').'">';
215
+    echo '</form>';
216
+    echo '</div>';
217 217
 }
218 218
 // form4  annee != 0; composante != 0 etape != 0
219 219
 //elseif ($annee <> "" && $composante <> "" && $etape <> "" && $listeok != 'yes') {
220 220
 elseif (!empty($annee) && !empty($course) && empty($_POST['confirmed']))
221 221
 {
222
-	Display::display_header($tool_name);
223
-	echo '<div style="align: center;">';
224
-	echo '<br />';
225
-	echo '<br />';
226
-	echo '<h3>'.Display::return_icon('group.gif', get_lang('SelectStudents')).' '.get_lang('SelectStudents').'</h3>';
227
-	//echo "Connection ...";
228
-	$ds = ldap_connect($ldap_host, $ldap_port) or die(get_lang('LDAPConnectionError'));
229
-	ldap_set_version($ds);
230
-
231
-	if ($ds) {
232
-
233
-		$r = false;
234
-		$res = ldap_handle_bind($ds, $r);
235
-
236
-		//$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "(|(edupersonprimaryorgunitdn=ou=$etape,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn)(edupersonprimaryorgunitdn=ou=02PEL,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn))");
237
-		//echo "(ou=*$annee,ou=$composante)";
238
-		$sr = @ ldap_search($ds, $ldap_basedn, "(ou=*$annee)");
239
-
240
-		$info = ldap_get_entries($ds, $sr);
241
-
242
-		for ($key = 0; $key < $info["count"]; $key ++) {
243
-			$nom_form[] = $info[$key]["sn"][0];
244
-			$prenom_form[] = $info[$key]["givenname"][0];
245
-			$email_form[] = $info[$key]["mail"][0];
246
-			// Get uid from dn
247
-			//$dn_array=ldap_explode_dn($info[$key]["dn"],1);
248
-			//$username_form[] = $dn_array[0]; // uid is first key
249
-			$username_form[] = $info[$key]['uid'][0];
250
-			$outab[] = $info[$key]["eduPersonPrimaryAffiliation"][0]; // Ici "student"
251
-			//$val = ldap_get_values_len($ds, $entry, "userPassword");
252
-			//$password_form[] = $val[0];
253
-			$password_form[] = $info[$key]['userPassword'][0];
254
-		}
255
-		ldap_unbind($ds);
256
-
257
-		/*-----------------------------------------------*/
258
-
259
-		asort($nom_form);
260
-		reset($nom_form);
261
-
262
-		$statut=5;
263
-		include ('ldap_form_add_users_group.php');
264
-	} else {
265
-		echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>';
266
-	}
267
-	echo '<br /><br />';
222
+    Display::display_header($tool_name);
223
+    echo '<div style="align: center;">';
224
+    echo '<br />';
225
+    echo '<br />';
226
+    echo '<h3>'.Display::return_icon('group.gif', get_lang('SelectStudents')).' '.get_lang('SelectStudents').'</h3>';
227
+    //echo "Connection ...";
228
+    $ds = ldap_connect($ldap_host, $ldap_port) or die(get_lang('LDAPConnectionError'));
229
+    ldap_set_version($ds);
230
+
231
+    if ($ds) {
232
+
233
+        $r = false;
234
+        $res = ldap_handle_bind($ds, $r);
235
+
236
+        //$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "(|(edupersonprimaryorgunitdn=ou=$etape,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn)(edupersonprimaryorgunitdn=ou=02PEL,ou=$annee,ou=diploma,o=Paris1,$LDAPbasedn))");
237
+        //echo "(ou=*$annee,ou=$composante)";
238
+        $sr = @ ldap_search($ds, $ldap_basedn, "(ou=*$annee)");
239
+
240
+        $info = ldap_get_entries($ds, $sr);
241
+
242
+        for ($key = 0; $key < $info["count"]; $key ++) {
243
+            $nom_form[] = $info[$key]["sn"][0];
244
+            $prenom_form[] = $info[$key]["givenname"][0];
245
+            $email_form[] = $info[$key]["mail"][0];
246
+            // Get uid from dn
247
+            //$dn_array=ldap_explode_dn($info[$key]["dn"],1);
248
+            //$username_form[] = $dn_array[0]; // uid is first key
249
+            $username_form[] = $info[$key]['uid'][0];
250
+            $outab[] = $info[$key]["eduPersonPrimaryAffiliation"][0]; // Ici "student"
251
+            //$val = ldap_get_values_len($ds, $entry, "userPassword");
252
+            //$password_form[] = $val[0];
253
+            $password_form[] = $info[$key]['userPassword'][0];
254
+        }
255
+        ldap_unbind($ds);
256
+
257
+        /*-----------------------------------------------*/
258
+
259
+        asort($nom_form);
260
+        reset($nom_form);
261
+
262
+        $statut=5;
263
+        include ('ldap_form_add_users_group.php');
264
+    } else {
265
+        echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>';
266
+    }
267
+    echo '<br /><br />';
268 268
     echo '<a href="ldap_import_students.php?annee=&composante=&etape=">'.get_lang('BackToNewSearch').'</a>';
269 269
     echo '<br /><br />';
270 270
     echo '</div>';
@@ -272,27 +272,27 @@  discard block
 block discarded – undo
272 272
 }
273 273
 elseif (!empty($annee) && !empty($course) && ($_POST['confirmed']=='yes'))
274 274
 {
275
-	$id=$_POST['username_form'];
276
-	$UserList=array();
277
-	$userid_match_login = array();
278
-	foreach ($id as $form_index=>$user_id)
279
-	{
280
-		if(is_array($_POST['checkboxes']) && in_array($form_index,array_values($_POST['checkboxes'])))
281
-		{
282
-			$tmp = ldap_add_user($user_id);
283
-			$UserList[]= $tmp;
284
-			$userid_match_login[$tmp] = $user_id;
285
-		}
286
-	}
287
-	if (!empty($_POST['course']))
288
-	{
289
-		foreach($UserList as $user_id)
290
-		{
291
-			CourseManager::add_user_to_course($user_id,$_POST['course']);
292
-		}
293
-		header('Location: course_information.php?code='.Security::remove_XSS($_POST['course']));
294
-	}
295
-	/*
275
+    $id=$_POST['username_form'];
276
+    $UserList=array();
277
+    $userid_match_login = array();
278
+    foreach ($id as $form_index=>$user_id)
279
+    {
280
+        if(is_array($_POST['checkboxes']) && in_array($form_index,array_values($_POST['checkboxes'])))
281
+        {
282
+            $tmp = ldap_add_user($user_id);
283
+            $UserList[]= $tmp;
284
+            $userid_match_login[$tmp] = $user_id;
285
+        }
286
+    }
287
+    if (!empty($_POST['course']))
288
+    {
289
+        foreach($UserList as $user_id)
290
+        {
291
+            CourseManager::add_user_to_course($user_id,$_POST['course']);
292
+        }
293
+        header('Location: course_information.php?code='.Security::remove_XSS($_POST['course']));
294
+    }
295
+    /*
296 296
 	else
297 297
 	{
298 298
 		Display :: display_header($tool_name);
@@ -311,13 +311,13 @@  discard block
 block discarded – undo
311 311
 		Display :: display_normal_message($message,false);
312 312
 	}
313 313
 	*/
314
-	else
315
-	{
316
-		Display::display_header($tool_name);
317
-		$message=get_lang('NoUserAdded');
318
-		Display :: display_normal_message($message,false);
319
-	}
320
-	echo '<br /><br />';
314
+    else
315
+    {
316
+        Display::display_header($tool_name);
317
+        $message=get_lang('NoUserAdded');
318
+        Display :: display_normal_message($message,false);
319
+    }
320
+    echo '<br /><br />';
321 321
     echo '<a href="ldap_import_students.php?annee=&composante=&etape=">'.get_lang('BackToNewSearch').'</a>';
322 322
     echo '<br /><br />';
323 323
 }
Please login to merge, or discard this patch.
main/course_description/index.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@
 block discarded – undo
24 24
 $actions = array('listing', 'add', 'edit', 'delete', 'history');
25 25
 $action = 'listing';
26 26
 if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
27
-	$action = $_GET['action'];
27
+    $action = $_GET['action'];
28 28
 }
29 29
 
30 30
 $description_type = '';
31 31
 if (isset($_GET['description_type'])) {
32
-	$description_type = intval($_GET['description_type']);
32
+    $description_type = intval($_GET['description_type']);
33 33
 }
34 34
 
35 35
 $id = null;
Please login to merge, or discard this patch.
main/document/slideshow.php 1 patch
Indentation   +245 added lines, -245 removed lines patch added patch discarded remove patch
@@ -15,15 +15,15 @@  discard block
 block discarded – undo
15 15
 $slide_id = isset($_GET['slide_id']) ? Security::remove_XSS($_GET['slide_id']) : null;
16 16
 
17 17
 if (empty($slide_id)) {
18
-	$edit_slide_id = 1;
18
+    $edit_slide_id = 1;
19 19
 } else {
20
-	$edit_slide_id = $slide_id;
20
+    $edit_slide_id = $slide_id;
21 21
 }
22 22
 
23 23
 if ($path != '/') {
24
-	$folder = $path.'/';
24
+    $folder = $path.'/';
25 25
 } else {
26
-	$folder = '/';
26
+    $folder = '/';
27 27
 }
28 28
 $sys_course_path = api_get_path(SYS_COURSE_PATH);
29 29
 
@@ -41,15 +41,15 @@  discard block
 block discarded – undo
41 41
 
42 42
 // Loading the slides from the session
43 43
 if (isset($_SESSION['image_files_only'])) {
44
-	$image_files_only = $_SESSION['image_files_only'];
44
+    $image_files_only = $_SESSION['image_files_only'];
45 45
 }
46 46
 
47 47
 // Calculating the current slide, next slide, previous slide and the number of slides
48 48
 $slide = null;
49 49
 if ($slide_id != 'all') {
50
-	$slide = $slide_id ? $slide_id : 0;
51
-	$previous_slide = $slide - 1;
52
-	$next_slide = $slide + 1;
50
+    $slide = $slide_id ? $slide_id : 0;
51
+    $previous_slide = $slide - 1;
52
+    $next_slide = $slide + 1;
53 53
 }
54 54
 $total_slides = count($image_files_only);
55 55
 ?>
@@ -62,62 +62,62 @@  discard block
 block discarded – undo
62 62
 <?php
63 63
 
64 64
 if ($slide_id != 'all') {
65
-	$image = null;
66
-	if (isset($image_files_only[$slide])) {
67
-		$image = $sys_course_path . $_course['path'] . '/document' . $folder . $image_files_only[$slide];
68
-	}
69
-	if (file_exists($image)) {
70
-		echo '<div class="actions-pagination">';
71
-
72
-		// Back forward buttons
73
-		if ($slide == 0) {
74
-			$imgp = 'action_prev_na.png';
75
-			$first = Display::return_icon('action_first_na.png');
76
-		} else {
77
-			$imgp = 'action_prev.png';
78
-			$first = '<a href="slideshow.php?slide_id=0&curdirpath='.$pathurl.'">
65
+    $image = null;
66
+    if (isset($image_files_only[$slide])) {
67
+        $image = $sys_course_path . $_course['path'] . '/document' . $folder . $image_files_only[$slide];
68
+    }
69
+    if (file_exists($image)) {
70
+        echo '<div class="actions-pagination">';
71
+
72
+        // Back forward buttons
73
+        if ($slide == 0) {
74
+            $imgp = 'action_prev_na.png';
75
+            $first = Display::return_icon('action_first_na.png');
76
+        } else {
77
+            $imgp = 'action_prev.png';
78
+            $first = '<a href="slideshow.php?slide_id=0&curdirpath='.$pathurl.'">
79 79
 			          '.Display::return_icon('action_first.png', get_lang('FirstSlide')).'
80 80
 			          </a>';
81
-		}
81
+        }
82 82
 
83
-		// First slide
84
-		echo $first;
83
+        // First slide
84
+        echo $first;
85 85
 
86
-		// Previous slide
87
-		if ($slide > 0) {
88
-			echo '<a href="slideshow.php?slide_id='.$previous_slide.'&curdirpath='.$pathurl.'">';
89
-		}
86
+        // Previous slide
87
+        if ($slide > 0) {
88
+            echo '<a href="slideshow.php?slide_id='.$previous_slide.'&curdirpath='.$pathurl.'">';
89
+        }
90 90
 
91 91
         echo Display::return_icon($imgp, get_lang('Previous'));
92
-		if ($slide > 0) {
93
-			echo '</a>';
94
-		}
95
-
96
-		// Divider
97
-		echo ' [ '.$next_slide.'/'.$total_slides.' ] ';
98
-
99
-		// Next slide
100
-		if ($slide < $total_slides - 1) {
101
-			echo '<a href="slideshow.php?slide_id='.$next_slide.'&curdirpath='.$pathurl.'">';
102
-		}
103
-		if ($slide == $total_slides - 1) {
104
-			$imgn = 'action_next_na.png';
92
+        if ($slide > 0) {
93
+            echo '</a>';
94
+        }
95
+
96
+        // Divider
97
+        echo ' [ '.$next_slide.'/'.$total_slides.' ] ';
98
+
99
+        // Next slide
100
+        if ($slide < $total_slides - 1) {
101
+            echo '<a href="slideshow.php?slide_id='.$next_slide.'&curdirpath='.$pathurl.'">';
102
+        }
103
+        if ($slide == $total_slides - 1) {
104
+            $imgn = 'action_next_na.png';
105 105
             $last = Display::return_icon('action_last_na.png', get_lang('LastSlide'));
106
-		} else {
107
-			$imgn = 'action_next.png';
108
-			$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'">
106
+        } else {
107
+            $imgn = 'action_next.png';
108
+            $last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'">
109 109
 			        '.Display::return_icon('action_last.png', get_lang('LastSlide')).'
110 110
                 </a>';
111
-		}
111
+        }
112 112
         echo Display::return_icon($imgn, get_lang('Next'));
113
-		if ($slide > 0) {
114
-			echo '</a>';
115
-		}
116
-
117
-		// Last slide
118
-		echo $last;
119
-		echo '</div>';
120
-	}
113
+        if ($slide > 0) {
114
+            echo '</a>';
115
+        }
116
+
117
+        // Last slide
118
+        echo $last;
119
+        echo '</div>';
120
+    }
121 121
 }
122 122
 
123 123
 // Exit the slideshow
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
 
127 127
 // Show thumbnails
128 128
 if ($slide_id != 'all') {
129
-	echo '<a href="slideshow.php?slide_id=all&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
129
+    echo '<a href="slideshow.php?slide_id=all&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
130 130
         Display::return_icon('thumbnails.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM).'</a>';
131 131
 } else {
132
-	echo Display::return_icon('thumbnails_na.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM);
132
+    echo Display::return_icon('thumbnails_na.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM);
133 133
 }
134 134
 // Slideshow options
135 135
 echo '<a href="slideshowoptions.php?curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
@@ -142,24 +142,24 @@  discard block
 block discarded – undo
142 142
 
143 143
 // If we come from slideshowoptions.php we sessionize (new word !!! ;-) the options
144 144
 if (isset($_POST['Submit'])) {
145
-	// We come from slideshowoptions.php
146
-	//$_SESSION["auto_image_resizing"]=Security::remove_XSS($_POST['auto_radio_resizing']);
147
-	$_SESSION["image_resizing"] = Security::remove_XSS($_POST['radio_resizing']);
148
-	if ($_POST['radio_resizing'] == "resizing" && $_POST['width'] != '' && $_POST['height'] != '') {
149
-		//echo "resizing";
150
-		$_SESSION["image_resizing_width"] = Security::remove_XSS($_POST['width']);
151
-		$_SESSION["image_resizing_height"] = Security::remove_XSS($_POST['height']);
152
-	} else {
153
-		//echo "unsetting the session heighte and width";
154
-		$_SESSION["image_resizing_width"] = null;
155
-		$_SESSION["image_resizing_height"] = null;
156
-	}
145
+    // We come from slideshowoptions.php
146
+    //$_SESSION["auto_image_resizing"]=Security::remove_XSS($_POST['auto_radio_resizing']);
147
+    $_SESSION["image_resizing"] = Security::remove_XSS($_POST['radio_resizing']);
148
+    if ($_POST['radio_resizing'] == "resizing" && $_POST['width'] != '' && $_POST['height'] != '') {
149
+        //echo "resizing";
150
+        $_SESSION["image_resizing_width"] = Security::remove_XSS($_POST['width']);
151
+        $_SESSION["image_resizing_height"] = Security::remove_XSS($_POST['height']);
152
+    } else {
153
+        //echo "unsetting the session heighte and width";
154
+        $_SESSION["image_resizing_width"] = null;
155
+        $_SESSION["image_resizing_height"] = null;
156
+    }
157 157
 }
158 158
 $target_width = $target_height = null;
159 159
 // The target height and width depends if we choose resizing or no resizing
160 160
 if (isset($_SESSION["image_resizing"]) &&  $_SESSION["image_resizing"] == "resizing") {
161
-	$target_width = $_SESSION["image_resizing_width"];
162
-	$target_height = $_SESSION["image_resizing_height"];
161
+    $target_width = $_SESSION["image_resizing_width"];
162
+    $target_height = $_SESSION["image_resizing_height"];
163 163
 }
164 164
 
165 165
 /*	THUMBNAIL VIEW */
@@ -169,59 +169,59 @@  discard block
 block discarded – undo
169 169
 $html = '';
170 170
 if ($slide_id == 'all') {
171 171
 
172
-	// Config for make thumbnails
172
+    // Config for make thumbnails
173 173
     $allowed_thumbnail_types = array('jpg', 'jpeg', 'gif', 'png');
174
-	$max_thumbnail_width     = 250;
175
-	$max_thumbnail_height    = 250;
176
-	$png_compression	     = 0;//0(none)-9
177
-	$jpg_quality  	         = 75;//from 0 to 100 (default is 75). More quality less compression
174
+    $max_thumbnail_width     = 250;
175
+    $max_thumbnail_height    = 250;
176
+    $png_compression	     = 0;//0(none)-9
177
+    $jpg_quality  	         = 75;//from 0 to 100 (default is 75). More quality less compression
178 178
 
179
-	$directory_thumbnails = $sys_course_path.$_course['path'].'/document'.$folder.'.thumbs/';
179
+    $directory_thumbnails = $sys_course_path.$_course['path'].'/document'.$folder.'.thumbs/';
180 180
 
181
-	//Other parameters only for show tumbnails
182
-	$row_items 			     = 4;//only in slideshow.php
183
-	$number_image 			 = 7;//num icons cols to show
184
-	$thumbnail_width_frame=$max_thumbnail_width;//optional $max_thumbnail_width+x
185
-	$thumbnail_height_frame=$max_thumbnail_height;
181
+    //Other parameters only for show tumbnails
182
+    $row_items 			     = 4;//only in slideshow.php
183
+    $number_image 			 = 7;//num icons cols to show
184
+    $thumbnail_width_frame=$max_thumbnail_width;//optional $max_thumbnail_width+x
185
+    $thumbnail_height_frame=$max_thumbnail_height;
186 186
 
187
-	// Create the template_thumbnails folder (if no exist)
187
+    // Create the template_thumbnails folder (if no exist)
188 188
 
189
-	if (!file_exists($directory_thumbnails)) {
190
-		@mkdir($directory_thumbnails, api_get_permissions_for_new_directories());
189
+    if (!file_exists($directory_thumbnails)) {
190
+        @mkdir($directory_thumbnails, api_get_permissions_for_new_directories());
191 191
     }
192 192
 
193
-	// check files and thumbnails
194
-	if (is_array($image_files_only)) {
193
+    // check files and thumbnails
194
+    if (is_array($image_files_only)) {
195 195
 
196
-		foreach ($image_files_only as $one_image_file) {
197
-			$image = $sys_course_path.$_course['path'].'/document'.$folder.$one_image_file;
198
-			$image_thumbnail= $directory_thumbnails.'.'.$one_image_file;
196
+        foreach ($image_files_only as $one_image_file) {
197
+            $image = $sys_course_path.$_course['path'].'/document'.$folder.$one_image_file;
198
+            $image_thumbnail= $directory_thumbnails.'.'.$one_image_file;
199 199
 
200
-			if (file_exists($image)) {
201
-				//check thumbnail
202
-				$imagetype = explode(".", $image);
200
+            if (file_exists($image)) {
201
+                //check thumbnail
202
+                $imagetype = explode(".", $image);
203 203
                 //or check $imagetype = image_type_to_extension(exif_imagetype($image), false);
204
-				$imagetype = strtolower($imagetype[count($imagetype)-1]);
204
+                $imagetype = strtolower($imagetype[count($imagetype)-1]);
205 205
 
206
-				if(in_array($imagetype,$allowed_thumbnail_types)) {
207
-					if (!file_exists($image_thumbnail)){
206
+                if(in_array($imagetype,$allowed_thumbnail_types)) {
207
+                    if (!file_exists($image_thumbnail)){
208 208
                         //run each once we view thumbnails is too heavy, then need move into  !file_exists($image_thumbnail, and only run when haven't the thumbnail
209
-						$original_image_size = api_getimagesize($image);
210
-
211
-						switch($imagetype) {
212
-							case 'gif':
213
-								$source_img = imagecreatefromgif($image);
214
-								break;
215
-							case 'jpg':
216
-								$source_img = imagecreatefromjpeg($image);
217
-								break;
218
-							case 'jpeg':
219
-								$source_img = imagecreatefromjpeg($image);
220
-								break;
221
-							case 'png':
222
-								$source_img = imagecreatefrompng($image);
223
-								break;
224
-						}
209
+                        $original_image_size = api_getimagesize($image);
210
+
211
+                        switch($imagetype) {
212
+                            case 'gif':
213
+                                $source_img = imagecreatefromgif($image);
214
+                                break;
215
+                            case 'jpg':
216
+                                $source_img = imagecreatefromjpeg($image);
217
+                                break;
218
+                            case 'jpeg':
219
+                                $source_img = imagecreatefromjpeg($image);
220
+                                break;
221
+                            case 'png':
222
+                                $source_img = imagecreatefrompng($image);
223
+                                break;
224
+                        }
225 225
 
226 226
                         $new_thumbnail_size = api_calculate_image_size(
227 227
                             $original_image_size['width'],
@@ -230,33 +230,33 @@  discard block
 block discarded – undo
230 230
                             $max_thumbnail_height
231 231
                         );
232 232
 
233
-						if($max_thumbnail_width>$original_image_size['width'] && $max_thumbnail_height>$original_image_size['height']){
234
-							$new_thumbnail_size['width']=$original_image_size['width'];
235
-							$new_thumbnail_size['height']=$original_image_size['height'];
236
-						}
233
+                        if($max_thumbnail_width>$original_image_size['width'] && $max_thumbnail_height>$original_image_size['height']){
234
+                            $new_thumbnail_size['width']=$original_image_size['width'];
235
+                            $new_thumbnail_size['height']=$original_image_size['height'];
236
+                        }
237 237
 
238
-						$crop = imagecreatetruecolor($new_thumbnail_size['width'], $new_thumbnail_size['height']);
238
+                        $crop = imagecreatetruecolor($new_thumbnail_size['width'], $new_thumbnail_size['height']);
239 239
 
240
-						// preserve transparency
241
-						if($imagetype == "png"){
242
-							imagesavealpha($crop, true);
243
-							$color = imagecolorallocatealpha($crop,0x00,0x00,0x00,127);
244
-							imagefill($crop, 0, 0, $color);
245
-						}
240
+                        // preserve transparency
241
+                        if($imagetype == "png"){
242
+                            imagesavealpha($crop, true);
243
+                            $color = imagecolorallocatealpha($crop,0x00,0x00,0x00,127);
244
+                            imagefill($crop, 0, 0, $color);
245
+                        }
246 246
 
247
-						if ($imagetype == "gif") {
248
-							$transindex = imagecolortransparent($source_img);
247
+                        if ($imagetype == "gif") {
248
+                            $transindex = imagecolortransparent($source_img);
249 249
                             $palletsize = imagecolorstotal($source_img);
250
-							 //GIF89a for transparent and anim (first clip), either GIF87a
251
-							 if ($transindex >= 0 && $transindex < $palletsize){
252
-								 $transcol = imagecolorsforindex($source_img, $transindex);
253
-								 $transindex = imagecolorallocatealpha($crop, $transcol['red'], $transcol['green'], $transcol['blue'], 127);
254
-								 imagefill($crop, 0, 0, $transindex);
255
-								 imagecolortransparent($crop, $transindex);
256
-							 }
257
-						}
258
-
259
-						//resampled image
250
+                                //GIF89a for transparent and anim (first clip), either GIF87a
251
+                                if ($transindex >= 0 && $transindex < $palletsize){
252
+                                    $transcol = imagecolorsforindex($source_img, $transindex);
253
+                                    $transindex = imagecolorallocatealpha($crop, $transcol['red'], $transcol['green'], $transcol['blue'], 127);
254
+                                    imagefill($crop, 0, 0, $transindex);
255
+                                    imagecolortransparent($crop, $transindex);
256
+                                }
257
+                        }
258
+
259
+                        //resampled image
260 260
                         imagecopyresampled(
261 261
                             $crop,
262 262
                             $source_img,
@@ -270,69 +270,69 @@  discard block
 block discarded – undo
270 270
                             $original_image_size['height']
271 271
                         );
272 272
 
273
-						switch ($imagetype) {
274
-							case 'gif':
275
-								imagegif($crop,$image_thumbnail);
276
-								break;
277
-							case 'jpg':
278
-								imagejpeg($crop,$image_thumbnail,$jpg_quality);
279
-								break;
280
-							case 'jpeg':
281
-								imagejpeg($crop,$image_thumbnail,$jpg_quality);
282
-								break;
283
-							case 'png':
284
-								imagepng($crop,$image_thumbnail,$png_compression);
285
-								break;
286
-						}
287
-
288
-						//clean memory
289
-						imagedestroy($crop);
290
-					}//end !exist thumbnail
291
-
292
-					//show thumbnail and link
293
-
294
-					$one_image_thumbnail_file='.thumbs/.'.$one_image_file;//get path thumbnail
295
-					$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_thumbnail_file : $path.$one_image_thumbnail_file;
296
-					$image_tag[] = '<img class="img-gallery" src="download.php?doc_url='.$doc_url.'" border="0" title="'.$one_image_file.'">';
297
-				} else {
298
-					//if images aren't support by gd (not gif, jpg, jpeg, png)
299
-					if ($imagetype=="bmp") {
273
+                        switch ($imagetype) {
274
+                            case 'gif':
275
+                                imagegif($crop,$image_thumbnail);
276
+                                break;
277
+                            case 'jpg':
278
+                                imagejpeg($crop,$image_thumbnail,$jpg_quality);
279
+                                break;
280
+                            case 'jpeg':
281
+                                imagejpeg($crop,$image_thumbnail,$jpg_quality);
282
+                                break;
283
+                            case 'png':
284
+                                imagepng($crop,$image_thumbnail,$png_compression);
285
+                                break;
286
+                        }
287
+
288
+                        //clean memory
289
+                        imagedestroy($crop);
290
+                    }//end !exist thumbnail
291
+
292
+                    //show thumbnail and link
293
+
294
+                    $one_image_thumbnail_file='.thumbs/.'.$one_image_file;//get path thumbnail
295
+                    $doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_thumbnail_file : $path.$one_image_thumbnail_file;
296
+                    $image_tag[] = '<img class="img-gallery" src="download.php?doc_url='.$doc_url.'" border="0" title="'.$one_image_file.'">';
297
+                } else {
298
+                    //if images aren't support by gd (not gif, jpg, jpeg, png)
299
+                    if ($imagetype=="bmp") {
300 300
                         // use getimagesize instead api_getimagesize($image); becasuse api_getimagesize doesn't support bmp files. Put here for each show, only for a few bmp files isn't heavy
301
-						$original_image_size = getimagesize($image);
302
-						if ($max_thumbnail_width<$original_image_size[0] || $max_thumbnail_height<$original_image_size[1]){
303
-							$thumbnail_size=api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height);//don't use resize_image because doesn't run with bmp files
304
-							$image_height = $thumbnail_size['height'];
305
-							$image_width  = $thumbnail_size['width'];
306
-						} else {
307
-							$image_height=$original_image_size[0];
308
-							$image_width=$original_image_size[1];
309
-						}
310
-					} else {
311
-						//example for svg files,...
312
-						$image_width=$max_thumbnail_width;
313
-						$image_height=$max_thumbnail_height;
314
-					}
315
-
316
-					$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_file : $path.$one_image_file;
317
-					$image_tag[] = '<img src="download.php?doc_url='.$doc_url.'" border="0" width="'.$image_width.'" height="'.$image_height.'" title="'.$one_image_file.'">';
318
-
319
-				}//end allowed image types
320
-			}//end if exist file image
321
-		}//end foreach
322
-	}//end image files only
323
-
324
-	// Creating the table
325
-	$html_table = '';
326
-
327
-	$i = 0;
328
-	$count_image = count($image_tag);
329
-	$number_iteration = ceil($count_image/$number_image);
330
-	$p = 0;
301
+                        $original_image_size = getimagesize($image);
302
+                        if ($max_thumbnail_width<$original_image_size[0] || $max_thumbnail_height<$original_image_size[1]){
303
+                            $thumbnail_size=api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height);//don't use resize_image because doesn't run with bmp files
304
+                            $image_height = $thumbnail_size['height'];
305
+                            $image_width  = $thumbnail_size['width'];
306
+                        } else {
307
+                            $image_height=$original_image_size[0];
308
+                            $image_width=$original_image_size[1];
309
+                        }
310
+                    } else {
311
+                        //example for svg files,...
312
+                        $image_width=$max_thumbnail_width;
313
+                        $image_height=$max_thumbnail_height;
314
+                    }
315
+
316
+                    $doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_file : $path.$one_image_file;
317
+                    $image_tag[] = '<img src="download.php?doc_url='.$doc_url.'" border="0" width="'.$image_width.'" height="'.$image_height.'" title="'.$one_image_file.'">';
318
+
319
+                }//end allowed image types
320
+            }//end if exist file image
321
+        }//end foreach
322
+    }//end image files only
323
+
324
+    // Creating the table
325
+    $html_table = '';
326
+
327
+    $i = 0;
328
+    $count_image = count($image_tag);
329
+    $number_iteration = ceil($count_image/$number_image);
330
+    $p = 0;
331 331
     $html = '';
332 332
     $html .= '<div class="gallery">';
333
-	for ($k = 0; $k < $number_iteration; $k++) {
334
-		for ($i = 0; $i < $number_image; $i++) {
335
-			if (isset($image_tag[$p])) {
333
+    for ($k = 0; $k < $number_iteration; $k++) {
334
+        for ($i = 0; $i < $number_image; $i++) {
335
+            if (isset($image_tag[$p])) {
336 336
                             $html .= '<div class="col-xs-6 col-sm-3 col-md-2">';
337 337
                             $html .= '<div class="canvas-one">';
338 338
                             $html .= '<a class="canvas-two" href="slideshow.php?slide_id='.$p.'&curdirpath='.$pathurl.'">';
@@ -344,10 +344,10 @@  discard block
 block discarded – undo
344 344
                             $html .= '</a>';
345 345
                             $html .= '</div>';
346 346
                             $html .= '</div>';
347
-			}
348
-			$p++;
349
-		}
350
-	}
347
+            }
348
+            $p++;
349
+        }
350
+    }
351 351
     $html .= '</div>';
352 352
 
353 353
 }//end slide==all
@@ -358,43 +358,43 @@  discard block
 block discarded – undo
358 358
 // This is for viewing all the images in the slideshow one at a time.
359 359
 
360 360
 if ($slide_id != 'all' && !empty($image_files_only)) {
361
-	if (file_exists($image) && is_file($image)) {
362
-		$image_height_width = resize_image($image, $target_width, $target_height);
363
-
364
-		$image_height = $image_height_width[0];
365
-		$image_width = $image_height_width[1];
366
-
367
-		$height_width_tags = null;
368
-		if (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] == 'resizing') {
369
-			$height_width_tags = 'width="'.$image_width.'" height="'.$image_height.'"';
370
-		}
371
-
372
-		// This is done really quickly and should be cleaned up a little bit using the API functions
373
-		$tbl_documents = Database::get_course_table(TABLE_DOCUMENT);
374
-		if ($path == '/') {
375
-			$pathpart = '/';
376
-		} else {
377
-			$pathpart = $path.'/';
378
-		}
379
-		$sql = "SELECT * FROM $tbl_documents
361
+    if (file_exists($image) && is_file($image)) {
362
+        $image_height_width = resize_image($image, $target_width, $target_height);
363
+
364
+        $image_height = $image_height_width[0];
365
+        $image_width = $image_height_width[1];
366
+
367
+        $height_width_tags = null;
368
+        if (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] == 'resizing') {
369
+            $height_width_tags = 'width="'.$image_width.'" height="'.$image_height.'"';
370
+        }
371
+
372
+        // This is done really quickly and should be cleaned up a little bit using the API functions
373
+        $tbl_documents = Database::get_course_table(TABLE_DOCUMENT);
374
+        if ($path == '/') {
375
+            $pathpart = '/';
376
+        } else {
377
+            $pathpart = $path.'/';
378
+        }
379
+        $sql = "SELECT * FROM $tbl_documents
380 380
 		        WHERE c_id = $course_id AND path='".Database::escape_string($pathpart.$image_files_only[$slide])."'";
381
-		$result = Database::query($sql);
382
-		$row = Database::fetch_array($result);
381
+        $result = Database::query($sql);
382
+        $row = Database::fetch_array($result);
383 383
 
384 384
         echo '<div class="thumbnail">';
385
-		if ($slide < $total_slides - 1 && $slide_id != 'all') {
386
-			echo "<a href='slideshow.php?slide_id=".$next_slide."&curdirpath=$pathurl'>";
387
-		} else {
388
-			echo "<a href='slideshow.php?slide_id=0&curdirpath=$pathurl'>";
389
-		}
385
+        if ($slide < $total_slides - 1 && $slide_id != 'all') {
386
+            echo "<a href='slideshow.php?slide_id=".$next_slide."&curdirpath=$pathurl'>";
387
+        } else {
388
+            echo "<a href='slideshow.php?slide_id=0&curdirpath=$pathurl'>";
389
+        }
390 390
         if ($path == '/') {
391
-        	$path = '';
391
+            $path = '';
392 392
         }
393 393
 
394
-		list($width, $height) = getimagesize($image);
395
-		// Auto resize
396
-		if (isset($_SESSION["image_resizing"]) &&  $_SESSION["image_resizing"] == 'resizing') {
397
-		?>
394
+        list($width, $height) = getimagesize($image);
395
+        // Auto resize
396
+        if (isset($_SESSION["image_resizing"]) &&  $_SESSION["image_resizing"] == 'resizing') {
397
+        ?>
398 398
 
399 399
 		<script type="text/javascript">
400 400
 			var initial_width='<?php echo $width; ?>';
@@ -447,21 +447,21 @@  discard block
 block discarded – undo
447 447
 
448 448
 		</script>
449 449
     <?php
450
-		} else {
451
-			echo "<img class=\"img-responsive\" src='download.php?doc_url=$path/".$image_files_only[$slide]."' alt='".$image_files_only[$slide]."' border='0'".$height_width_tags.">";
452
-		}
450
+        } else {
451
+            echo "<img class=\"img-responsive\" src='download.php?doc_url=$path/".$image_files_only[$slide]."' alt='".$image_files_only[$slide]."' border='0'".$height_width_tags.">";
452
+        }
453 453
 
454
-		echo '</a>';
454
+        echo '</a>';
455 455
         echo '<div class="caption text-center">';
456 456
         echo Display::tag('h3', $row['title']);
457 457
         echo '<p>' . $row['comment'] . '</p>';
458 458
         echo '</div>';
459 459
         echo '</div>';
460 460
 
461
-		if (api_is_allowed_to_edit(null, true)) {
461
+        if (api_is_allowed_to_edit(null, true)) {
462 462
             echo '<ul class="list-unstyled">';
463
-			$aux = explode('.', htmlspecialchars($image_files_only[$slide]));
464
-			$ext = $aux[count($aux) - 1];
463
+            $aux = explode('.', htmlspecialchars($image_files_only[$slide]));
464
+            $ext = $aux[count($aux) - 1];
465 465
 
466 466
             if (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] == 'resizing') {
467 467
                 $resize_info = get_lang('Resizing').'<br />';
@@ -473,8 +473,8 @@  discard block
 block discarded – undo
473 473
                 $resize_height = get_lang('Auto');
474 474
             } else {
475 475
                 $resize_info = get_lang('NoResizing').'<br />';
476
-				$resize_width = '';
477
-				$resize_height = '';
476
+                $resize_width = '';
477
+                $resize_height = '';
478 478
             }
479 479
 
480 480
             echo '<li class="text-center">';
@@ -494,16 +494,16 @@  discard block
 block discarded – undo
494 494
             );
495 495
             echo '</li>';
496 496
             echo '<li class="text-center">' . $width.' x '.$height . '</li>';
497
-			echo '<li class="text-center">' . round((filesize($image) / 1024), 2) . ' KB - ' . $ext . '</li>';
497
+            echo '<li class="text-center">' . round((filesize($image) / 1024), 2) . ' KB - ' . $ext . '</li>';
498 498
             echo '<li class="text-center">' . $resize_info . '</li>';
499
-			echo '<li class="text-center">' . $resize_width . '</li>';
500
-			echo '<li class="text-center">' . $resize_height . '</li>';
499
+            echo '<li class="text-center">' . $resize_width . '</li>';
500
+            echo '<li class="text-center">' . $resize_height . '</li>';
501 501
             echo '</ul>';
502
-		}
502
+        }
503 503
 
504
-	} else {
505
-		Display::display_warning_message(get_lang('FileNotFound'));
506
-	}
504
+    } else {
505
+        Display::display_warning_message(get_lang('FileNotFound'));
506
+    }
507 507
 } else {
508 508
     if ($slide_id != 'all') {
509 509
         Display::display_warning_message(get_lang('NoDataAvailable'));
Please login to merge, or discard this patch.
main/reports/templates/exercicesMultiCourses.reports.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $reports_template['exercicesMultiCourses'] = array(
4
-	'description' => 'Result of each test per student',
5
-	'getSQL' => 'reports_template_exercicesMultiCourses_getSQL',
6
-	'wizard' =>
4
+    'description' => 'Result of each test per student',
5
+    'getSQL' => 'reports_template_exercicesMultiCourses_getSQL',
6
+    'wizard' =>
7 7
 '
8 8
 <span id="exercicesMultiCourses" class="step">
9 9
 	<span class="font_normal_07em_black">Result of each test per student</span><br />
@@ -32,39 +32,39 @@  discard block
 block discarded – undo
32 32
 ');
33 33
 
34 34
 function reports_template_exercicesMultiCourses_getSQL() {
35
-	// foreach quiz
36
-	$result = array();
37
-	$columns = Database::query('select r.id as kid, c.title as course, '.
38
-		'r.child_name as test from '.
39
-		Database::get_main_table(TABLE_MAIN_REPORTS_KEYS).' r, '.
40
-		Database::get_main_table(TABLE_MAIN_COURSE).' c '.
41
-		'where r.course_id=c.id and r.tool_id='.
42
-		reports_getToolId(TOOL_QUIZ).
43
-		' order by r.course_id, r.child_name');
44
-	if (Database::num_rows($columns) == 0)
45
-		die('<b>'.get_lang('no data found').'</b>');
46
-	$query = 'select u.lastname Name, u.firstname Firstname';
47
-	$columns = Database::store_result($columns);
48
-	if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max')
49
-		$function = $_REQUEST['tattempt'];
50
-	else
51
-		$function = 'avg';
52
-	foreach ($columns as $key => $column)
53
-		$query .= ', '.$function.'(k'.$key.'.score) as `'.
54
-				$column['course'].' - '.
55
-				$column['test'].'` ';
56
-	$query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
57
-	foreach ($columns as $key => $column) // fixme sessions
58
-		$query .= 'left outer join '.
59
-			Database::get_main_table(TABLE_MAIN_REPORTS_VALUES).
60
-			' k'.$key.
61
-			' on k'.$key.'.key_id = '.$column['kid'].
62
-				' and k'.$key.'.user_id = u.user_id ';
63
-	$query .= ' group by ';
64
-	foreach ($columns as $key => $column) // grouping attempt
65
-		$query .= 'k'.$key.'.attempt, ';
66
-	$query = substr($query, 0, -2); // removing last ', ';
35
+    // foreach quiz
36
+    $result = array();
37
+    $columns = Database::query('select r.id as kid, c.title as course, '.
38
+        'r.child_name as test from '.
39
+        Database::get_main_table(TABLE_MAIN_REPORTS_KEYS).' r, '.
40
+        Database::get_main_table(TABLE_MAIN_COURSE).' c '.
41
+        'where r.course_id=c.id and r.tool_id='.
42
+        reports_getToolId(TOOL_QUIZ).
43
+        ' order by r.course_id, r.child_name');
44
+    if (Database::num_rows($columns) == 0)
45
+        die('<b>'.get_lang('no data found').'</b>');
46
+    $query = 'select u.lastname Name, u.firstname Firstname';
47
+    $columns = Database::store_result($columns);
48
+    if ($_REQUEST['tattempt'] == 'min' || $_REQUEST['tattempt'] == 'max')
49
+        $function = $_REQUEST['tattempt'];
50
+    else
51
+        $function = 'avg';
52
+    foreach ($columns as $key => $column)
53
+        $query .= ', '.$function.'(k'.$key.'.score) as `'.
54
+                $column['course'].' - '.
55
+                $column['test'].'` ';
56
+    $query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
57
+    foreach ($columns as $key => $column) // fixme sessions
58
+        $query .= 'left outer join '.
59
+            Database::get_main_table(TABLE_MAIN_REPORTS_VALUES).
60
+            ' k'.$key.
61
+            ' on k'.$key.'.key_id = '.$column['kid'].
62
+                ' and k'.$key.'.user_id = u.user_id ';
63
+    $query .= ' group by ';
64
+    foreach ($columns as $key => $column) // grouping attempt
65
+        $query .= 'k'.$key.'.attempt, ';
66
+    $query = substr($query, 0, -2); // removing last ', ';
67 67
 
68 68
 
69
-	return $query;
69
+    return $query;
70 70
 }
Please login to merge, or discard this patch.
main/session/session_add.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -31,27 +31,27 @@  discard block
 block discarded – undo
31 31
 function search_coachs($needle)
32 32
 {
33 33
     $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
34
-	$xajax_response = new xajaxResponse();
35
-	$return = '';
34
+    $xajax_response = new xajaxResponse();
35
+    $return = '';
36 36
 
37
-	if (!empty($needle)) {
38
-		$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
37
+    if (!empty($needle)) {
38
+        $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
39 39
 
40
-		// search users where username or firstname or lastname begins likes $needle
41
-		$sql = 'SELECT username, lastname, firstname
40
+        // search users where username or firstname or lastname begins likes $needle
41
+        $sql = 'SELECT username, lastname, firstname
42 42
 		        FROM '.$tbl_user.' user
43 43
 				WHERE (username LIKE "'.$needle.'%"
44 44
 				OR firstname LIKE "'.$needle.'%"
45 45
 				OR lastname LIKE "'.$needle.'%")
46 46
 				AND status=1'.
47
-				$order_clause.
48
-				' LIMIT 10';
49
-
50
-		if (api_is_multiple_url_enabled()) {
51
-			$tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
52
-			$access_url_id = api_get_current_access_url_id();
53
-			if ($access_url_id != -1) {
54
-				$sql = 'SELECT username, lastname, firstname
47
+                $order_clause.
48
+                ' LIMIT 10';
49
+
50
+        if (api_is_multiple_url_enabled()) {
51
+            $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
52
+            $access_url_id = api_get_current_access_url_id();
53
+            if ($access_url_id != -1) {
54
+                $sql = 'SELECT username, lastname, firstname
55 55
                         FROM '.$tbl_user.' user
56 56
                         INNER JOIN '.$tbl_user_rel_access_url.' url_user
57 57
                         ON (url_user.user_id=user.user_id)
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
                             AND status=1'.
66 66
                         $order_clause.'
67 67
                         LIMIT 10';
68
-			}
69
-		}
70
-
71
-		$rs = Database::query($sql);
72
-		while ($user = Database :: fetch_array($rs)) {
73
-			$return .= '<a href="javascript: void(0);" onclick="javascript: fill_coach_field(\''.$user['username'].'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />';
74
-		}
75
-	}
76
-	$xajax_response -> addAssign('ajax_list_coachs','innerHTML', api_utf8_encode($return));
77
-	return $xajax_response;
68
+            }
69
+        }
70
+
71
+        $rs = Database::query($sql);
72
+        while ($user = Database :: fetch_array($rs)) {
73
+            $return .= '<a href="javascript: void(0);" onclick="javascript: fill_coach_field(\''.$user['username'].'\')">'.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')</a><br />';
74
+        }
75
+    }
76
+    $xajax_response -> addAssign('ajax_list_coachs','innerHTML', api_utf8_encode($return));
77
+    return $xajax_response;
78 78
 }
79 79
 $xajax -> processRequests();
80 80
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 </script>";
118 118
 
119 119
 if (isset($_POST['formSent']) && $_POST['formSent']) {
120
-	$formSent = 1;
120
+    $formSent = 1;
121 121
 }
122 122
 
123 123
 $tool_name = get_lang('AddSession');
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 Display::display_header($tool_name);
210 210
 
211 211
 if (!empty($return)) {
212
-	Display::display_error_message($return, false);
212
+    Display::display_error_message($return, false);
213 213
 }
214 214
 
215 215
 echo '<div class="actions">';
Please login to merge, or discard this patch.