@@ -46,13 +46,13 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $dir = 'images/'; |
| 48 | 48 | $f = "$type-$size.png"; |
| 49 | - if ($icone = find_in_theme($dir . $f)) { |
|
| 49 | + if ($icone = find_in_theme($dir.$f)) { |
|
| 50 | 50 | $dir = dirname($icone); |
| 51 | 51 | $fond = $icone; |
| 52 | 52 | |
| 53 | 53 | if ( |
| 54 | 54 | $rtl |
| 55 | - && ($fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename($icone))) |
|
| 55 | + && ($fr = $dir.'/'.str_replace("$type-", "$type-rtl-", basename($icone))) |
|
| 56 | 56 | && file_exists($fr) |
| 57 | 57 | ) { |
| 58 | 58 | $fond = $fr; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $fonction = ''; |
| 71 | - if (in_array($action, ['add','del', 'new', 'edit', 'config'])) { |
|
| 71 | + if (in_array($action, ['add', 'del', 'new', 'edit', 'config'])) { |
|
| 72 | 72 | $fonction = $action; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | if (isset($data[$root])) { # pas de racine sauf pour les rubriques |
| 143 | 143 | $r = "<option$selected value='$root' class='$class' style='$style'>$espace" |
| 144 | 144 | . $data[$root] |
| 145 | - . '</option>' . "\n"; |
|
| 145 | + . '</option>'."\n"; |
|
| 146 | 146 | } else { |
| 147 | 147 | $r = ''; |
| 148 | 148 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | // et voila le travail |
| 173 | - return $r . $sous; |
|
| 173 | + return $r.$sous; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
@@ -218,12 +218,12 @@ discard block |
||
| 218 | 218 | while ($r = sql_fetch($q)) { |
| 219 | 219 | if (autoriser('voir', 'rubrique', $r['id_rubrique'])) { |
| 220 | 220 | // titre largeur maxi a 50 |
| 221 | - $titre = couper(supprimer_tags(typo($r['titre'])) . ' ', 50); |
|
| 221 | + $titre = couper(supprimer_tags(typo($r['titre'])).' ', 50); |
|
| 222 | 222 | if ( |
| 223 | 223 | $GLOBALS['meta']['multi_rubriques'] == 'oui' |
| 224 | 224 | && ($r['langue_choisie'] == 'oui' || $r['id_parent'] == 0) |
| 225 | 225 | ) { |
| 226 | - $titre .= ' [' . traduire_nom_langue($r['lang']) . ']'; |
|
| 226 | + $titre .= ' ['.traduire_nom_langue($r['lang']).']'; |
|
| 227 | 227 | } |
| 228 | 228 | $data[$r['id_rubrique']] = $titre; |
| 229 | 229 | $enfants[$r['id_parent']][] = $r['id_rubrique']; |
@@ -250,9 +250,9 @@ discard block |
||
| 250 | 250 | $att = " id='id_parent' name='id_parent'\nclass='selecteur_parent verdana1'"; |
| 251 | 251 | |
| 252 | 252 | if (preg_match(',^<option[^<>]*value=.(\d*).[^<>]*>([^<]*)</option>$,', $opt, $r)) { |
| 253 | - $r = "<input$att type='hidden' value='" . $r[1] . "' />" . $r[2]; |
|
| 253 | + $r = "<input$att type='hidden' value='".$r[1]."' />".$r[2]; |
|
| 254 | 254 | } else { |
| 255 | - $r = '<select' . $att . " size='1'>\n$opt</select>\n"; |
|
| 255 | + $r = '<select'.$att." size='1'>\n$opt</select>\n"; |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | # message pour neuneus (a supprimer ?) |
@@ -294,13 +294,13 @@ discard block |
||
| 294 | 294 | function selecteur_rubrique_ajax($id_rubrique, $type, $restreint, $idem = 0, $do = 'aff') { |
| 295 | 295 | |
| 296 | 296 | if ($id_rubrique) { |
| 297 | - $titre = sql_getfetsel('titre', 'spip_rubriques', 'id_rubrique=' . (int) $id_rubrique); |
|
| 297 | + $titre = sql_getfetsel('titre', 'spip_rubriques', 'id_rubrique='.(int) $id_rubrique); |
|
| 298 | 298 | } else { |
| 299 | 299 | $titre = $type == 'auteur' ? ' ' : _T('info_racine_site'); |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | $titre = str_replace('&', '&', entites_html(textebrut(typo($titre)))); |
| 303 | - $init = " disabled='disabled' type='text' value=\"" . $titre . "\"\nstyle='width:300px;'"; |
|
| 303 | + $init = " disabled='disabled' type='text' value=\"".$titre."\"\nstyle='width:300px;'"; |
|
| 304 | 304 | |
| 305 | 305 | $url = generer_url_ecrire('selectionner', "id=$id_rubrique&type=$type&do=$do" |
| 306 | 306 | . ($idem ? "&exclus=$idem" : '') |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | . " jQuery(this).toggleClass('toggled'); " |
| 350 | 350 | . "return charger_node_url_si_vide('" |
| 351 | 351 | . $url |
| 352 | - . "', this.parentNode.nextSibling, this.nextSibling,'',event)\" title='" . attribut_html(_T('titre_image_selecteur')) . "'>" |
|
| 352 | + . "', this.parentNode.nextSibling, this.nextSibling,'',event)\" title='".attribut_html(_T('titre_image_selecteur'))."'>" |
|
| 353 | 353 | . $img_icone |
| 354 | 354 | . "</a><img src='" |
| 355 | 355 | . chemin_image('loader.svg') |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | $champs[] = 'virtuel'; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $data = sql_fetsel('*', $desc['table'], $_id_table . '=' . (int) $id_trad); |
|
| 57 | + $data = sql_fetsel('*', $desc['table'], $_id_table.'='.(int) $id_trad); |
|
| 58 | 58 | |
| 59 | 59 | foreach ($champs as $c) { |
| 60 | 60 | $set[$c] = $data[$c]; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | // si spip_log() est appelé dans mes_options, toutes les constantes n'ont pas été définies |
| 36 | 36 | $logfile = |
| 37 | - ($logdir ?? (defined('_DIR_LOG') ? _DIR_LOG : _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES)) |
|
| 37 | + ($logdir ?? (defined('_DIR_LOG') ? _DIR_LOG : _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES)) |
|
| 38 | 38 | . $logname |
| 39 | 39 | . ($logsuf ?? (defined('_FILE_LOG_SUFFIX') ? _FILE_LOG_SUFFIX : '.log')); |
| 40 | 40 | |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | // Si le repertoire défini n'existe pas, poser dans tmp/ |
| 52 | 52 | if (!$test_repertoire[$d]) { |
| 53 | - $logfile = _DIR_RACINE . _NOM_TEMPORAIRES_INACCESSIBLES . $logname . '.log'; |
|
| 53 | + $logfile = _DIR_RACINE._NOM_TEMPORAIRES_INACCESSIBLES.$logname.'.log'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $rotate = 0; |
| 57 | - $pid = '(pid ' . @getmypid() . ')'; |
|
| 57 | + $pid = '(pid '.@getmypid().')'; |
|
| 58 | 58 | |
| 59 | 59 | // accepter spip_log( Array ) |
| 60 | 60 | if (!is_string($message)) { |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | $fi = substr($fi, strlen(_ROOT_RACINE)); |
| 70 | 70 | } |
| 71 | 71 | $fu = $debug[2]['function'] ?? ''; |
| 72 | - $debugverb = "$fi:L$l:$fu" . '():'; |
|
| 72 | + $debugverb = "$fi:L$l:$fu".'():'; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $m = date('Y-m-d H:i:s') . ' ' . ($GLOBALS['ip'] ?? '') . ' ' . $pid . ' ' |
|
| 75 | + $m = date('Y-m-d H:i:s').' '.($GLOBALS['ip'] ?? '').' '.$pid.' ' |
|
| 76 | 76 | //distinguer les logs prives et publics dans les grep |
| 77 | 77 | . $debugverb |
| 78 | 78 | . (test_espace_prive() ? ':Pri:' : ':Pub:') |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | if ( |
| 97 | 97 | $rotate-- > 0 && function_exists('spip_unlink') |
| 98 | 98 | ) { |
| 99 | - spip_unlink($logfile . '.' . $rotate); |
|
| 99 | + spip_unlink($logfile.'.'.$rotate); |
|
| 100 | 100 | while ($rotate--) { |
| 101 | - @rename($logfile . ($rotate ? '.' . $rotate : ''), $logfile . '.' . ($rotate + 1)); |
|
| 101 | + @rename($logfile.($rotate ? '.'.$rotate : ''), $logfile.'.'.($rotate + 1)); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | $arg = parametre_url($url_action, 'arg'); |
| 95 | - $confirm = md5("$action:$arg:" . realpath(__FILE__)); |
|
| 95 | + $confirm = md5("$action:$arg:".realpath(__FILE__)); |
|
| 96 | 96 | if (_request('confirm_action') === $confirm) { |
| 97 | 97 | return true; |
| 98 | 98 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } else { |
| 146 | 146 | return generer_url_action( |
| 147 | 147 | $action, |
| 148 | - 'arg=' . rawurlencode($arg) . "&hash=$hash" . ($r ? "&redirect=$r" : ''), |
|
| 148 | + 'arg='.rawurlencode($arg)."&hash=$hash".($r ? "&redirect=$r" : ''), |
|
| 149 | 149 | $mode, |
| 150 | 150 | $public |
| 151 | 151 | ); |
@@ -156,9 +156,9 @@ discard block |
||
| 156 | 156 | $hash = calculer_action_auteur("$action-$arg"); |
| 157 | 157 | $att .= " style='margin: 0px; border: 0px'"; |
| 158 | 158 | if ($redirect) { |
| 159 | - $redirect = "\n\t\t<input name='redirect' type='hidden' value='" . str_replace("'", ''', $redirect) . "' />"; |
|
| 159 | + $redirect = "\n\t\t<input name='redirect' type='hidden' value='".str_replace("'", ''', $redirect)."' />"; |
|
| 160 | 160 | } |
| 161 | - $mode .= $redirect . " |
|
| 161 | + $mode .= $redirect." |
|
| 162 | 162 | <input name='hash' type='hidden' value='$hash' /> |
| 163 | 163 | <input name='arg' type='hidden' value='$arg' />"; |
| 164 | 164 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | $pass ??= ''; |
| 227 | 227 | $entry = "$action:$id_auteur:$pass:$alea"; |
| 228 | 228 | if (!isset($sha[$entry])) { |
| 229 | - $sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::" . _action_get_alea($alea)); |
|
| 229 | + $sha[$entry] = hash_hmac('sha256', "$action::$id_auteur", "$pass::"._action_get_alea($alea)); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | return $sha[$entry]; |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | // On nettoie l’URL de tous les var_. |
| 337 | 337 | $url = nettoyer_uri_var($url); |
| 338 | 338 | |
| 339 | - $token = _action_auteur('previsualiser-' . $url, $id_auteur, secret_du_site(), $alea); |
|
| 339 | + $token = _action_auteur('previsualiser-'.$url, $id_auteur, secret_du_site(), $alea); |
|
| 340 | 340 | return "$id_auteur-$token"; |
| 341 | 341 | } |
| 342 | 342 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | ]; |
| 43 | 43 | $options = array_merge($defaut, $options); |
| 44 | 44 | if (is_numeric($options['expires']) && $options['expires'] > 0) { |
| 45 | - $options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']) . ' GMT'; |
|
| 45 | + $options['expires'] = gmdate('D, d M Y H:i:s', time() + $options['expires']).' GMT'; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | if (is_null($options) && isset($_SERVER['HTTP_RANGE'])) { |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | function spip_livrer_fichier_entetes($fichier, $content_type = 'application/octet-stream', $attachment = false, $expires = 0) { |
| 72 | 72 | // toujours envoyer un content type, meme vide ! |
| 73 | 73 | header('Accept-Ranges: bytes'); |
| 74 | - header('Content-Type: ' . $content_type); |
|
| 74 | + header('Content-Type: '.$content_type); |
|
| 75 | 75 | |
| 76 | 76 | if (($fs = stat($fichier)) && !empty($fs['size']) && !empty($fs['mtime'])) { |
| 77 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $fs['mtime']) . ' GMT'); |
|
| 77 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', $fs['mtime']).' GMT'); |
|
| 78 | 78 | header(sprintf('Etag: "%x-%x"', $fs['size'], str_pad($fs['mtime'], 16, '0'))); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | else { |
| 95 | 95 | $f = (is_string($attachment) ? $attachment : basename($fichier)); |
| 96 | 96 | header("Content-Disposition: inline; filename=\"$f\";"); |
| 97 | - header('Expires: ' . $expires); // set expiration time |
|
| 97 | + header('Expires: '.$expires); // set expiration time |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
@@ -146,12 +146,12 @@ discard block |
||
| 146 | 146 | // Parse Content-Range header for byte offsets, looks like "bytes=11525-" OR "bytes=11525-12451" |
| 147 | 147 | if ($range && preg_match('%bytes=(\d+)-(\d+)?%i', $range, $match)) { |
| 148 | 148 | ### Offset signifies where we should begin to read the file |
| 149 | - $byteOffset = (int)$match[1]; |
|
| 149 | + $byteOffset = (int) $match[1]; |
|
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | ### Length is for how long we should read the file according to the browser, and can never go beyond the file size |
| 153 | 153 | if (isset($match[2])) { |
| 154 | - $finishBytes = (int)$match[2]; |
|
| 154 | + $finishBytes = (int) $match[2]; |
|
| 155 | 155 | $byteLength = $finishBytes + 1; |
| 156 | 156 | } else { |
| 157 | 157 | $finishBytes = $fileSize - 1; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | // partial content |
| 174 | 174 | header('HTTP/1.1 206 Partial content'); |
| 175 | - header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent |
|
| 175 | + header($cr_header); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent |
|
| 176 | 176 | |
| 177 | 177 | |
| 178 | 178 | $byteRange = $byteLength - $byteOffset; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | return $fichier; |
| 56 | 56 | } |
| 57 | 57 | if (!file_exists($fichier)) { |
| 58 | - $fichier = supprimer_timestamp($fichier); |
|
| 58 | + $fichier = supprimer_timestamp($fichier); |
|
| 59 | 59 | if (!file_exists($fichier)) { |
| 60 | 60 | return false; |
| 61 | 61 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | function svg_change_balise_svg($svg, $old_balise_svg, $attributs) { |
| 146 | 146 | $new_balise_svg = '<svg'; |
| 147 | 147 | foreach ($attributs as $k => $v) { |
| 148 | - $new_balise_svg .= " $k=\"" . entites_html($v) . '"'; |
|
| 148 | + $new_balise_svg .= " $k=\"".entites_html($v).'"'; |
|
| 149 | 149 | } |
| 150 | 150 | $new_balise_svg .= '>'; |
| 151 | 151 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | function svg_insert_shapes($svg, $shapes, $start = true) { |
| 164 | 164 | |
| 165 | 165 | if ($start === false || $start === 'end') { |
| 166 | - $svg = str_replace('</svg>', $shapes . '</svg>', $svg); |
|
| 166 | + $svg = str_replace('</svg>', $shapes.'</svg>', $svg); |
|
| 167 | 167 | } |
| 168 | 168 | else { |
| 169 | 169 | $p = stripos($svg, '<svg'); |
@@ -184,10 +184,10 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | function svg_clip_in_box($svg, $x, $y, $width, $height) { |
| 186 | 186 | $rect = "<rect x=\"$x\" y=\"$y\" width=\"$width\" height=\"$height\" />"; |
| 187 | - $id = 'clip-' . substr(md5($rect . strlen($svg)), 0, 8); |
|
| 187 | + $id = 'clip-'.substr(md5($rect.strlen($svg)), 0, 8); |
|
| 188 | 188 | $clippath = "<clipPath id=\"$id\">$rect</clipPath>"; |
| 189 | 189 | $g = "<g clip-path=\"url(#$id)\">"; |
| 190 | - $svg = svg_insert_shapes($svg, $clippath . $g); |
|
| 190 | + $svg = svg_insert_shapes($svg, $clippath.$g); |
|
| 191 | 191 | return svg_insert_shapes($svg, '</g>', false); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | ) { |
| 206 | 206 | [$balise_svg, $attributs] = $svg_infos; |
| 207 | 207 | if (!isset($attributs['viewBox'])) { |
| 208 | - $attributs['viewBox'] = '0 0 ' . $attributs['width'] . ' ' . $attributs['height']; |
|
| 208 | + $attributs['viewBox'] = '0 0 '.$attributs['width'].' '.$attributs['height']; |
|
| 209 | 209 | } |
| 210 | 210 | $attributs['width'] = (string) $new_width; |
| 211 | 211 | $attributs['height'] = (string) $new_height; |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | else { |
| 229 | 229 | $couleur = couleur_html_to_hex($couleur); |
| 230 | 230 | } |
| 231 | - return '#' . ltrim($couleur, '#'); |
|
| 231 | + return '#'.ltrim($couleur, '#'); |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /** |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | function svg_couleur_to_rgb($couleur) { |
| 240 | 240 | if (str_starts_with($couleur, 'rgb(')) { |
| 241 | 241 | $c = explode(',', substr($couleur, 4)); |
| 242 | - return ['red' => (int) $c[0],'green' => (int) $c[1],'blue' => (int) $c[2]]; |
|
| 242 | + return ['red' => (int) $c[0], 'green' => (int) $c[1], 'blue' => (int) $c[2]]; |
|
| 243 | 243 | } |
| 244 | 244 | return _couleur_hex_to_dec($couleur); |
| 245 | 245 | } |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $background_color = svg_couleur_to_hexa($background_color); |
| 454 | 454 | if (isset($attributs['viewBox'])) { |
| 455 | 455 | $viewBox = explode(' ', $attributs['viewBox']); |
| 456 | - $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>"; |
|
| 456 | + $rect = '<rect x="'.$viewBox[0].'" y="'.$viewBox[1].'" width="'.$viewBox[2].'" height="'.$viewBox[3]."\" fill=\"$background_color\"/>"; |
|
| 457 | 457 | } |
| 458 | 458 | else { |
| 459 | 459 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | $background_color = svg_couleur_to_hexa($background_color); |
| 484 | 484 | if (isset($attributs['viewBox'])) { |
| 485 | 485 | $viewBox = explode(' ', $attributs['viewBox']); |
| 486 | - $rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
|
| 486 | + $rect = '<rect x="'.$viewBox[0].'" y="'.$viewBox[1].'" width="'.$viewBox[2].'" height="'.$viewBox[3]."\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
|
| 487 | 487 | } |
| 488 | 488 | else { |
| 489 | 489 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | $g = '<g'; |
| 513 | 513 | foreach ($attributs as $k => $v) { |
| 514 | 514 | if (strlen($v)) { |
| 515 | - $g .= " $k=\"" . attribut_html($v) . '"'; |
|
| 515 | + $g .= " $k=\"".attribut_html($v).'"'; |
|
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | 518 | if (strlen($g) > 2) { |
@@ -540,10 +540,10 @@ discard block |
||
| 540 | 540 | ) { |
| 541 | 541 | if ($filter_def) { |
| 542 | 542 | [$balise_svg, ] = $svg_infos; |
| 543 | - $filter_id = 'filter-' . substr(md5($filter_def . strlen($svg)), 0, 8); |
|
| 543 | + $filter_id = 'filter-'.substr(md5($filter_def.strlen($svg)), 0, 8); |
|
| 544 | 544 | $filter = "<defs><filter id=\"$filter_id\">$filter_def</filter></defs>"; |
| 545 | 545 | $g = "<g filter=\"url(#$filter_id)\">"; |
| 546 | - $svg = svg_insert_shapes($svg, $filter . $g); |
|
| 546 | + $svg = svg_insert_shapes($svg, $filter.$g); |
|
| 547 | 547 | $svg = svg_insert_shapes($svg, '</g>', false); |
| 548 | 548 | } |
| 549 | 549 | return $svg; |
@@ -65,17 +65,17 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $page_title = ($options['page_title'] ?? $GLOBALS['meta']['nom_site']); |
| 67 | 67 | $doctype = ($options['doctype'] ?? '<!DOCTYPE html>'); |
| 68 | - $doctype = trim($doctype) . "\n"; |
|
| 68 | + $doctype = trim($doctype)."\n"; |
|
| 69 | 69 | $charset = ($options['charset'] ?? 'utf-8'); |
| 70 | 70 | $all_inline = ($options['all_inline'] ?? true); |
| 71 | 71 | $onLoad = ($options['onLoad'] ?? ''); |
| 72 | 72 | if ($onLoad) { |
| 73 | - $onLoad = ' onload="' . attribut_html($onLoad) . '"'; |
|
| 73 | + $onLoad = ' onload="'.attribut_html($onLoad).'"'; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | # envoyer le charset |
| 77 | 77 | if (!headers_sent()) { |
| 78 | - header('Content-Type: text/html; charset=' . $charset); |
|
| 78 | + header('Content-Type: text/html; charset='.$charset); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | $css = ''; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | . "--minipage-color-theme--s: $s;" |
| 95 | 95 | . "--minipage-color-theme--l: $l;}"; |
| 96 | 96 | $vars = file_get_contents(find_in_theme('minipage.vars.css')); |
| 97 | - $inline .= "\n" . trim($vars); |
|
| 97 | + $inline .= "\n".trim($vars); |
|
| 98 | 98 | if (function_exists('minifier')) { |
| 99 | 99 | $inline = minifier($inline, 'css'); |
| 100 | 100 | } |
@@ -121,31 +121,31 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | $css = "$inline\n$css"; |
| 123 | 123 | if (!empty($options['css'])) { |
| 124 | - $css .= "\n" . $options['css']; |
|
| 124 | + $css .= "\n".$options['css']; |
|
| 125 | 125 | } |
| 126 | 126 | $css = "<style type='text/css'>$css</style>"; |
| 127 | 127 | } else { |
| 128 | 128 | $css = "<style type='text/css'>$inline</style>"; |
| 129 | 129 | foreach ($files as $name) { |
| 130 | 130 | $file = timestamp(direction_css($name)); |
| 131 | - $css .= "<link rel='stylesheet' href='" . attribut_html($file) . "' type='text/css' />\n"; |
|
| 131 | + $css .= "<link rel='stylesheet' href='".attribut_html($file)."' type='text/css' />\n"; |
|
| 132 | 132 | } |
| 133 | 133 | if (!empty($options['css'])) { |
| 134 | - $css .= "<style type='text/css'>" . $options['css'] . '</style>'; |
|
| 134 | + $css .= "<style type='text/css'>".$options['css'].'</style>'; |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - return $doctype . |
|
| 139 | - html_lang_attributes() . |
|
| 140 | - "<head>\n" . |
|
| 141 | - '<title>' . |
|
| 142 | - textebrut($page_title) . |
|
| 143 | - "</title>\n" . |
|
| 144 | - "<meta name=\"viewport\" content=\"width=device-width\" />\n" . |
|
| 145 | - $css . |
|
| 146 | - (empty($options['head']) ? '' : $options['head']) . |
|
| 147 | - "</head>\n" . |
|
| 148 | - "<body{$onLoad} class=\"minipage" . ($this::TYPE ? ' minipage--' . $this::TYPE : '') . "\">\n" . |
|
| 138 | + return $doctype. |
|
| 139 | + html_lang_attributes(). |
|
| 140 | + "<head>\n". |
|
| 141 | + '<title>'. |
|
| 142 | + textebrut($page_title). |
|
| 143 | + "</title>\n". |
|
| 144 | + "<meta name=\"viewport\" content=\"width=device-width\" />\n". |
|
| 145 | + $css. |
|
| 146 | + (empty($options['head']) ? '' : $options['head']). |
|
| 147 | + "</head>\n". |
|
| 148 | + "<body{$onLoad} class=\"minipage".($this::TYPE ? ' minipage--'.$this::TYPE : '')."\">\n". |
|
| 149 | 149 | "\t<div class=\"minipage-bloc\">\n"; |
| 150 | 150 | } |
| 151 | 151 | |
@@ -156,16 +156,16 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | protected function ouvreCorps($options = []) { |
| 158 | 158 | $url_site = url_de_base(); |
| 159 | - $header = "<header>\n" . |
|
| 160 | - '<h1><a href="' . attribut_html($url_site) . '">' . interdire_scripts($GLOBALS['meta']['nom_site'] ?? '') . "</a></h1>\n"; |
|
| 159 | + $header = "<header>\n". |
|
| 160 | + '<h1><a href="'.attribut_html($url_site).'">'.interdire_scripts($GLOBALS['meta']['nom_site'] ?? '')."</a></h1>\n"; |
|
| 161 | 161 | |
| 162 | 162 | $titre = ($options['titre'] ?? ''); |
| 163 | 163 | if ($titre) { |
| 164 | - $header .= '<h2>' . interdire_scripts($titre) . '</h2>'; |
|
| 164 | + $header .= '<h2>'.interdire_scripts($titre).'</h2>'; |
|
| 165 | 165 | } |
| 166 | 166 | $header .= '</header>'; |
| 167 | 167 | |
| 168 | - return $header . "<div class='corps'>\n"; |
|
| 168 | + return $header."<div class='corps'>\n"; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
@@ -179,13 +179,13 @@ discard block |
||
| 179 | 179 | if (isset($options['footer'])) { |
| 180 | 180 | $footer = $options['footer']; |
| 181 | 181 | } else { |
| 182 | - $footer = '<a href="' . attribut_html($url_site) . '">' . _T('retour') . "</a>\n"; |
|
| 182 | + $footer = '<a href="'.attribut_html($url_site).'">'._T('retour')."</a>\n"; |
|
| 183 | 183 | } |
| 184 | 184 | if (!empty($footer)) { |
| 185 | 185 | $footer = "<footer>\n{$footer}</footer>"; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - return "</div>\n" . $footer; |
|
| 188 | + return "</div>\n".$footer; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
@@ -109,13 +109,13 @@ |
||
| 109 | 109 | // generer un marqueur qui n'existe pas dans le texte |
| 110 | 110 | do { |
| 111 | 111 | $this->markId = substr(md5(uniqid(static::class, 1)), 0, 7); |
| 112 | - $this->markId = '@|' . static::$markPrefix . $this->markId . '|'; |
|
| 112 | + $this->markId = '@|'.static::$markPrefix.$this->markId.'|'; |
|
| 113 | 113 | } while (str_contains($texte, $this->markId)); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $offset_pos = 0; |
| 117 | 117 | foreach ($collection as $c) { |
| 118 | - $rempl = $this->markId . base64_encode($c['raw']) . '|@'; |
|
| 118 | + $rempl = $this->markId.base64_encode($c['raw']).'|@'; |
|
| 119 | 119 | $texte = substr_replace($texte, $rempl, $c['pos'] + $offset_pos, $c['length']); |
| 120 | 120 | $offset_pos += strlen($rempl) - $c['length']; |
| 121 | 121 | } |