@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $digest = getDigest(); |
13 | 13 | |
14 | 14 | // If there was no digest, show login |
15 | -if (is_null($digest)) requireLogin($realm,$nonce); |
|
15 | +if (is_null($digest)) requireLogin($realm, $nonce); |
|
16 | 16 | |
17 | 17 | $digestParts = digestParse($digest); |
18 | 18 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $validResponse = md5("{$A1}:{$digestParts['nonce']}:{$digestParts['nc']}:{$digestParts['cnonce']}:{$digestParts['qop']}:{$A2}"); |
27 | 27 | |
28 | 28 | if ($digestParts['response'] != $validResponse) |
29 | - requireLogin($realm,$nonce); |
|
29 | + requireLogin($realm, $nonce); |
|
30 | 30 | else { |
31 | 31 | // We're in! |
32 | 32 | echo 'a7532ae474e5e66a0c16eddab02e02a7'; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | // most other servers |
43 | 43 | } |
44 | 44 | elseif (isset($_SERVER['HTTP_AUTHENTICATION'])) { |
45 | - if (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']),'digest')===0) |
|
45 | + if (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']), 'digest') === 0) |
|
46 | 46 | $digest = substr($_SERVER['HTTP_AUTHORIZATION'], 7); |
47 | 47 | } |
48 | 48 | elseif (isset($_SERVER['HTTP_WWW_AUTHENTICATE'])) { |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | // This function forces a login prompt |
56 | -function requireLogin($realm,$nonce) { |
|
57 | - header('WWW-Authenticate: Digest realm="' . $realm . '",qop="auth",nonce="' . $nonce . '",opaque="' . md5($realm) . '"'); |
|
56 | +function requireLogin($realm, $nonce) { |
|
57 | + header('WWW-Authenticate: Digest realm="'.$realm.'",qop="auth",nonce="'.$nonce.'",opaque="'.md5($realm).'"'); |
|
58 | 58 | header('HTTP/1.1 401'); |
59 | 59 | echo 'Authentication Canceled'; |
60 | 60 | die(); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param WSErrorHandler Error handler |
45 | 45 | */ |
46 | 46 | public static function setErrorHandler($handler) { |
47 | - if($handler instanceof WSErrorHandler) { |
|
47 | + if ($handler instanceof WSErrorHandler) { |
|
48 | 48 | self::$_handler = $handler; |
49 | 49 | } |
50 | 50 | } |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | // if we are behind a reverse proxy, assume it will send the |
110 | 110 | // HTTP_X_FORWARDED_FOR header and use this IP instead |
111 | 111 | if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
112 | - list($ip1,$ip2) = split(',',$_SERVER['HTTP_X_FORWARDED_FOR']); |
|
112 | + list($ip1, $ip2) = split(',', $_SERVER['HTTP_X_FORWARDED_FOR']); |
|
113 | 113 | $ip = trim($ip1); |
114 | 114 | } |
115 | 115 | $security_key = $ip.$this->_configuration['security_key']; |
116 | 116 | |
117 | - if(!api_is_valid_secret_key($secret_key, $security_key)) { |
|
117 | + if (!api_is_valid_secret_key($secret_key, $security_key)) { |
|
118 | 118 | return new WSCMError(1, "API key is invalid"); |
119 | 119 | } else { |
120 | 120 | return null; |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | // Check the user's password |
150 | 150 | if ($password == $uData['password'] AND (trim($login) == $uData['username'])) { |
151 | 151 | // Check if the account is active (not locked) |
152 | - if ($uData['active']=='1') { |
|
152 | + if ($uData['active'] == '1') { |
|
153 | 153 | // Check if the expiration date has not been reached |
154 | - if ($uData['expiration_date']>date('Y-m-d H:i:s') OR $uData['expiration_date']=='0000-00-00 00:00:00') { |
|
154 | + if ($uData['expiration_date'] > date('Y-m-d H:i:s') OR $uData['expiration_date'] == '0000-00-00 00:00:00') { |
|
155 | 155 | return "valid"; |
156 | 156 | } |
157 | 157 | else |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | * @return mixed System user id if the user was found, WSError otherwise |
189 | 189 | */ |
190 | 190 | protected function getUserId($user_id_field_name, $user_id_value) { |
191 | - if($user_id_field_name == "chamilo_user_id") { |
|
192 | - if(UserManager::is_user_id_valid(intval($user_id_value))) { |
|
191 | + if ($user_id_field_name == "chamilo_user_id") { |
|
192 | + if (UserManager::is_user_id_valid(intval($user_id_value))) { |
|
193 | 193 | return intval($user_id_value); |
194 | 194 | } else { |
195 | 195 | return new WSCMError(100, "User not found"); |
196 | 196 | } |
197 | 197 | } else { |
198 | 198 | $user_id = UserManager::get_user_id_from_original_id($user_id_value, $user_id_field_name); |
199 | - if($user_id == 0) { |
|
199 | + if ($user_id == 0) { |
|
200 | 200 | return new WSCMError(100, "User not found"); |
201 | 201 | } else { |
202 | 202 | return $user_id; |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | * @return mixed System course id if the course was found, WSError otherwise |
214 | 214 | */ |
215 | 215 | protected function getCourseId($course_id_field_name, $course_id_value) { |
216 | - if($course_id_field_name == "chamilo_course_id") { |
|
217 | - if(CourseManager::get_course_code_from_course_id(intval($course_id_value)) != null) { |
|
216 | + if ($course_id_field_name == "chamilo_course_id") { |
|
217 | + if (CourseManager::get_course_code_from_course_id(intval($course_id_value)) != null) { |
|
218 | 218 | return intval($course_id_value); |
219 | 219 | } else { |
220 | 220 | return new WSCMError(200, "Course not found"); |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | protected function getSessionId($session_id_field_name, $session_id_value) |
241 | 241 | { |
242 | 242 | if ($session_id_field_name == "chamilo_session_id") { |
243 | - $session = SessionManager::fetch((int)$session_id_value); |
|
244 | - if(!empty($session)) { |
|
243 | + $session = SessionManager::fetch((int) $session_id_value); |
|
244 | + if (!empty($session)) { |
|
245 | 245 | return intval($session_id_value); |
246 | 246 | } else { |
247 | 247 | return new WSCMError(300, "Session not found"); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $session_id_value, |
252 | 252 | $session_id_field_name |
253 | 253 | ); |
254 | - if($session_id == 0) { |
|
254 | + if ($session_id == 0) { |
|
255 | 255 | return new WSCMError(300, "Session not found"); |
256 | 256 | } else { |
257 | 257 | return $session_id; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | public function unreadMessage($username, $password) |
14 | 14 | { |
15 | - if($this->verifyUserPass($username, $password) == "valid") |
|
15 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
16 | 16 | { |
17 | 17 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
18 | 18 | $user_id = UserManager::get_user_id_from_username($username); |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | |
31 | 31 | public function get_message_id($username, $password, $from, $number_of_items) |
32 | 32 | { |
33 | - if($this->verifyUserPass($username, $password) == "valid") |
|
33 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
34 | 34 | { |
35 | 35 | $user_id = UserManager::get_user_id_from_username($username); |
36 | 36 | |
37 | 37 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
38 | 38 | |
39 | - $sql_query = "SELECT id FROM $table_message " . |
|
40 | - " WHERE user_receiver_id=".$user_id." AND msg_status IN (0,1)" . |
|
39 | + $sql_query = "SELECT id FROM $table_message ". |
|
40 | + " WHERE user_receiver_id=".$user_id." AND msg_status IN (0,1)". |
|
41 | 41 | " ORDER BY send_date LIMIT $from,$number_of_items"; |
42 | 42 | |
43 | 43 | $sql_result = Database::query($sql_query); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | public function get_message_data($username, $password, $message_id, $field) |
57 | 57 | { |
58 | - if($this->verifyUserPass($username, $password) == "valid") |
|
58 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
59 | 59 | { |
60 | 60 | $htmlcode = false; |
61 | 61 | $user_id = UserManager::get_user_id_from_username($username); |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | |
86 | 86 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
87 | 87 | |
88 | - $sql_query = "SELECT ".$field_table." FROM $table_message " . |
|
88 | + $sql_query = "SELECT ".$field_table." FROM $table_message ". |
|
89 | 89 | " WHERE user_receiver_id=".$user_id." AND id=".$message_id; |
90 | 90 | |
91 | 91 | $sql_result = Database::query($sql_query); |
92 | 92 | $result = Database::fetch_row($sql_result); |
93 | 93 | return (htmlcode) ? html_entity_decode($result[0]) : $result[0]; |
94 | 94 | |
95 | - }else |
|
95 | + } else |
|
96 | 96 | return get_lang('InvalidId'); |
97 | 97 | |
98 | 98 | |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | |
101 | 101 | public function get_message_id_sent($username, $password, $from, $number_of_items) |
102 | 102 | { |
103 | - if($this->verifyUserPass($username, $password) == "valid") |
|
103 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
104 | 104 | { |
105 | 105 | $user_id = UserManager::get_user_id_from_username($username); |
106 | 106 | |
107 | 107 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
108 | 108 | |
109 | - $sql_query = "SELECT id FROM $table_message " . |
|
110 | - "WHERE user_sender_id=".$user_id." AND msg_status=".MESSAGE_STATUS_OUTBOX." " . |
|
109 | + $sql_query = "SELECT id FROM $table_message ". |
|
110 | + "WHERE user_sender_id=".$user_id." AND msg_status=".MESSAGE_STATUS_OUTBOX." ". |
|
111 | 111 | "ORDER BY send_date LIMIT $from,$number_of_items"; |
112 | 112 | |
113 | 113 | $sql_result = Database::query($sql_query); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | public function get_message_data_sent($username, $password, $id, $field) |
128 | 128 | { |
129 | - if($this->verifyUserPass($username, $password) == "valid") |
|
129 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
130 | 130 | { |
131 | 131 | $htmlcode = false; |
132 | 132 | switch ($field) |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
158 | 158 | |
159 | - $sql_query = "SELECT ".$field_table." FROM $table_message " . |
|
159 | + $sql_query = "SELECT ".$field_table." FROM $table_message ". |
|
160 | 160 | " WHERE user_sender_id=".$user_id." AND id=".$id; |
161 | 161 | |
162 | 162 | $sql_result = Database::query($sql_query); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | return (htmlcode) ? html_entity_decode($result[0]) : $result[0]; |
166 | 166 | |
167 | - }else |
|
167 | + } else |
|
168 | 168 | return get_lang('InvalidId'); |
169 | 169 | |
170 | 170 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | public function message_send($username, $password, $receiver_user_id, $subject, $content) |
174 | 174 | { |
175 | 175 | //TODO: verificar data de envio. Esta divergindo de data! |
176 | - if($this->verifyUserPass($username, $password) == "valid") |
|
176 | + if ($this->verifyUserPass($username, $password) == "valid") |
|
177 | 177 | { |
178 | 178 | $group_id = intval(0); |
179 | 179 | $parent_id = intval(0); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | |
205 | 205 | } |
206 | 206 | |
207 | - protected function set_message_as_read($user_id, $message_id){ |
|
207 | + protected function set_message_as_read($user_id, $message_id) { |
|
208 | 208 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
209 | 209 | $query = "UPDATE $table_message SET msg_status = '".MESSAGE_STATUS_NEW."' WHERE user_receiver_id=".$user_id." AND id='".$message_id."';"; |
210 | 210 | $result = Database::query($query); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | $tuserfv = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES); |
22 | 22 | $sql = "SELECT user_id, username FROM $tuser ORDER BY user_id"; |
23 | 23 | $res = Database::query($sql); |
24 | -while($row = Database::fetch_array($res)) { |
|
24 | +while ($row = Database::fetch_array($res)) { |
|
25 | 25 | $sql2 = "INSERT INTO $tuserfv (item_id, field_id, value) |
26 | 26 | VALUES (".$row['user_id'].", 11,'".$row['username']."')"; |
27 | 27 | $res2 = Database::query($sql2); |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | $event = $agenda->get_event($id); |
44 | 44 | |
45 | 45 | if (!empty($event)) { |
46 | - define('ICAL_LANG',api_get_language_isocode()); |
|
46 | + define('ICAL_LANG', api_get_language_isocode()); |
|
47 | 47 | |
48 | 48 | $ical = new vcalendar(); |
49 | - $ical->setConfig('unique_id',api_get_path(WEB_PATH)); |
|
50 | - $ical->setProperty( 'method', 'PUBLISH' ); |
|
51 | - $ical->setConfig('url',api_get_path(WEB_PATH)); |
|
49 | + $ical->setConfig('unique_id', api_get_path(WEB_PATH)); |
|
50 | + $ical->setProperty('method', 'PUBLISH'); |
|
51 | + $ical->setConfig('url', api_get_path(WEB_PATH)); |
|
52 | 52 | $vevent = new vevent(); |
53 | 53 | |
54 | - switch($_GET['class']) { |
|
54 | + switch ($_GET['class']) { |
|
55 | 55 | case 'public': |
56 | 56 | $vevent->setClass('PUBLIC'); |
57 | 57 | break; |
@@ -69,44 +69,44 @@ discard block |
||
69 | 69 | $event['start_date'] = api_get_local_time($event['start_date']); |
70 | 70 | $event['end_date'] = api_get_local_time($event['end_date']); |
71 | 71 | |
72 | - switch($type) { |
|
72 | + switch ($type) { |
|
73 | 73 | case 'personal': |
74 | 74 | case 'platform': |
75 | - $vevent->setProperty( 'summary', api_convert_encoding($event['title'],'UTF-8', $charset)); |
|
76 | - if(empty($event['start_date'])){header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER']));} |
|
77 | - list($y,$m,$d,$h,$M,$s) = preg_split('/[\s:-]/',$event['start_date']); |
|
78 | - $vevent->setProperty('dtstart',array('year'=>$y,'month'=>$m,'day'=>$d,'hour'=>$h,'min'=>$M,'sec'=>$s)); |
|
79 | - if(empty($event['end_date'])) { |
|
80 | - $y2=$y;$m2=$m;$d2=$d;$h2=$h;$M2=$M+15;$s2=$s; |
|
81 | - if($M2>60){$M2=$M2-60;$h2+=1;} |
|
75 | + $vevent->setProperty('summary', api_convert_encoding($event['title'], 'UTF-8', $charset)); |
|
76 | + if (empty($event['start_date'])) {header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER'])); } |
|
77 | + list($y, $m, $d, $h, $M, $s) = preg_split('/[\s:-]/', $event['start_date']); |
|
78 | + $vevent->setProperty('dtstart', array('year'=>$y, 'month'=>$m, 'day'=>$d, 'hour'=>$h, 'min'=>$M, 'sec'=>$s)); |
|
79 | + if (empty($event['end_date'])) { |
|
80 | + $y2 = $y; $m2 = $m; $d2 = $d; $h2 = $h; $M2 = $M + 15; $s2 = $s; |
|
81 | + if ($M2 > 60) {$M2 = $M2 - 60; $h2 += 1; } |
|
82 | 82 | } else { |
83 | - list($y2,$m2,$d2,$h2,$M2,$s2) = preg_split('/[\s:-]/',$event['end_date']); |
|
83 | + list($y2, $m2, $d2, $h2, $M2, $s2) = preg_split('/[\s:-]/', $event['end_date']); |
|
84 | 84 | } |
85 | - $vevent->setProperty('dtend',array('year'=>$y2,'month'=>$m2,'day'=>$d2,'hour'=>$h2,'min'=>$M2,'sec'=>$s2)); |
|
85 | + $vevent->setProperty('dtend', array('year'=>$y2, 'month'=>$m2, 'day'=>$d2, 'hour'=>$h2, 'min'=>$M2, 'sec'=>$s2)); |
|
86 | 86 | //$vevent->setProperty( 'LOCATION', get_lang('Unknown') ); // property name - case independent |
87 | - $vevent->setProperty( 'description', api_convert_encoding($event['description'],'UTF-8',$charset)); |
|
87 | + $vevent->setProperty('description', api_convert_encoding($event['description'], 'UTF-8', $charset)); |
|
88 | 88 | //$vevent->setProperty( 'comment', 'This is a comment' ); |
89 | 89 | //$user = api_get_user_info($event['user']); |
90 | 90 | //$vevent->setProperty('organizer',$user['mail']); |
91 | 91 | //$vevent->setProperty('attendee',$user['mail']); |
92 | 92 | //$vevent->setProperty( 'rrule', array( 'FREQ' => 'WEEKLY', 'count' => 4));// occurs also four next weeks |
93 | - $ical->setConfig('filename',$y.$m.$d.$h.$M.$s.'-'.rand(1,1000).'.ics'); |
|
94 | - $ical->setComponent ($vevent); // add event to calendar |
|
93 | + $ical->setConfig('filename', $y.$m.$d.$h.$M.$s.'-'.rand(1, 1000).'.ics'); |
|
94 | + $ical->setComponent($vevent); // add event to calendar |
|
95 | 95 | $ical->returnCalendar(); |
96 | 96 | break; |
97 | 97 | case 'course': |
98 | - $vevent->setProperty( 'summary', api_convert_encoding($event['title'],'UTF-8',$charset)); |
|
99 | - if(empty($event['start_date'])){header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER']));} |
|
100 | - list($y,$m,$d,$h,$M,$s) = preg_split('/[\s:-]/',$event['start_date']); |
|
101 | - $vevent->setProperty('dtstart',array('year'=>$y,'month'=>$m,'day'=>$d,'hour'=>$h,'min'=>$M,'sec'=>$s)); |
|
98 | + $vevent->setProperty('summary', api_convert_encoding($event['title'], 'UTF-8', $charset)); |
|
99 | + if (empty($event['start_date'])) {header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER'])); } |
|
100 | + list($y, $m, $d, $h, $M, $s) = preg_split('/[\s:-]/', $event['start_date']); |
|
101 | + $vevent->setProperty('dtstart', array('year'=>$y, 'month'=>$m, 'day'=>$d, 'hour'=>$h, 'min'=>$M, 'sec'=>$s)); |
|
102 | 102 | if (empty($event['end_date'])) { |
103 | - $y2=$y;$m2=$m;$d2=$d;$h2=$h;$M2=$M+15;$s2=$s; |
|
104 | - if($M2>60){$M2=$M2-60;$h2+=1;} |
|
103 | + $y2 = $y; $m2 = $m; $d2 = $d; $h2 = $h; $M2 = $M + 15; $s2 = $s; |
|
104 | + if ($M2 > 60) {$M2 = $M2 - 60; $h2 += 1; } |
|
105 | 105 | } else { |
106 | - list($y2,$m2,$d2,$h2,$M2,$s2) = preg_split('/[\s:-]/',$event['end_date']); |
|
106 | + list($y2, $m2, $d2, $h2, $M2, $s2) = preg_split('/[\s:-]/', $event['end_date']); |
|
107 | 107 | } |
108 | - $vevent->setProperty('dtend',array('year'=>$y2,'month'=>$m2,'day'=>$d2,'hour'=>$h2,'min'=>$M2,'sec'=>$s2)); |
|
109 | - $vevent->setProperty( 'description', api_convert_encoding($event['description'],'UTF-8',$charset)); |
|
108 | + $vevent->setProperty('dtend', array('year'=>$y2, 'month'=>$m2, 'day'=>$d2, 'hour'=>$h2, 'min'=>$M2, 'sec'=>$s2)); |
|
109 | + $vevent->setProperty('description', api_convert_encoding($event['description'], 'UTF-8', $charset)); |
|
110 | 110 | //$vevent->setProperty( 'comment', 'This is a comment' ); |
111 | 111 | //$user = api_get_user_info($event['user']); |
112 | 112 | //$vevent->setProperty('organizer',$user['mail']); |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | $vevent->setProperty('rrule',array('FREQ'=>$freq,'UNTIL'=>array('year'=>$e_y,'month'=>$e_m,'day'=>$e_d),'INTERVAL'=>'1')); |
121 | 121 | }*/ |
122 | 122 | //$vevent->setProperty( 'rrule', array( 'FREQ' => 'WEEKLY', 'count' => 4));// occurs also four next weeks |
123 | - $ical->setConfig('filename',$y.$m.$d.$h.$M.$s.'-'.rand(1,1000).'.ics'); |
|
124 | - $ical->setComponent ($vevent); // add event to calendar |
|
123 | + $ical->setConfig('filename', $y.$m.$d.$h.$M.$s.'-'.rand(1, 1000).'.ics'); |
|
124 | + $ical->setComponent($vevent); // add event to calendar |
|
125 | 125 | $ical->returnCalendar(); |
126 | 126 | break; |
127 | 127 | default: |
@@ -36,7 +36,7 @@ |
||
36 | 36 | if (isset($_REQUEST['cidReq']) && !empty($_REQUEST['cidReq'])) { |
37 | 37 | if ($_REQUEST['cidReq'] == -1) { |
38 | 38 | // When is out of the course tool (e.g My agenda) |
39 | - header('Location: ' . api_get_self()); |
|
39 | + header('Location: '.api_get_self()); |
|
40 | 40 | exit; |
41 | 41 | } else { |
42 | 42 | $type = 'course'; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | require_once '../inc/global.inc.php'; |
8 | 8 | |
9 | 9 | $interbreadcrumb[] = array( |
10 | - 'url' => api_get_path(WEB_CODE_PATH) . "calendar/agenda_js.php", |
|
10 | + 'url' => api_get_path(WEB_CODE_PATH)."calendar/agenda_js.php", |
|
11 | 11 | 'name' => get_lang('Agenda') |
12 | 12 | ); |
13 | 13 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | if (!empty($currentCourseId) && $currentCourseId != -1) { |
31 | 31 | // Agenda is inside a course tool |
32 | - $url = api_get_self() . '?' . api_get_cidreq(); |
|
32 | + $url = api_get_self().'?'.api_get_cidreq(); |
|
33 | 33 | $this_section = SECTION_COURSES; |
34 | 34 | } else { |
35 | 35 | // Agenda is out of the course tool (e.g personal agenda) |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | if (!empty($events)) { |
46 | 46 | foreach ($events as &$event) { |
47 | 47 | $courseId = isset($event['course_id']) ? $event['course_id'] : ''; |
48 | - $event['url'] = api_get_self() . '?cid=' . $courseId . '&type=' . $event['type']; |
|
48 | + $event['url'] = api_get_self().'?cid='.$courseId.'&type='.$event['type']; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | // personal and admin do not have visibility property |
77 | 77 | } |
78 | 78 | } |
79 | - header('Location: '. api_get_self()); |
|
79 | + header('Location: '.api_get_self()); |
|
80 | 80 | exit; |
81 | 81 | } |
82 | 82 | } |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | $dir = $document_data['path']; |
34 | 34 | |
35 | 35 | //make some vars |
36 | -$wamidir=$dir; |
|
37 | -if($wamidir=="/"){ |
|
38 | - $wamidir=""; |
|
36 | +$wamidir = $dir; |
|
37 | +if ($wamidir == "/") { |
|
38 | + $wamidir = ""; |
|
39 | 39 | } |
40 | 40 | $wamiurlplay = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document'.$wamidir."/"; |
41 | 41 | $groupId = api_get_group_id(); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | //groups //TODO: clean |
71 | 71 | if (!empty($groupId)) { |
72 | - $interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace')); |
|
72 | + $interbreadcrumb[] = array("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace')); |
|
73 | 73 | $noPHP_SELF = true; |
74 | 74 | $group = GroupManager :: get_group_properties($groupId); |
75 | 75 | $path = explode('/', $dir); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || |
88 | - DocumentManager::is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) { |
|
88 | + DocumentManager::is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir), api_get_session_id()))) { |
|
89 | 89 | api_not_allowed(true); |
90 | 90 | } |
91 | 91 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // Interbreadcrumb for the current directory root path |
104 | 104 | $counter = 0; |
105 | 105 | if (isset($document_data['parents'])) { |
106 | - foreach($document_data['parents'] as $document_sub_data) { |
|
106 | + foreach ($document_data['parents'] as $document_sub_data) { |
|
107 | 107 | //fixing double group folder in breadcrumb |
108 | 108 | if (api_get_group_id()) { |
109 | 109 | if ($counter == 0) { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | Display :: display_header($nameTools, 'Doc'); |
123 | 123 | echo '<div class="actions">'; |
124 | - echo '<a href="document.php?id='.$document_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
124 | + echo '<a href="document.php?id='.$document_id.'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
125 | 125 | echo '</div>'; |
126 | 126 | ?> |
127 | 127 | <!-- swfobject is a commonly used library to embed Flash content https://ajax.googleapis.com/ajax/libs/swfobject/2.2/ --> |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $web_odf_supported_files = DocumentManager::get_web_odf_extension_list(); |
35 | 35 | |
36 | 36 | if (in_array(strtolower($pathinfo['extension']), $web_odf_supported_files)) { |
37 | - $show_web_odf = true; |
|
37 | + $show_web_odf = true; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $file_url_web = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file; |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | echo Display::display_header(''); |
86 | 86 | |
87 | 87 | echo '<div class="actions">'; |
88 | -echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
89 | -echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editodf">'.Display::return_icon('edit.png',get_lang('Rename').'/'.get_lang('Comments'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
88 | +echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
89 | +echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editodf">'.Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comments'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
90 | 90 | echo '</div>'; |
91 | 91 | |
92 | 92 | // echo '<div id="odf"></div>'; |