@@ -25,11 +25,11 @@ |
||
25 | 25 | |
26 | 26 | |
27 | 27 | /** |
28 | - * Prepare array of tabs for Website |
|
29 | - * |
|
30 | - * @param Website $object Website |
|
31 | - * @return array<array{0:string,1:string,2:string}> Array of tabs |
|
32 | - */ |
|
28 | + * Prepare array of tabs for Website |
|
29 | + * |
|
30 | + * @param Website $object Website |
|
31 | + * @return array<array{0:string,1:string,2:string}> Array of tabs |
|
32 | + */ |
|
33 | 33 | function websiteconfigPrepareHead($object) |
34 | 34 | { |
35 | 35 | global $langs, $conf; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | // Parse all strings __(...)__ to replace with the translated value $langs->trans("...") |
139 | 139 | $langs->load("other"); |
140 | - $content = preg_replace_callback('/__\((.+)\)__/', function ($matches) { |
|
140 | + $content = preg_replace_callback('/__\((.+)\)__/', function($matches) { |
|
141 | 141 | global $langs; |
142 | 142 | return $langs->trans($matches[1]); |
143 | 143 | }, $content); |
@@ -154,14 +154,14 @@ discard block |
||
154 | 154 | |
155 | 155 | $newsList .= '<div style="display: flex; align-items: flex-start; justify-content: flex-start; width: 100%; max-width: 800px; margin-top: 20px;margin-bottom: 50px; padding: 20px;"> |
156 | 156 | <div style="flex-grow: 1; margin-right: 30px; max-width: 600px; margin-left: 100px;"> |
157 | - <h2 style="margin: 0; font-size: 1.5em;">' . htmlentities(empty($post['title']) ? '' : $post['title']) . '</h2> |
|
158 | - <p style="margin: 10px 0; color: #555;">' . htmlentities(empty($post['description']) ? '' : $post['description']) . '</p> |
|
159 | - <span style="display: block; margin-bottom: 5px; color: #888;">Created By: <strong>' . htmlentities(empty($post['user_fullname']) ? '' : $post['user_fullname']) . '</strong></span> |
|
157 | + <h2 style="margin: 0; font-size: 1.5em;">' . htmlentities(empty($post['title']) ? '' : $post['title']).'</h2> |
|
158 | + <p style="margin: 10px 0; color: #555;">' . htmlentities(empty($post['description']) ? '' : $post['description']).'</p> |
|
159 | + <span style="display: block; margin-bottom: 5px; color: #888;">Created By: <strong>' . htmlentities(empty($post['user_fullname']) ? '' : $post['user_fullname']).'</strong></span> |
|
160 | 160 | <br> |
161 | - <span style="display: block; color: #888;">' . dol_print_date((empty($post['date_creation']) ? dol_now() : $post['date_creation']), 'daytext', 'tzserver', $langs) . '</span> |
|
161 | + <span style="display: block; color: #888;">' . dol_print_date((empty($post['date_creation']) ? dol_now() : $post['date_creation']), 'daytext', 'tzserver', $langs).'</span> |
|
162 | 162 | </div> |
163 | 163 | <div style="flex-shrink: 0; margin-left: 100px; float: right;"> |
164 | - ' . (!empty($post['image']) ? '<img alt="Image" width="130px" height="130px" style="border-radius: 10px;" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=medias&file=' . htmlentities($post['image']) . '">' : '<img alt="Gray rectangle" width="130px" height="130px" style="border-radius: 10px;" src="__GRAY_RECTANGLE__">') . ' |
|
164 | + ' . (!empty($post['image']) ? '<img alt="Image" width="130px" height="130px" style="border-radius: 10px;" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=medias&file='.htmlentities($post['image']).'">' : '<img alt="Gray rectangle" width="130px" height="130px" style="border-radius: 10px;" src="__GRAY_RECTANGLE__">').' |
|
165 | 165 | </div> |
166 | 166 | </div>'; |
167 | 167 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | function dolStripPhpCode($str, $replacewith = '') |
35 | 35 | { |
36 | - $str = str_replace('<?=', '<?php echo', $str); // replace a bad practive |
|
36 | + $str = str_replace('<?=', '<?php echo', $str); // replace a bad practive |
|
37 | 37 | |
38 | 38 | $newstr = ''; |
39 | 39 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | { |
80 | 80 | $str = str_replace('<?=', '<?php echo', $str); |
81 | 81 | $str = str_replace('<?php', '__LTINTPHP__', $str); |
82 | - $str = str_replace('<?', '<?php', $str); // replace the short_open_tag. It is recommended to set this to Off in php.ini |
|
82 | + $str = str_replace('<?', '<?php', $str); // replace the short_open_tag. It is recommended to set this to Off in php.ini |
|
83 | 83 | $str = str_replace('__LTINTPHP__', '<?php', $str); |
84 | 84 | |
85 | 85 | $newstr = ''; |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | global $db, $langs, $conf, $user; |
287 | 287 | global $dolibarr_main_url_root, $dolibarr_main_data_root; |
288 | 288 | global $website; |
289 | - global $includehtmlcontentopened; // $includehtmlcontentopened is the level of includes (start at 0 for main page, 1 for first level include, ...) |
|
289 | + global $includehtmlcontentopened; // $includehtmlcontentopened is the level of includes (start at 0 for main page, 1 for first level include, ...) |
|
290 | 290 | '@phan-var-force Website $website'; |
291 | 291 | |
292 | 292 | $nbrep = 0; |
@@ -332,9 +332,9 @@ discard block |
||
332 | 332 | // at end we replace the '!~!~!~' only if we are in final parent page. |
333 | 333 | $content = preg_replace('/(href=")\/?([^:\"\!]*)\.php\?([^#\"<>]*)(#[^\"<>]*)?\"/', '\1!~!~!~'.DOL_URL_ROOT.'/public/website/index.php?website='.$website->ref.'&pageref=\2&\3\4"', $content, -1, $nbrep); |
334 | 334 | // Replace occurrence like _service_XXX.php with dolibarr URL |
335 | - $content = preg_replace('/([\'"])_service_([^\'"]+)\.php\1/', '\1!~!~!~' . DOL_URL_ROOT . '/public/website/index.php?website=' . $website->ref . '&pageref=_service_\2\1', $content, -1, $nbrep); |
|
335 | + $content = preg_replace('/([\'"])_service_([^\'"]+)\.php\1/', '\1!~!~!~'.DOL_URL_ROOT.'/public/website/index.php?website='.$website->ref.'&pageref=_service_\2\1', $content, -1, $nbrep); |
|
336 | 336 | // Replace occurrence like _library_XXX.php with dolibarr URL |
337 | - $content = preg_replace('/([\'"])_library_([^\'"]+)\.php\1/', '\1!~!~!~' . DOL_URL_ROOT . '/public/website/index.php?website=' . $website->ref . '&pageref=_library_\2\1', $content, -1, $nbrep); |
|
337 | + $content = preg_replace('/([\'"])_library_([^\'"]+)\.php\1/', '\1!~!~!~'.DOL_URL_ROOT.'/public/website/index.php?website='.$website->ref.'&pageref=_library_\2\1', $content, -1, $nbrep); |
|
338 | 338 | // Replace relative link without .php like /xxx#aaa or /xxx with dolibarr URL: ...href="....php" |
339 | 339 | $content = preg_replace('/(href=")\/?([a-zA-Z0-9\-_#]+)(\"|\?)/', '\1!~!~!~'.DOL_URL_ROOT.'/public/website/index.php?website='.$website->ref.'&pageref=\2\3', $content, -1, $nbrep); |
340 | 340 | |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | } |
433 | 433 | |
434 | 434 | if (getDolGlobalString('WEBSITE_ADD_CSS_TO_BODY')) { |
435 | - $content = str_replace('<body id="bodywebsite" class="bodywebsite', '<body id="bodywebsite" class="bodywebsite ' . getDolGlobalString('WEBSITE_ADD_CSS_TO_BODY'), $content); |
|
435 | + $content = str_replace('<body id="bodywebsite" class="bodywebsite', '<body id="bodywebsite" class="bodywebsite '.getDolGlobalString('WEBSITE_ADD_CSS_TO_BODY'), $content); |
|
436 | 436 | } |
437 | 437 | |
438 | 438 | $content = dolReplaceSmileyCodeWithUTF8($content); |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | $sql .= " WHERE rowid = ".((int) $websiteid); |
470 | 470 | |
471 | 471 | $resql = $db->query($sql); |
472 | - if (! $resql) { |
|
472 | + if (!$resql) { |
|
473 | 473 | return -1; |
474 | 474 | } |
475 | 475 | } |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | unset($tmpwebsitepage); |
559 | 559 | } |
560 | 560 | if ($result > 0) { |
561 | - $currenturi = $_SERVER["REQUEST_URI"]; // Example: /public/website/index.php?website=mywebsite.com&pageref=mywebsite-home&cache=3600 |
|
561 | + $currenturi = $_SERVER["REQUEST_URI"]; // Example: /public/website/index.php?website=mywebsite.com&pageref=mywebsite-home&cache=3600 |
|
562 | 562 | $regtmp = array(); |
563 | 563 | if (preg_match('/&pageref=([^&]+)/', $currenturi, $regtmp)) { |
564 | 564 | if ($regtmp[0] == $containerref) { |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | if ($newurl) { |
582 | 582 | if (!empty($parameters)) { |
583 | 583 | $separator = (parse_url($newurl, PHP_URL_QUERY) == null) ? '?' : '&'; |
584 | - $newurl = $newurl . $separator . http_build_query($parameters); |
|
584 | + $newurl = $newurl.$separator.http_build_query($parameters); |
|
585 | 585 | } |
586 | 586 | if ($permanent) { |
587 | 587 | header("Status: 301 Moved Permanently", false, 301); |
@@ -946,7 +946,7 @@ discard block |
||
946 | 946 | $hashtags = trim(implode(' #', array_map('trim', explode(',', $websitepage->keywords)))); |
947 | 947 | |
948 | 948 | // Open Graph |
949 | - $out .= '<meta name="og:type" content="website">'."\n"; // TODO If blogpost, use type article |
|
949 | + $out .= '<meta name="og:type" content="website">'."\n"; // TODO If blogpost, use type article |
|
950 | 950 | $out .= '<meta name="og:title" content="'.$websitepage->title.'">'."\n"; |
951 | 951 | if ($websitepage->image) { |
952 | 952 | $out .= '<meta name="og:image" content="'.$website->virtualhost.$image.'">'."\n"; |
@@ -1058,9 +1058,9 @@ discard block |
||
1058 | 1058 | $sql = "SELECT COUNT(rowid) as nb"; |
1059 | 1059 | $sql .= " FROM ".MAIN_DB_PREFIX."ecm_files"; |
1060 | 1060 | $sql .= " WHERE entity IN (".getEntity($object->element).")"; |
1061 | - $sql .= " AND src_object_type = '".$db->escape($object->element)."' AND src_object_id = ".((int) $object->id); // Filter on object |
|
1061 | + $sql .= " AND src_object_type = '".$db->escape($object->element)."' AND src_object_id = ".((int) $object->id); // Filter on object |
|
1062 | 1062 | $sql .= " AND ".$db->regexpsql('filename', $regexforimg, 1); |
1063 | - $sql .= " AND share IS NOT NULL"; // Only image that are public |
|
1063 | + $sql .= " AND share IS NOT NULL"; // Only image that are public |
|
1064 | 1064 | |
1065 | 1065 | $resql = $db->query($sql); |
1066 | 1066 | if ($resql) { |
@@ -1097,7 +1097,7 @@ discard block |
||
1097 | 1097 | $sql = "SELECT rowid, ref, share, filename, cover, position"; |
1098 | 1098 | $sql .= " FROM ".MAIN_DB_PREFIX."ecm_files"; |
1099 | 1099 | $sql .= " WHERE entity IN (".getEntity($object->element).")"; |
1100 | - $sql .= " AND src_object_type = '".$db->escape($object->element)."' AND src_object_id = ".((int) $object->id); // Filter on object |
|
1100 | + $sql .= " AND src_object_type = '".$db->escape($object->element)."' AND src_object_id = ".((int) $object->id); // Filter on object |
|
1101 | 1101 | $sql .= " AND ".$db->regexpsql('filename', $regexforimg, 1); |
1102 | 1102 | $sql .= ($cover ? "" : " AND cover <> 1"); |
1103 | 1103 | if ($cover == 1) { |
@@ -1398,7 +1398,7 @@ discard block |
||
1398 | 1398 | |
1399 | 1399 | $dom = new DOMDocument(); |
1400 | 1400 | |
1401 | - libxml_use_internal_errors(false); // Avoid to fill memory with xml errors |
|
1401 | + libxml_use_internal_errors(false); // Avoid to fill memory with xml errors |
|
1402 | 1402 | if (LIBXML_VERSION < 20900) { |
1403 | 1403 | // Avoid load of external entities (security problem). |
1404 | 1404 | // Required only if LIBXML_VERSION < 20900 |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | |
712 | 712 | // Add also company main email |
713 | 713 | if (getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) { |
714 | - $s = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? $conf->global->MAIN_INFO_SOCIETE_EMAIL : $conf->global->MAIN_INFO_SOCIETE_NOM).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
714 | + $s = (!getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? $conf->global->MAIN_INFO_SOCIETE_EMAIL : $conf->global->MAIN_INFO_SOCIETE_NOM).' <'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; |
|
715 | 715 | $liste['company'] = array('label' => $s, 'data-html' => $s); |
716 | 716 | } |
717 | 717 | |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | if (getDolGlobalString('MAIN_MAIL_EMAIL_FROM') && getDolGlobalString('MAIN_MAIL_EMAIL_FROM') != getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) { |
732 | 732 | $s = getDolGlobalString('MAIN_MAIL_EMAIL_FROM'); |
733 | 733 | if ($this->frommail) { |
734 | - $s .= ' <' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'>'; |
|
734 | + $s .= ' <'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'>'; |
|
735 | 735 | } |
736 | 736 | $liste['main_from'] = array('label' => $s, 'data-html' => $s); |
737 | 737 | } |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | $maxfilesizearray = getMaxFileSizeArray(); |
970 | 970 | $maxmin = $maxfilesizearray['maxmin']; |
971 | 971 | if ($maxmin > 0) { |
972 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
972 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
973 | 973 | } |
974 | 974 | // Can add other files |
975 | 975 | if (!getDolGlobalString('FROM_MAIL_DONT_USE_INPUT_FILE_MULTIPLE')) { |
@@ -1989,7 +1989,7 @@ discard block |
||
1989 | 1989 | } |
1990 | 1990 | } |
1991 | 1991 | |
1992 | - $this->substit_lines[$line->id] = $substit_line; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
1992 | + $this->substit_lines[$line->id] = $substit_line; // @phan-suppress-current-line PhanTypeMismatchProperty |
|
1993 | 1993 | } |
1994 | 1994 | } |
1995 | 1995 | } |
@@ -2037,7 +2037,7 @@ discard block |
||
2037 | 2037 | $tmparray['__OTHER4__'] = 'Other4'; |
2038 | 2038 | $tmparray['__OTHER5__'] = 'Other5'; |
2039 | 2039 | |
2040 | - $tmparray['__THIRDPARTY_CUSTOMER_CODE__'] = 'CustomerCode'; // If source is a thirdparty |
|
2040 | + $tmparray['__THIRDPARTY_CUSTOMER_CODE__'] = 'CustomerCode'; // If source is a thirdparty |
|
2041 | 2041 | |
2042 | 2042 | $tmparray['__CHECK_READ__'] = $langs->trans('TagCheckMail'); |
2043 | 2043 | $tmparray['__UNSUBSCRIBE__'] = $langs->trans('TagUnsubscribe'); |