@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | /* More info @ http://mpdf1.com/manual/index.php?tid=184&searchstring=mPDF |
32 | 32 | * mPDF ([ string $mode [, mixed $format [, float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, string $orientation ]]]]]]) |
33 | 33 | */ |
34 | - if (!in_array($orientation, array('P','L'))) { |
|
34 | + if (!in_array($orientation, array('P', 'L'))) { |
|
35 | 35 | $orientation = 'P'; |
36 | 36 | } |
37 | 37 | //$this->pdf = $pdf = new mPDF('UTF-8', $pageFormat, '', '', 30, 20, 27, 25, 16, 13, $orientation); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $visualTheme = api_get_visual_theme(); |
112 | 112 | $img = api_get_path(SYS_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png'; |
113 | 113 | if (file_exists($img)) { |
114 | - $img = api_get_path(WEB_CSS_PATH) . 'themes/' . $visualTheme . '/images/pdf_logo_header.png'; |
|
114 | + $img = api_get_path(WEB_CSS_PATH).'themes/'.$visualTheme.'/images/pdf_logo_header.png'; |
|
115 | 115 | $organization = "<img src='$img'>"; |
116 | 116 | } |
117 | 117 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | // Clean styles and javascript document |
232 | - $clean_search = array ( |
|
232 | + $clean_search = array( |
|
233 | 233 | '@<script[^>]*?>.*?</script>@si', |
234 | 234 | '@<style[^>]*?>.*?</style>@si' |
235 | 235 | ); |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | // then print the title in the PDF |
251 | 251 | if (is_array($file) && isset($file['title'])) { |
252 | 252 | $html_title = $file['title']; |
253 | - $file = $file['path']; |
|
253 | + $file = $file['path']; |
|
254 | 254 | } else { |
255 | 255 | //we suppose we've only been sent a file path |
256 | 256 | $html_title = basename($file); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | //it's not a chapter but the file exists, print its title |
283 | 283 | if ($print_title) { |
284 | 284 | $this->pdf->WriteHTML( |
285 | - '<html><body><h3>' . $html_title . '</h3></body></html>', |
|
285 | + '<html><body><h3>'.$html_title.'</h3></body></html>', |
|
286 | 286 | 2 |
287 | 287 | ); |
288 | 288 | } |
@@ -292,12 +292,12 @@ discard block |
||
292 | 292 | |
293 | 293 | if (in_array($extension, array('html', 'htm'))) { |
294 | 294 | $filename = $file_info['basename']; |
295 | - $filename = str_replace('_',' ',$filename); |
|
295 | + $filename = str_replace('_', ' ', $filename); |
|
296 | 296 | |
297 | 297 | if ($extension == 'html') { |
298 | - $filename = basename($filename,'.html'); |
|
299 | - } elseif($extension == 'htm'){ |
|
300 | - $filename = basename($filename,'.htm'); |
|
298 | + $filename = basename($filename, '.html'); |
|
299 | + } elseif ($extension == 'htm') { |
|
300 | + $filename = basename($filename, '.htm'); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | $document_html = @file_get_contents($file); |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $document_html = str_replace('href="./css/frames.css"', $absolute_css_path, $document_html); |
309 | 309 | |
310 | 310 | if (!empty($course_data['path'])) { |
311 | - $document_html= str_replace('../','', $document_html); |
|
311 | + $document_html = str_replace('../', '', $document_html); |
|
312 | 312 | $document_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document/'; |
313 | 313 | |
314 | 314 | $doc = new DOMDocument(); |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | $new_path = $old_src; |
341 | 341 | } |
342 | 342 | |
343 | - $document_html= str_replace($old_src, $new_path, $document_html); |
|
343 | + $document_html = str_replace($old_src, $new_path, $document_html); |
|
344 | 344 | } |
345 | 345 | } else { |
346 | 346 | //Check if this is a complete URL |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | if (!empty($document_html)) { |
369 | 369 | $this->pdf->WriteHTML($document_html.$page_break, 2); |
370 | 370 | } |
371 | - } elseif (in_array($extension, array('jpg','jpeg','png','gif'))) { |
|
371 | + } elseif (in_array($extension, array('jpg', 'jpeg', 'png', 'gif'))) { |
|
372 | 372 | //Images |
373 | 373 | $image = Display::img($file); |
374 | 374 | $this->pdf->WriteHTML('<html><body>'.$image.'</body></html>'.$page_break, 2); |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | } |
418 | 418 | |
419 | 419 | //clean styles and javascript document |
420 | - $clean_search = array ( |
|
420 | + $clean_search = array( |
|
421 | 421 | '@<script[^>]*?>.*?</script>@si', |
422 | 422 | '@<style[^>]*?>.*?</style>@siU' |
423 | 423 | ); |
@@ -431,11 +431,11 @@ discard block |
||
431 | 431 | |
432 | 432 | //absolute path for frames.css //TODO: necessary? |
433 | 433 | $absolute_css_path = api_get_path(WEB_CSS_PATH).api_get_setting('stylesheets').'/frames.css'; |
434 | - $document_html = str_replace('href="./css/frames.css"','href="'.$absolute_css_path.'"', $document_html); |
|
434 | + $document_html = str_replace('href="./css/frames.css"', 'href="'.$absolute_css_path.'"', $document_html); |
|
435 | 435 | |
436 | - $document_html= str_replace('../../','',$document_html); |
|
437 | - $document_html= str_replace('../','',$document_html); |
|
438 | - $document_html= str_replace((empty($_configuration['url_append'])?'':$_configuration['url_append'].'/').'courses/'.$course_code.'/document/','',$document_html); |
|
436 | + $document_html = str_replace('../../', '', $document_html); |
|
437 | + $document_html = str_replace('../', '', $document_html); |
|
438 | + $document_html = str_replace((empty($_configuration['url_append']) ? '' : $_configuration['url_append'].'/').'courses/'.$course_code.'/document/', '', $document_html); |
|
439 | 439 | |
440 | 440 | if (!empty($course_data['path'])) { |
441 | 441 | $document_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document/'; |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | $old_src_fixed = str_replace('/courses/'.$course_data['path'].'/document/', '', $old_src); |
457 | 457 | $old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src_fixed); |
458 | 458 | $new_path = $document_path.$old_src_fixed; |
459 | - $document_html= str_replace($old_src, $new_path, $document_html); |
|
459 | + $document_html = str_replace($old_src, $new_path, $document_html); |
|
460 | 460 | |
461 | 461 | } |
462 | 462 | } |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | //$document_html= str_replace('temp_template_path', 'src="/main/default_course_document/', $document_html);// restore src templates |
476 | 476 | |
477 | 477 | api_set_encoding_html($document_html, 'UTF-8'); // The library mPDF expects UTF-8 encoded input data. |
478 | - $title = api_get_title_html($document_html, 'UTF-8', 'UTF-8'); // TODO: Maybe it is better idea the title to be passed through |
|
478 | + $title = api_get_title_html($document_html, 'UTF-8', 'UTF-8'); // TODO: Maybe it is better idea the title to be passed through |
|
479 | 479 | // $_GET[] too, as it is done with file name. |
480 | 480 | // At the moment the title is retrieved from the html document itself. |
481 | 481 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | //$this->pdf->Output($output_file, $outputMode); // F to save the pdf in a file |
498 | 498 | |
499 | 499 | if ($outputMode == 'F') { |
500 | - $output_file = api_get_path(SYS_ARCHIVE_PATH) . $output_file; |
|
500 | + $output_file = api_get_path(SYS_ARCHIVE_PATH).$output_file; |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | if ($saveInFile) { |
@@ -530,14 +530,14 @@ discard block |
||
530 | 530 | $web_path = false; |
531 | 531 | if (!empty($course_code) && api_get_setting('pdf_export_watermark_by_course') == 'true') { |
532 | 532 | $course_info = api_get_course_info($course_code); |
533 | - $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path |
|
533 | + $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path |
|
534 | 534 | if (file_exists($store_path)) { |
535 | - $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png'; |
|
535 | + $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.api_get_current_access_url_id().'_pdf_watermark.png'; |
|
536 | 536 | } |
537 | 537 | } else { |
538 | - $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path |
|
538 | + $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path |
|
539 | 539 | if (file_exists($store_path)) |
540 | - $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; |
|
540 | + $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; |
|
541 | 541 | } |
542 | 542 | return $web_path; |
543 | 543 | } |
@@ -576,10 +576,10 @@ discard block |
||
576 | 576 | { |
577 | 577 | if (!empty($course_code) && api_get_setting('pdf_export_watermark_by_course') == 'true') { |
578 | 578 | $course_info = api_get_course_info($course_code); |
579 | - $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path']; // course path |
|
579 | + $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path']; // course path |
|
580 | 580 | $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/pdf_watermark.png'; |
581 | 581 | } else { |
582 | - $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images'; // course path |
|
582 | + $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images'; // course path |
|
583 | 583 | $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; |
584 | 584 | } |
585 | 585 | $course_image = $store_path.'/'.api_get_current_access_url_id().'_pdf_watermark.png'; |
@@ -614,9 +614,9 @@ discard block |
||
614 | 614 | */ |
615 | 615 | public function set_footer() |
616 | 616 | { |
617 | - $this->pdf->defaultfooterfontsize = 12; // in pts |
|
618 | - $this->pdf->defaultfooterfontstyle = B; // blank, B, I, or BI |
|
619 | - $this->pdf->defaultfooterline = 1; // 1 to include line below header/above footer |
|
617 | + $this->pdf->defaultfooterfontsize = 12; // in pts |
|
618 | + $this->pdf->defaultfooterfontstyle = B; // blank, B, I, or BI |
|
619 | + $this->pdf->defaultfooterline = 1; // 1 to include line below header/above footer |
|
620 | 620 | $platform_name = api_get_setting('Institution'); |
621 | 621 | $left_content = $platform_name; |
622 | 622 | $center_content = ''; |
@@ -682,9 +682,9 @@ discard block |
||
682 | 682 | */ |
683 | 683 | public function set_header($course_data) |
684 | 684 | { |
685 | - $this->pdf->defaultheaderfontsize = 10; // in pts |
|
686 | - $this->pdf->defaultheaderfontstyle = 'BI'; // blank, B, I, or BI |
|
687 | - $this->pdf->defaultheaderline = 1; // 1 to include line below header/above footer |
|
685 | + $this->pdf->defaultheaderfontsize = 10; // in pts |
|
686 | + $this->pdf->defaultheaderfontstyle = 'BI'; // blank, B, I, or BI |
|
687 | + $this->pdf->defaultheaderline = 1; // 1 to include line below header/above footer |
|
688 | 688 | |
689 | 689 | if (!empty($course_data['code'])) { |
690 | 690 | $teacher_list = CourseManager::get_teacher_list_from_course_code($course_data['code']); |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | if (!empty($teacher_list)) { |
694 | 694 | |
695 | 695 | foreach ($teacher_list as $teacher) { |
696 | - $teachers[]= $teacher['firstname'].' '.$teacher['lastname']; |
|
696 | + $teachers[] = $teacher['firstname'].' '.$teacher['lastname']; |
|
697 | 697 | } |
698 | 698 | if (count($teachers) > 1) { |
699 | 699 | $teachers = get_lang('Teachers').': '.implode(', ', $teachers); |
@@ -760,7 +760,7 @@ discard block |
||
760 | 760 | 'line' => 1, |
761 | 761 | ), |
762 | 762 | ); |
763 | - $this->pdf->SetHeader($header);// ('{DATE j-m-Y}|{PAGENO}/{nb}|'.$title); |
|
763 | + $this->pdf->SetHeader($header); // ('{DATE j-m-Y}|{PAGENO}/{nb}|'.$title); |
|
764 | 764 | } |
765 | 765 | } |
766 | 766 | |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | $this->pdf->directionality = api_get_text_direction(); |
806 | 806 | $this->pdf->useOnlyCoreFonts = true; |
807 | 807 | // Use different Odd/Even headers and footers and mirror margins |
808 | - $this->pdf->mirrorMargins = 1; |
|
808 | + $this->pdf->mirrorMargins = 1; |
|
809 | 809 | |
810 | 810 | // Add decoration only if not stated otherwise |
811 | 811 | if ($complete) { |
@@ -833,7 +833,7 @@ discard block |
||
833 | 833 | $watermark_text = api_get_setting('pdf_export_watermark_text'); |
834 | 834 | } |
835 | 835 | if (!empty($watermark_text)) { |
836 | - $this->pdf->SetWatermarkText(strcode2utf($watermark_text),0.1); |
|
836 | + $this->pdf->SetWatermarkText(strcode2utf($watermark_text), 0.1); |
|
837 | 837 | $this->pdf->showWatermarkText = true; |
838 | 838 | } |
839 | 839 | } |
@@ -841,8 +841,8 @@ discard block |
||
841 | 841 | if (empty($this->custom_header)) { |
842 | 842 | self::set_header($course_data); |
843 | 843 | } else { |
844 | - $this->pdf->SetHTMLHeader($this->custom_header,'E'); |
|
845 | - $this->pdf->SetHTMLHeader($this->custom_header,'O'); |
|
844 | + $this->pdf->SetHTMLHeader($this->custom_header, 'E'); |
|
845 | + $this->pdf->SetHTMLHeader($this->custom_header, 'O'); |
|
846 | 846 | } |
847 | 847 | |
848 | 848 | if (empty($this->custom_footer)) { |
@@ -41,9 +41,9 @@ |
||
41 | 41 | */ |
42 | 42 | function _createElements() |
43 | 43 | { |
44 | - $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array ('onclick' => 'javascript:receivers_hide(\'receivers_to\')')); |
|
44 | + $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array('onclick' => 'javascript:receivers_hide(\'receivers_to\')')); |
|
45 | 45 | $this->_elements[0]->setChecked(true); |
46 | - $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array ('onclick' => 'javascript:receivers_show(\'receivers_to\')')); |
|
46 | + $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array('onclick' => 'javascript:receivers_show(\'receivers_to\')')); |
|
47 | 47 | $this->_elements[] = new HTML_QuickForm_advmultiselect('to', '', $this->receivers); |
48 | 48 | $this->_elements[2]->setSelected($this->receivers_selected); |
49 | 49 | } |
@@ -88,7 +88,7 @@ |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | $timePicker = 'true'; |
91 | - $timePickerValue = $this->getAttribute('timePicker'); |
|
91 | + $timePickerValue = $this->getAttribute('timePicker'); |
|
92 | 92 | if (!empty($timePickerValue)) { |
93 | 93 | $timePicker = $timePickerValue; |
94 | 94 | } |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | $value = api_format_date($value, DATE_TIME_FORMAT_LONG_24H); |
45 | 45 | } |
46 | 46 | |
47 | - return $this->getElementJS() . ' |
|
47 | + return $this->getElementJS().' |
|
48 | 48 | <div class="input-group"> |
49 | 49 | <span class="input-group-addon"> |
50 | - <input ' . $this->_getAttrString($this->_attributes) . '> |
|
50 | + <input ' . $this->_getAttrString($this->_attributes).'> |
|
51 | 51 | </span> |
52 | - <input class="form-control" type="text" readonly id="' . $id . '_alt" value="' . $value . '"> |
|
52 | + <input class="form-control" type="text" readonly id="' . $id.'_alt" value="'.$value.'"> |
|
53 | 53 | </div> |
54 | 54 | '; |
55 | 55 | } |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | $js .= "<script> |
80 | 80 | $(function() { |
81 | 81 | $('#$id').hide().datepicker({ |
82 | - defaultDate: '" . $this->getValue() . "', |
|
82 | + defaultDate: '".$this->getValue()."', |
|
83 | 83 | dateFormat: 'yy-mm-dd', |
84 | 84 | altField: '#{$id}_alt', |
85 | - altFormat: \"" . get_lang('DateFormatLongNoDayJS') . "\", |
|
85 | + altFormat: \"".get_lang('DateFormatLongNoDayJS')."\", |
|
86 | 86 | showOn: 'both', |
87 | - buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true) . "', |
|
87 | + buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true)."', |
|
88 | 88 | buttonImageOnly: true, |
89 | - buttonText: '" . get_lang('SelectDate') . "', |
|
89 | + buttonText: '" . get_lang('SelectDate')."', |
|
90 | 90 | changeMonth: true, |
91 | 91 | changeYear: true, |
92 | 92 | yearRange: 'c-60y:c+5y' |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $iso = api_get_language_isocode(api_get_interface_language()); |
26 | 26 | $languageCondition = ''; |
27 | 27 | |
28 | - if (file_exists(api_get_path(SYS_PATH) . "web/assets/select2/dist/js/i18n/$iso.js")) { |
|
28 | + if (file_exists(api_get_path(SYS_PATH)."web/assets/select2/dist/js/i18n/$iso.js")) { |
|
29 | 29 | $html .= api_get_asset("select2/dist/js/i18n/$iso.js"); |
30 | 30 | $languageCondition = "language: '$iso',"; |
31 | 31 | } |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | //Get the minimumInputLength for select2 |
52 | 52 | $minimumInputLength = $this->getAttribute('minimumInputLength') > 3 ? |
53 | - $this->getAttribute('minimumInputLength') : |
|
54 | - 3 |
|
53 | + $this->getAttribute('minimumInputLength') : 3 |
|
55 | 54 | ; |
56 | 55 | |
57 | 56 | $plHolder = $this->getAttribute('placeholder'); |
@@ -113,6 +112,6 @@ discard block |
||
113 | 112 | $this->removeAttribute('url_function'); |
114 | 113 | $this->setAttribute('style', 'width: 100%;'); |
115 | 114 | |
116 | - return parent::toHtml() . $html; |
|
115 | + return parent::toHtml().$html; |
|
117 | 116 | } |
118 | 117 | } |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | $value = api_format_date($value, DATE_TIME_FORMAT_LONG_24H); |
39 | 39 | } |
40 | 40 | |
41 | - return $this->getElementJS() . ' |
|
41 | + return $this->getElementJS().' |
|
42 | 42 | <div class="input-group"> |
43 | 43 | <span class="input-group-addon"> |
44 | - <input ' . $this->_getAttrString($this->_attributes) . '> |
|
44 | + <input ' . $this->_getAttrString($this->_attributes).'> |
|
45 | 45 | </span> |
46 | - <input class="form-control" type="text" readonly id="' . $id . '_alt" value="' . $value . '"> |
|
46 | + <input class="form-control" type="text" readonly id="' . $id.'_alt" value="'.$value.'"> |
|
47 | 47 | </div> |
48 | 48 | '; |
49 | 49 | } |
@@ -73,18 +73,18 @@ discard block |
||
73 | 73 | $js .= "<script> |
74 | 74 | $(function() { |
75 | 75 | $('#$id').hide().datetimepicker({ |
76 | - defaultDate: '" . $this->getValue() . "', |
|
76 | + defaultDate: '".$this->getValue()."', |
|
77 | 77 | dateFormat: 'yy-mm-dd', |
78 | 78 | timeFormat: 'HH:mm', |
79 | 79 | altField: '#{$id}_alt', |
80 | - altFormat: \"" . get_lang('DateFormatLongNoDayJS') . "\", |
|
81 | - altTimeFormat: \"" . get_lang('TimeFormatNoSecJS') . "\", |
|
82 | - altSeparator: \" " . get_lang('AtTime') . " \", |
|
80 | + altFormat: \"".get_lang('DateFormatLongNoDayJS')."\", |
|
81 | + altTimeFormat: \"" . get_lang('TimeFormatNoSecJS')."\", |
|
82 | + altSeparator: \" " . get_lang('AtTime')." \", |
|
83 | 83 | altFieldTimeOnly: false, |
84 | 84 | showOn: 'both', |
85 | - buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true) . "', |
|
85 | + buttonImage: '" . Display::return_icon('attendance.png', null, [], ICON_SIZE_TINY, true, true)."', |
|
86 | 86 | buttonImageOnly: true, |
87 | - buttonText: '" . get_lang('SelectDate') . "', |
|
87 | + buttonText: '" . get_lang('SelectDate')."', |
|
88 | 88 | changeMonth: true, |
89 | 89 | changeYear: true |
90 | 90 | }); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | return true; |
22 | 22 | } |
23 | 23 | } |
24 | - $result = parent::validate(array($datetime1, $datetime2), $operator); |
|
24 | + $result = parent::validate(array($datetime1, $datetime2), $operator); |
|
25 | 25 | return $result; |
26 | 26 | } |
27 | 27 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | function validate($html, $mode = NO_HTML) |
18 | 18 | { |
19 | - $allowed_tags = self::get_allowed_tags ($mode, $fullpage); |
|
19 | + $allowed_tags = self::get_allowed_tags($mode, $fullpage); |
|
20 | 20 | $cleaned_html = kses($html, $allowed_tags); |
21 | 21 | return $html == $cleaned_html; |
22 | 22 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // Include the allowed tags. |
34 | 34 | //include(dirname(__FILE__).'/allowed_tags.inc.php'); |
35 | 35 | global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page; |
36 | - switch($mode) |
|
36 | + switch ($mode) |
|
37 | 37 | { |
38 | 38 | case NO_HTML: |
39 | 39 | return array(); |
@@ -27,11 +27,11 @@ |
||
27 | 27 | */ |
28 | 28 | function validate($value, $options = null) |
29 | 29 | { |
30 | - if(is_array($value)) |
|
30 | + if (is_array($value)) |
|
31 | 31 | { |
32 | - $value = implode(null,$value); |
|
32 | + $value = implode(null, $value); |
|
33 | 33 | } |
34 | - if ((string)$value == '') { |
|
34 | + if ((string) $value == '') { |
|
35 | 35 | return false; |
36 | 36 | } |
37 | 37 | return true; |