Valider 8d59c576 rédigé par RealET's avatar RealET 👍
Parcourir les fichiers

style: un coup de PHPcbf + and → && ; or → || + valid snake case format

parent 4aae68eb
Chargement en cours
Chargement en cours
Chargement en cours
Chargement en cours
+9 −9
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
@@ -20,7 +20,7 @@ include_spip('action/editer_objet');
function soyezcreateurs_declarer_champs_extras($champs = []) {

	// Table : spip_articles
	if (!isset($champs['spip_articles']) or !is_array($champs['spip_articles'])) {
	if (!isset($champs['spip_articles']) || !is_array($champs['spip_articles'])) {
		$champs['spip_articles'] = [];
	}

@@ -627,7 +627,7 @@ function create_encart($titre, $identifiant, $largeur = 0, $hauteur = 0) {
		'identifiant=' . sql_quote($identifiant)
	);
	$id_encart = 0;
	if ($result !== false and is_array($result) and isset($result['id_encart'])) {
	if ($result !== false && is_array($result) && isset($result['id_encart'])) {
		$id_encart = $result['id_encart'];
	}
	$set = [
@@ -705,7 +705,7 @@ function create_document($chemin, $objet, $mode, $champs = 'non', $id_document =
	$type = ($objet['type'] ?? '');
	$id_objet = ($objet['id_objet'] ?? 0);
	spip_log(['tmp_name' => $chemin, 'name' => basename($chemin)], 'docusc');
	if ($id_document == 'non' and $chemin) {
	if ($id_document == 'non' && $chemin) {
		autoriser_exception('associerdocuments', $type, $id_objet);
		$id_document = action_ajouter_un_document_dist('non', ['tmp_name' => $chemin, 'name' => basename($chemin)], $type, $id_objet, $mode);
		autoriser_exception('associerdocuments', $type, $id_objet, false);
+24 −24
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
@@ -7,8 +7,8 @@
	// Les articles du site
<BOUCLE_ListeArticles(ARTICLES){par id_rubrique}>
	/* #TITRE* */
	if ($article == "[(#TITRE*|sc_NewLine2str)]") {
		$contenu\['titre'\] = "[(#TITRE*|sc_NewLine2str)]";[
	if ($article == "[(#TITRE*|sc_nl2str)]") {
		$contenu\['titre'\] = "[(#TITRE*|sc_nl2str)]";[
		$contenu\['virtuel'\] = "(#VIRTUEL*)";][
		$contenu\['descriptif'\] = <<<EOF
(#DESCRIPTIF*)
@@ -22,72 +22,72 @@ EOF;][
		$contenu\['ps'\] = <<<EOF
(#PS*)
EOF;][
		$contenu\['surtitre'\] = "(#SURTITRE*|sc_NewLine2str)";][
		$contenu\['soustitre'\] = "(#SOUSTITRE*|sc_NewLine2str)";][
		$contenu\['nom_site'\] = "(#NOM_SITE*|sc_NewLine2str)";][
		$contenu\['url_site'\] = "(#URL_SITE*|sc_NewLine2str)";]
		$contenu\['surtitre'\] = "(#SURTITRE*|sc_nl2str)";][
		$contenu\['soustitre'\] = "(#SOUSTITRE*|sc_nl2str)";][
		$contenu\['nom_site'\] = "(#NOM_SITE*|sc_nl2str)";][
		$contenu\['url_site'\] = "(#URL_SITE*|sc_nl2str)";]
	}
</BOUCLE_ListeArticles>

	// Structure et contenu du site
<BOUCLE_ListeRubriques(RUBRIQUES){racine}{par num titre}{tout}>
	$id_rubrique = create_rubrique("[(#TITRE*|sc_NewLine2str)]", '0', "[(#DESCRIPTIF*|sc_NewLine2str)]");[
	$id_rubrique = create_rubrique("[(#TITRE*|sc_nl2str)]", '0', "[(#DESCRIPTIF*|sc_nl2str)]");[
		create_logo('documents/(#LOGO_RURIQUE_NORMAL|fichier)', $type='rub', $id_rubrique, '[(#LOGO_RURIQUE_NORMAL|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]');][
		create_logo('documents/(#LOGO_RURIQUE_SURVOL|fichier)', $type='rub', $id_rubrique, '[(#LOGO_RURIQUE_SURVOL|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]','off');][(#REM)
	]<BOUCLE_MotsRub(MOTS){id_rubrique}>
		create_rubrique_mot("[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_NewLine2str)]", "[(#TITRE*|sc_NewLine2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_NewLine2str)]");[(#REM)
		create_rubrique_mot("[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_nl2str)]", "[(#TITRE*|sc_nl2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_nl2str)]");[(#REM)
	]</BOUCLE_MotsRub>[(#REM)
	]<BOUCLE_ArticlesRub(ARTICLES){id_rubrique}{par num titre,date}>
		$id_article = create_article(trouve_article_sc("[(#TITRE*|sc_NewLine2str)]"), "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_NewLine2str)]");[
		$id_article = create_article(trouve_article_sc("[(#TITRE*|sc_nl2str)]"), "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_nl2str)]");[
			create_logo('documents/(#LOGO_ARTICLE_NORMAL|fichier)', $type='article', $id_article, '[(#LOGO_ARTICLE_NORMAL|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]');][
			create_logo('documents/(#LOGO_ARTICLE_SURVOL|fichier)', $type='article', $id_article, '[(#LOGO_ARTICLE_SURVOL|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]','off');][(#REM)
	]<BOUCLE_MotsArt(MOTS){id_article}>
			create_article_mot("[(#_ArticlesRub:TITRE*|sc_NewLine2str)]", "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_NewLine2str)]", "[(#TITRE*|sc_NewLine2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_NewLine2str)]");[(#REM)
			create_article_mot("[(#_ArticlesRub:TITRE*|sc_nl2str)]", "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_nl2str)]", "[(#TITRE*|sc_nl2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_nl2str)]");[(#REM)
	]</BOUCLE_MotsArt>[(#REM)
	]</BOUCLE_ArticlesRub>[(#REM)
	]<BOUCLE_SitesRub(spip_syndic){id_rubrique}{par num nom_site,date}>
			$sites = array();
			$sites['nom_site'] = "[(#NOM_SITE*|sc_NewLine2str)]";
			$sites['nom_site'] = "[(#NOM_SITE*|sc_nl2str)]";
			$sites['url_site'] = "#URL_SITE";
			$sites['descriptif'] = "[(#DESCRIPTIF*|sc_NewLine2str)]";
			$sites['descriptif'] = "[(#DESCRIPTIF*|sc_nl2str)]";
			$sites['url_syndic'] = "#URL_SYNDIC";
			$sites['statut'] = '#STATUT';
			$id_site = create_site($sites, "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_NewLine2str)]");[
			$id_site = create_site($sites, "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_nl2str)]");[
				create_logo('documents/(#LOGO_SITE_NORMAL{#ID_SYNDIC}|fichier)', $type='site', $id_site, '[(#LOGO_SITE_NORMAL{#ID_SYNDIC}|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]');][
				create_logo('documents/(#LOGO_SITE_SURVOL{#ID_SYNDIC}|fichier)', $type='site', $id_site, '[(#LOGO_SITE_SURVOL{#ID_SYNDIC}|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]','off');][(#REM)
	]<BOUCLE_MotsSite(MOTS){id_syndic}{tout}>
				create_site_mot($id_site, "[(#TITRE*|sc_NewLine2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_NewLine2str)]");[(#REM)
				create_site_mot($id_site, "[(#TITRE*|sc_nl2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_nl2str)]");[(#REM)
	]</BOUCLE_MotsSite>[(#REM)
	]</BOUCLE_SitesRub>
	<B_ListeSsRubriques>
	$id_parent = $id_rubrique;
	<BOUCLE_ListeSsRubriques(RUBRIQUES){id_parent}{par num titre}{tout}>
		$id_rubrique = create_rubrique("[(#TITRE*|sc_NewLine2str)]", $id_parent, "[(#DESCRIPTIF*|sc_NewLine2str)]");[
		$id_rubrique = create_rubrique("[(#TITRE*|sc_nl2str)]", $id_parent, "[(#DESCRIPTIF*|sc_nl2str)]");[
			create_logo('documents/(#LOGO_RURIQUE_NORMAL|fichier)', $type='rub', $id_rubrique, '[(#LOGO_RURIQUE_NORMAL|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]');][
			create_logo('documents/(#LOGO_RURIQUE_SURVOL|fichier)', $type='rub', $id_rubrique, '[(#LOGO_RURIQUE_SURVOL|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]','off');][(#REM)
	]<BOUCLE_MotsSsRub(MOTS){id_rubrique}>
			create_rubrique_mot("[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_NewLine2str)]", "[(#TITRE*|sc_NewLine2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_NewLine2str)]");[(#REM)
			create_rubrique_mot("[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_nl2str)]", "[(#TITRE*|sc_nl2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_nl2str)]");[(#REM)
	]</BOUCLE_MotsSsRub>[(#REM)
	]<BOUCLE_ArticlesSsRub(ARTICLES){id_rubrique}{par num titre,date}>
			$id_article = create_article(trouve_article_sc("[(#TITRE*|sc_NewLine2str)]"), "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_NewLine2str)]");[
			$id_article = create_article(trouve_article_sc("[(#TITRE*|sc_nl2str)]"), "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_nl2str)]");[
				create_logo('documents/(#LOGO_ARTICLE_NORMAL|fichier)', $type='article', $id_article, '[(#LOGO_ARTICLE_NORMAL|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]');][
				create_logo('documents/(#LOGO_ARTICLE_SURVOL|fichier)', $type='article', $id_article, '[(#LOGO_ARTICLE_SURVOL|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]','off');][(#REM)
	]<BOUCLE_MotsSsArt(MOTS){id_article}>
				create_article_mot("[(#_ArticlesSsRub:TITRE*|sc_NewLine2str)]", "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_NewLine2str)]", "[(#TITRE*|sc_NewLine2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_NewLine2str)]");[(#REM)
				create_article_mot("[(#_ArticlesSsRub:TITRE*|sc_nl2str)]", "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_nl2str)]", "[(#TITRE*|sc_nl2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_nl2str)]");[(#REM)
	]</BOUCLE_MotsSsArt>[(#REM)
	]</BOUCLE_ArticlesSsRub>[(#REM)
	]<BOUCLE_SitesSsRub(spip_syndic){id_rubrique}{par num nom_site,date}>
				$sites = array();
				$sites['nom_site'] = "[(#NOM_SITE*|sc_NewLine2str)]";
				$sites['nom_site'] = "[(#NOM_SITE*|sc_nl2str)]";
				$sites['url_site'] = "#URL_SITE";
				$sites['descriptif'] = "[(#DESCRIPTIF*|sc_NewLine2str)]";
				$sites['descriptif'] = "[(#DESCRIPTIF*|sc_nl2str)]";
				$sites['url_syndic'] = "#URL_SYNDIC";
				$sites['statut'] = '#STATUT';
				$id_site = create_site($sites, "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_NewLine2str)]");[
				$id_site = create_site($sites, "[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_nl2str)]");[
					create_logo('documents/(#LOGO_SITE_NORMAL{#ID_SYNDIC}|fichier)', $type='site', $id_site, '[(#LOGO_SITE_NORMAL{#ID_SYNDIC}|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]');][
					create_logo('documents/(#LOGO_SITE_SURVOL{#ID_SYNDIC}|fichier)', $type='site', $id_site, '[(#LOGO_SITE_SURVOL{#ID_SYNDIC}|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]','off');][(#REM)
	]<BOUCLE_MotsSsSite(MOTS){id_syndic}{tout}>
					create_site_mot($id_site, "[(#TITRE*|sc_NewLine2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_NewLine2str)]");[(#REM)
					create_site_mot($id_site, "[(#TITRE*|sc_nl2str)]", "[(#INFO_TITRE*{groupe_mot,#ID_GROUPE}|sc_nl2str)]");[(#REM)
	]</BOUCLE_MotsSsSite>[(#REM)
	]</BOUCLE_SitesSsRub>
	<BOUCLE_SSRub(BOUCLE_ListeSsRubriques) />[(#REM)
+2 −2
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
#CACHE{0}[(#HTTP_HEADER{Content-Type: text/plain; charset=#CHARSET})]
// Les articles du site
<BOUCLE_ListeArticles(ARTICLES){par id_rubrique}>
poubelle_article("[(#TITRE*|sc_NewLine2str)]","[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_NewLine2str)]");[(#REM)
poubelle_article("[(#TITRE*|sc_nl2str)]","[(#INFO_TITRE*{rubrique,#ID_RUBRIQUE}|sc_nl2str)]");[(#REM)
]</BOUCLE_ListeArticles>
+7 −7
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
#CACHE{0}[(#HTTP_HEADER{Content-Type: text/plain; charset=#CHARSET})]
<BOUCLE_groupes(GROUPES_MOTS){par titre}>
	create_groupe("[(#TITRE*|sc_NewLine2str)]", "[(#DESCRIPTIF*|sc_NewLine2str)]", "[(#TEXTE*|sc_NewLine2str)]", '[(#UNSEUL|=={oui}|?{'oui','non'})]', '[(#OBLIGATOIRE|=={oui}|?{'oui','non'})]', '[(#TABLES_LIEES)]', '[(#MINIREZO|=={oui}|?{'oui','non'})]', '[(#COMITE|=={oui}|?{'oui','non'})]', '[(#FORUM|=={oui}|?{'oui','non'})]');
<BOUCLE_mots(MOTS){id_groupe}{par titre}>		$id_mot = create_mot("[(#_groupes:TITRE*|sc_NewLine2str)]", "[(#TITRE*|sc_NewLine2str)]", "[(#DESCRIPTIF*|sc_NewLine2str)]", "[(#TEXTE*|sc_NewLine2str)]");[
	create_groupe("[(#TITRE*|sc_nl2str)]", "[(#DESCRIPTIF*|sc_nl2str)]", "[(#TEXTE*|sc_nl2str)]", '[(#UNSEUL|=={oui}|?{'oui','non'})]', '[(#OBLIGATOIRE|=={oui}|?{'oui','non'})]', '[(#TABLES_LIEES)]', '[(#MINIREZO|=={oui}|?{'oui','non'})]', '[(#COMITE|=={oui}|?{'oui','non'})]', '[(#FORUM|=={oui}|?{'oui','non'})]');
<BOUCLE_mots(MOTS){id_groupe}{par titre}>		$id_mot = create_mot("[(#_groupes:TITRE*|sc_nl2str)]", "[(#TITRE*|sc_nl2str)]", "[(#DESCRIPTIF*|sc_nl2str)]", "[(#TEXTE*|sc_nl2str)]");[
			create_logo('documents/(#LOGO_MOT_NORMAL|fichier)', $type='mot', $id_mot, '[(#LOGO_MOT_NORMAL|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]');][
			create_logo('documents/(#LOGO_MOT_SURVOL|fichier)', $type='mot', $id_mot, '[(#LOGO_MOT_SURVOL|fichier|pathinfo{#CONST{PATHINFO_EXTENSION}})]','off');]
</BOUCLE_mots></BOUCLE_groupes>
+2 −2
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
@@ -18,9 +18,9 @@ function image_focus($img, $largeur, $hauteur, $position = 'center') {

	$GLOBALS['Smush_Debraye'] = true;

	if (($largeurimg <= $largeur) and ($hauteurimg <= $hauteur)) {
	if (($largeurimg <= $largeur) && ($hauteurimg <= $hauteur)) {
		$img = filtrer('image_recadre', $img, $largeur, $hauteur, $position, 'transparent');
	} elseif (($largeurimg <= $largeur) or ($hauteurimg <= $hauteur)) {
	} elseif (($largeurimg <= $largeur) || ($hauteurimg <= $hauteur)) {
		if ($largeurimg <= $largeur) {
			$img = filtrer('image_recadre', $img, "$largeurimg:$hauteur", '-', 'focus', 'transparent');
			$img = filtrer('image_graver', $img);
Chargement en cours