@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @param string View to print as a title for the table |
13 | 13 | * @param string Course name to print as title for the table |
14 | 14 | */ |
15 | -function print_table($data_array,$header_names,$view,$coursename) |
|
15 | +function print_table($data_array, $header_names, $view, $coursename) |
|
16 | 16 | { |
17 | 17 | $printdata = '<!DOCTYPE html |
18 | 18 | PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | $count_pages = ceil(count($data_table) / $items_per_page); |
162 | 162 | $content_table = ''; |
163 | - for ($x = 0; $x<$count_pages; $x++) { |
|
163 | + for ($x = 0; $x < $count_pages; $x++) { |
|
164 | 164 | $content_table .= '<table width="100%" border="1" style="border-collapse:collapse">'; |
165 | 165 | // header table |
166 | 166 | $content_table .= '<tr>'; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | foreach ($headers_table as $head_table) { |
171 | 171 | if (!empty($head_table[0])) { |
172 | - $width = (!empty($head_table[1])?$head_table[1].'%':''); |
|
172 | + $width = (!empty($head_table[1]) ? $head_table[1].'%' : ''); |
|
173 | 173 | $content_table .= '<th width="'.$width.'">'.$head_table[0].'</th>'; |
174 | 174 | $i++; |
175 | 175 | } |
@@ -178,16 +178,16 @@ discard block |
||
178 | 178 | $content_table .= '</tr>'; |
179 | 179 | // body table |
180 | 180 | if (is_array($data_table) && count($data_table) > 0) { |
181 | - $offset = $x*$items_per_page; |
|
182 | - $data_table = array_slice ($data_table, $offset, count($data_table)); |
|
181 | + $offset = $x * $items_per_page; |
|
182 | + $data_table = array_slice($data_table, $offset, count($data_table)); |
|
183 | 183 | $i = 1; |
184 | - $item = $offset+1; |
|
184 | + $item = $offset + 1; |
|
185 | 185 | foreach ($data_table as $data) { |
186 | 186 | $content_table .= '<tr>'; |
187 | - $content_table .= '<td>'.($item<10?'0'.$item:$item).'</td>'; |
|
187 | + $content_table .= '<td>'.($item < 10 ? '0'.$item : $item).'</td>'; |
|
188 | 188 | foreach ($data as $key => $content) { |
189 | 189 | if (isset($content)) { |
190 | - $key == 1 ? $align='align="left"':$align='align="center"'; |
|
190 | + $key == 1 ? $align = 'align="left"' : $align = 'align="center"'; |
|
191 | 191 | $content_table .= '<td '.$align.' style="padding:4px;" >'.$content.'</td>'; |
192 | 192 | } |
193 | 193 | } |
@@ -240,10 +240,10 @@ discard block |
||
240 | 240 | <h1>'.$title_pdf.'</h1></td></tr>'; |
241 | 241 | foreach ($headers_pdf as $header_pdf) { |
242 | 242 | if (!empty($header_pdf[0]) && !empty($header_pdf[1])) { |
243 | - $header.= '<tr><td><strong>'.$header_pdf[0].'</strong> </td><td>'.$header_pdf[1].'</td></tr>'; |
|
243 | + $header .= '<tr><td><strong>'.$header_pdf[0].'</strong> </td><td>'.$header_pdf[1].'</td></tr>'; |
|
244 | 244 | } |
245 | 245 | } |
246 | - $header.='</table><br />'; |
|
246 | + $header .= '</table><br />'; |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | // preparing footer pdf |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | } |
268 | 268 | $items_per_page = 30; |
269 | 269 | $count_pages = ceil(count($data_table) / $items_per_page); |
270 | - for ($x = 0; $x<$count_pages; $x++) { |
|
270 | + for ($x = 0; $x < $count_pages; $x++) { |
|
271 | 271 | $content_table .= '<table width="100%" border="1" style="border-collapse:collapse">'; |
272 | 272 | // header table |
273 | 273 | $content_table .= '<tr>'; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | if (is_array($headers_table)) { |
276 | 276 | foreach ($headers_table as $head_table) { |
277 | 277 | if (!empty($head_table[0])) { |
278 | - $width = (!empty($head_table[1])?$head_table[1].'%':''); |
|
278 | + $width = (!empty($head_table[1]) ? $head_table[1].'%' : ''); |
|
279 | 279 | $content_table .= '<th width="'.$width.'">'.$head_table[0].'</th>'; |
280 | 280 | $i++; |
281 | 281 | } |
@@ -285,16 +285,16 @@ discard block |
||
285 | 285 | // body table |
286 | 286 | |
287 | 287 | if (is_array($data_table) && count($data_table) > 0) { |
288 | - $offset = $x*$items_per_page; |
|
289 | - $data_table = array_slice ($data_table, $offset, count($data_table)); |
|
288 | + $offset = $x * $items_per_page; |
|
289 | + $data_table = array_slice($data_table, $offset, count($data_table)); |
|
290 | 290 | $i = 1; |
291 | - $item = $offset+1; |
|
291 | + $item = $offset + 1; |
|
292 | 292 | foreach ($data_table as $data) { |
293 | 293 | $content_table .= '<tr>'; |
294 | - $content_table .= '<td>'.($item<10?'0'.$item:$item).'</td>'; |
|
294 | + $content_table .= '<td>'.($item < 10 ? '0'.$item : $item).'</td>'; |
|
295 | 295 | foreach ($data as $key => $content) { |
296 | 296 | if (isset($content)) { |
297 | - $key == 1 ? $align='align="left"':$align='align="center"'; |
|
297 | + $key == 1 ? $align = 'align="left"' : $align = 'align="center"'; |
|
298 | 298 | $content_table .= '<td '.$align.' style="padding:4px;" >'.$content.'</td>'; |
299 | 299 | } |
300 | 300 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | $pdf = new PDF(); |
313 | 313 | $pdf->set_custom_footer($footer); |
314 | 314 | $pdf->set_custom_header($headers_in_pdf); |
315 | - $pdf->content_to_pdf($header.$content_table, $css, $title_pdf ); |
|
315 | + $pdf->content_to_pdf($header.$content_table, $css, $title_pdf); |
|
316 | 316 | exit; |
317 | 317 | |
318 | 318 | } |
@@ -327,8 +327,8 @@ discard block |
||
327 | 327 | function export_pdf($pdf, $newarray, $header_names, $format) |
328 | 328 | { |
329 | 329 | $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
330 | - $pdf->ezSetCmMargins(0,0,0,0); |
|
331 | - $pdf->ezSetY(($format=='portrait')?'820':'570'); |
|
330 | + $pdf->ezSetCmMargins(0, 0, 0, 0); |
|
331 | + $pdf->ezSetY(($format == 'portrait') ? '820' : '570'); |
|
332 | 332 | $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
333 | 333 | if ($format == 'portrait') { |
334 | 334 | $pdf->line(40, 790, 540, 790); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $pdf->line(40, 540, 790, 540); |
338 | 338 | $pdf->line(40, 40, 790, 40); |
339 | 339 | } |
340 | - $pdf->ezSetY(($format=='portrait')?'750':'520'); |
|
340 | + $pdf->ezSetY(($format == 'portrait') ? '750' : '520'); |
|
341 | 341 | $pdf->ezTable($newarray, $header_names, '', array( |
342 | 342 | 'showHeadings' => 1, |
343 | 343 | 'shaded' => 1, |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | function print_table($data_array,$header_names,$view,$coursename) |
16 | 16 | { |
17 | - $printdata = '<!DOCTYPE html |
|
17 | + $printdata = '<!DOCTYPE html |
|
18 | 18 | PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
19 | 19 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
20 | 20 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.api_get_language_isocode().'" lang="'.api_get_language_isocode().'"> |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | */ |
98 | 98 | function export_pdf_attendance($headers_table, $data_table, $headers_pdf, $footers_pdf, $title_pdf) |
99 | 99 | { |
100 | - $mpdf = new mPDF('UTF-8', 'A4-L', '', '', 15, 10, 35, 20, 4, 2, 'L'); |
|
101 | - $mpdf->useOnlyCoreFonts = true; |
|
102 | - $mpdf->mirrorMargins = 0; |
|
100 | + $mpdf = new mPDF('UTF-8', 'A4-L', '', '', 15, 10, 35, 20, 4, 2, 'L'); |
|
101 | + $mpdf->useOnlyCoreFonts = true; |
|
102 | + $mpdf->mirrorMargins = 0; |
|
103 | 103 | // Use different Odd/Even headers and footers and mirror margins |
104 | 104 | |
105 | - if (is_array($headers_pdf)) { |
|
106 | - // preparing headers pdf |
|
107 | - $header = ' |
|
105 | + if (is_array($headers_pdf)) { |
|
106 | + // preparing headers pdf |
|
107 | + $header = ' |
|
108 | 108 | <table width="100%" cellspacing="1" cellpadding="1" border="0" class="strong"> |
109 | 109 | <tr> |
110 | 110 | <td ROWSPAN="3" style="text-align: left;" class="title"> |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $items_per_page = count($data_table); |
159 | 159 | } |
160 | 160 | |
161 | - $count_pages = ceil(count($data_table) / $items_per_page); |
|
161 | + $count_pages = ceil(count($data_table) / $items_per_page); |
|
162 | 162 | $content_table = ''; |
163 | 163 | for ($x = 0; $x<$count_pages; $x++) { |
164 | 164 | $content_table .= '<table width="100%" border="1" style="border-collapse:collapse">'; |
@@ -326,10 +326,10 @@ discard block |
||
326 | 326 | */ |
327 | 327 | function export_pdf($pdf, $newarray, $header_names, $format) |
328 | 328 | { |
329 | - $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
|
330 | - $pdf->ezSetCmMargins(0,0,0,0); |
|
331 | - $pdf->ezSetY(($format=='portrait')?'820':'570'); |
|
332 | - $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
|
329 | + $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
|
330 | + $pdf->ezSetCmMargins(0,0,0,0); |
|
331 | + $pdf->ezSetY(($format=='portrait')?'820':'570'); |
|
332 | + $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
|
333 | 333 | if ($format == 'portrait') { |
334 | 334 | $pdf->line(40, 790, 540, 790); |
335 | 335 | $pdf->line(40, 40, 540, 40); |
@@ -345,5 +345,5 @@ discard block |
||
345 | 345 | 'rowGap' => 3, |
346 | 346 | 'width' => (($format == 'portrait') ? '500' : '750'), |
347 | 347 | )); |
348 | - $pdf->ezStream(); |
|
348 | + $pdf->ezStream(); |
|
349 | 349 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | ////require_once '../inc/global.inc.php'; |
11 | -$current_course_tool = TOOL_BLOGS; |
|
11 | +$current_course_tool = TOOL_BLOGS; |
|
12 | 12 | |
13 | 13 | $this_section = SECTION_COURSES; |
14 | 14 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | // ONLY USERS REGISTERED IN THE COURSE |
22 | 22 | if (!$is_allowed_in_course && !api_is_allowed_to_edit()) { |
23 | - api_not_allowed(true);//print headers/footers |
|
23 | + api_not_allowed(true); //print headers/footers |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | if (api_is_allowed_to_edit()) { |
@@ -34,29 +34,29 @@ discard block |
||
34 | 34 | 'url' => 'blog_admin.php?'.api_get_cidreq(), |
35 | 35 | 'name' => $nameTools, |
36 | 36 | ); |
37 | - $my_url=''; |
|
38 | - if (isset($_GET['action']) && $_GET['action']=='add') { |
|
37 | + $my_url = ''; |
|
38 | + if (isset($_GET['action']) && $_GET['action'] == 'add') { |
|
39 | 39 | $current_section = get_lang('AddBlog'); |
40 | - $my_url='action=add'; |
|
41 | - } elseif (isset($_GET['action']) && $_GET['action']=='edit') { |
|
40 | + $my_url = 'action=add'; |
|
41 | + } elseif (isset($_GET['action']) && $_GET['action'] == 'edit') { |
|
42 | 42 | $current_section = get_lang('EditBlog'); |
43 | - $my_url='action=edit&blog_id='.Security::remove_XSS($_GET['blog_id']); |
|
43 | + $my_url = 'action=edit&blog_id='.Security::remove_XSS($_GET['blog_id']); |
|
44 | 44 | } |
45 | 45 | Display::display_header(''); |
46 | 46 | } |
47 | 47 | echo '<div class="actions">'; |
48 | 48 | echo "<a href='".api_get_self()."?".api_get_cidreq()."&action=add'>", |
49 | - Display::return_icon('new_blog.png', get_lang('AddBlog'),'',ICON_SIZE_MEDIUM)."</a>"; |
|
49 | + Display::return_icon('new_blog.png', get_lang('AddBlog'), '', ICON_SIZE_MEDIUM)."</a>"; |
|
50 | 50 | echo '</div>'; |
51 | 51 | |
52 | 52 | if (!empty($_POST['new_blog_submit']) && !empty($_POST['blog_name'])) { |
53 | - if (isset($_POST['blog_name'])) { |
|
53 | + if (isset($_POST['blog_name'])) { |
|
54 | 54 | Blog::create_blog($_POST['blog_name'], $_POST['blog_subtitle']); |
55 | 55 | Display::display_confirmation_message(get_lang('BlogStored')); |
56 | 56 | } |
57 | 57 | } |
58 | 58 | if (!empty($_POST['edit_blog_submit']) && !empty($_POST['blog_name'])) { |
59 | - if (strlen(trim($_POST['blog_name']))>0) { |
|
59 | + if (strlen(trim($_POST['blog_name'])) > 0) { |
|
60 | 60 | Blog::edit_blog($_POST['blog_id'], $_POST['blog_name'], $_POST['blog_subtitle']); |
61 | 61 | Display::display_confirmation_message(get_lang('BlogEdited')); |
62 | 62 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | // we show the form if |
89 | 89 | // 1. no post data |
90 | 90 | // 2. there is post data and one of the three form elements is empty |
91 | - if (!$_POST || (!empty($_POST) && (empty($_POST['edit_blog_submit']) || empty($_POST['blog_name']) ))) { |
|
91 | + if (!$_POST || (!empty($_POST) && (empty($_POST['edit_blog_submit']) || empty($_POST['blog_name'])))) { |
|
92 | 92 | // if there is post data there is certainly an error in the form |
93 | 93 | if ($_POST) { |
94 | 94 | Display::display_error_message(get_lang('FormHasErrorsPleaseComplete')); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
31 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
32 | 32 | $interbreadcrumb[] = array( |
33 | 33 | 'url' => "resume_session.php?id_session=".$sessionId, |
34 | 34 | "name" => get_lang('SessionOverview') |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | if ($days > 0) { |
61 | 61 | $msg = sprintf(get_lang('FirstAccessWasXSessionDurationYEndDateInZDays'), $firstAccessString, $duration, $days); |
62 | 62 | } else { |
63 | - $endDateInSeconds = $firstAccess + $duration * 24*60*60; |
|
63 | + $endDateInSeconds = $firstAccess + $duration * 24 * 60 * 60; |
|
64 | 64 | $last = api_convert_and_format_date($endDateInSeconds, DATE_FORMAT_SHORT); |
65 | 65 | $msg = sprintf(get_lang('FirstAccessWasXSessionDurationYEndDateWasZ'), $firstAccessString, $duration, $last); |
66 | 66 | } |
@@ -108,7 +108,7 @@ |
||
108 | 108 | ], |
109 | 109 | ['BulletedList', 'NumberedList', 'HorizontalRule'], |
110 | 110 | ['JustifyLeft', 'JustifyCenter', 'JustifyBlock'], |
111 | - [ 'Styles', |
|
111 | + ['Styles', |
|
112 | 112 | 'Format', |
113 | 113 | 'Font', |
114 | 114 | 'FontSize', |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | '-', |
57 | 57 | 'Find' |
58 | 58 | ], |
59 | - ['Wikilink','Link','Unlink','Anchor'], |
|
60 | - ['Image','Video','Flash','Oembed','Youtube','Audio','Asciimath'], |
|
61 | - ['Table','HorizontalRule','Smiley','SpecialChar','leaflet'], |
|
62 | - ['Format','Font','FontSize'], |
|
63 | - ['Bold','Italic','Underline'], |
|
59 | + ['Wikilink', 'Link', 'Unlink', 'Anchor'], |
|
60 | + ['Image', 'Video', 'Flash', 'Oembed', 'Youtube', 'Audio', 'Asciimath'], |
|
61 | + ['Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'leaflet'], |
|
62 | + ['Format', 'Font', 'FontSize'], |
|
63 | + ['Bold', 'Italic', 'Underline'], |
|
64 | 64 | [ |
65 | 65 | 'Subscript', |
66 | 66 | 'Superscript', |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | return [ |
95 | 95 | ['Save', 'NewPage', 'Templates', '-', 'PasteText'], |
96 | 96 | ['Undo', 'Redo'], |
97 | - ['Wikilink', 'Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'], |
|
97 | + ['Wikilink', 'Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'], |
|
98 | 98 | ['BulletedList', 'NumberedList', 'HorizontalRule'], |
99 | 99 | ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], |
100 | - ['Styles','Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'], |
|
100 | + ['Styles', 'Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'], |
|
101 | 101 | api_get_setting('enabled_wiris') == 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''], |
102 | 102 | ['Toolbarswitch'] |
103 | 103 | ]; |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | /** |
9 | 9 | * Code |
10 | 10 | */ |
11 | -include_once dirname(__FILE__) . '/../../../global.inc.php'; |
|
12 | -require_once dirname(__FILE__) . '/search_processor.class.php'; |
|
11 | +include_once dirname(__FILE__).'/../../../global.inc.php'; |
|
12 | +require_once dirname(__FILE__).'/search_processor.class.php'; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Process links before pass it to search listing scripts |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | |
105 | 105 | $link_id = intval($link_id); |
106 | 106 | $sql = "SELECT insert_user_id FROM $item_property_table |
107 | - WHERE ref = $link_id AND tool = '" . TOOL_LINK . "' AND c_id = $course_id |
|
107 | + WHERE ref = $link_id AND tool = '".TOOL_LINK."' AND c_id = $course_id |
|
108 | 108 | LIMIT 1"; |
109 | 109 | |
110 | 110 | $name = get_lang('Links'); |
111 | - $url = api_get_path(WEB_PATH) . 'main/link/link.php?cidReq=%s'; |
|
111 | + $url = api_get_path(WEB_PATH).'main/link/link.php?cidReq=%s'; |
|
112 | 112 | $url = sprintf($url, $course_id_alpha); |
113 | 113 | // Get the image path |
114 | 114 | $thumbnail = Display::returnIconPath('link.png'); |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | /** |
9 | 9 | * Code |
10 | 10 | */ |
11 | -include_once dirname(__FILE__) . '/../../../global.inc.php'; |
|
12 | -require_once dirname(__FILE__) . '/search_processor.class.php'; |
|
11 | +include_once dirname(__FILE__).'/../../../global.inc.php'; |
|
12 | +require_once dirname(__FILE__).'/search_processor.class.php'; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Process documents before pass it to search listing scripts |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $dk_result = Database::query($sql); |
83 | 83 | |
84 | 84 | $sql = "SELECT insert_user_id FROM $item_property_table |
85 | - WHERE ref = $doc_id AND tool = '" . TOOL_DOCUMENT . "' AND c_id = $course_id |
|
85 | + WHERE ref = $doc_id AND tool = '".TOOL_DOCUMENT."' AND c_id = $course_id |
|
86 | 86 | LIMIT 1"; |
87 | 87 | $name = ''; |
88 | 88 | if ($row = Database::fetch_array($dk_result)) { |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $tool_name = get_lang('AddSpecificSearchField'); |
28 | 28 | |
29 | 29 | if (isset($_GET['action']) && $_GET['action'] === 'edit') { |
30 | - $tool_name = get_lang('EditSpecificSearchField'); |
|
30 | + $tool_name = get_lang('EditSpecificSearchField'); |
|
31 | 31 | } |
32 | 32 | // Create the form |
33 | 33 | $form = new FormValidator('specific_fields_add'); |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | // Create the form |
33 | 33 | $form = new FormValidator('specific_fields_add'); |
34 | 34 | // Field variable name |
35 | -$form->addElement('hidden','field_id', $fieldId); |
|
36 | -$form->addElement('text','field_name',get_lang('FieldName')); |
|
37 | -$form->applyFilter('field_name','html_filter'); |
|
38 | -$form->applyFilter('field_name','trim'); |
|
35 | +$form->addElement('hidden', 'field_id', $fieldId); |
|
36 | +$form->addElement('text', 'field_name', get_lang('FieldName')); |
|
37 | +$form->applyFilter('field_name', 'html_filter'); |
|
38 | +$form->applyFilter('field_name', 'trim'); |
|
39 | 39 | $form->addRule('field_name', get_lang('ThisFieldIsRequired'), 'required'); |
40 | 40 | $form->addRule('field_name', get_lang('OnlyLettersAndNumbersAllowed'), 'username'); |
41 | -$form->addRule('field_name', '', 'maxlength',20); |
|
41 | +$form->addRule('field_name', '', 'maxlength', 20); |
|
42 | 42 | |
43 | 43 | // Set default values (only not empty when editing) |
44 | 44 | $defaults = array(); |
45 | 45 | if ($fieldId) { |
46 | - $form_information = get_specific_field_list(array( 'id' => $fieldId )); |
|
46 | + $form_information = get_specific_field_list(array('id' => $fieldId)); |
|
47 | 47 | $defaults['field_name'] = $form_information[0]['name']; |
48 | 48 | } |
49 | 49 | $form->setDefaults($defaults); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | if ($form->validate()) { |
55 | 55 | $field = $form->exportValues(); |
56 | 56 | $field_name = $field['field_name']; |
57 | - if (is_numeric($field['field_id']) && $field['field_id']<>0 && !empty($field['field_id'])) { |
|
57 | + if (is_numeric($field['field_id']) && $field['field_id'] <> 0 && !empty($field['field_id'])) { |
|
58 | 58 | edit_specific_field($field['field_id'], $field['field_name']); |
59 | 59 | $message = get_lang('FieldEdited'); |
60 | 60 | } else { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @param string $canHaveCourses |
104 | 104 | * @param int $parent_id |
105 | 105 | * |
106 | - * @return bool |
|
106 | + * @return false|string |
|
107 | 107 | */ |
108 | 108 | public static function addNode($code, $name, $canHaveCourses, $parent_id) |
109 | 109 | { |
@@ -297,8 +297,7 @@ discard block |
||
297 | 297 | /** |
298 | 298 | * Counts the number of children categories a category has |
299 | 299 | * @param int $categoryId The ID of the category of which we want to count the children |
300 | - * @param int $count The number of subcategories we counted this far |
|
301 | - * @return mixed The number of subcategories this category has |
|
300 | + * @return integer The number of subcategories this category has |
|
302 | 301 | */ |
303 | 302 | public static function courseCategoryChildrenCount($categoryId) |
304 | 303 | { |
@@ -476,7 +475,7 @@ discard block |
||
476 | 475 | /** |
477 | 476 | * @param int $id |
478 | 477 | * |
479 | - * @return bool |
|
478 | + * @return boolean|null |
|
480 | 479 | */ |
481 | 480 | public static function addToUrl($id) |
482 | 481 | { |
@@ -958,7 +957,7 @@ discard block |
||
958 | 957 | * Get Pagination HTML div |
959 | 958 | * @param $pageCurrent |
960 | 959 | * @param $pageLength |
961 | - * @param $pageTotal |
|
960 | + * @param integer $pageTotal |
|
962 | 961 | * @return string |
963 | 962 | */ |
964 | 963 | public static function getCatalogPagination($pageCurrent, $pageLength, $pageTotal) |