Skip to content
Extraits de code Groupes Projets
Valider 3b2aefa4 rédigé par nicod's avatar nicod
Parcourir les fichiers

Une fonction de génération du titre des blocs

parent a17763bf
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -2,7 +2,7 @@
# blocs
[ ] Supprimer le titre des blocs, pas utile, et utiliser une fonction de génération du titre
[x] Supprimer le titre des blocs, pas utile, et utiliser une fonction de génération du titre
[x] Formulaire de config : sur quels objets utiliser des blocs
......
......@@ -138,3 +138,16 @@ function _block_charger_block($id_bloc) {
return recuperer_fond($squelette, $contexte);
}
function generer_TITRE_BLOC($id_bloc){
$infos = sql_fetsel(
'bt.titre, bl.objet, bl.rang_lien, bl.id_objet',
'spip_blocs b join spip_blocs_types bt using(id_blocs_type) left join spip_blocs_liens bl using(id_bloc)',
'b.id_bloc = '.(int)$id_bloc
);
$titre = $infos['titre'];
if($infos['id_objet'] && $infos['objet']) {
$titre = generer_objet_info($infos['id_objet'], $infos['objet'], 'titre') . ' - ' . $titre . ' #' . $infos['rang_lien'];
}
return $titre;
}
......@@ -21,7 +21,7 @@
<tr class="[(#COMPTEUR_BOUCLE|alterner{row_odd,row_even})]">
<td class="picto">[(#CHEMIN_IMAGE{bloc-16.png}|balise_img)]</td>
<td class="statut">[(#STATUT|puce_statut{bloc,#ID_BLOC})]</td>
<td class="titre principale">[(#LOGO_BLOC|image_reduire{20,26})]<a href="[(#ID_BLOC|generer_url_entite{bloc})]" title="<:info_numero_abbreviation|attribut_html:/> #ID_BLOC">[(#RANG). ]#INFO_TITRE{blocs_type,#ID_BLOCS_TYPE}</a></td>
<td class="titre principale">[(#LOGO_BLOC|image_reduire{20,26})]<a href="[(#ID_BLOC|generer_url_entite{bloc})]" title="<:info_numero_abbreviation|attribut_html:/> #ID_BLOC">[(#RANG). ]#INFO_TITRE{bloc,#ID_BLOC}</a></td>
<td class="date secondaire">[(#DATE|affdate_jourcourt)]</td>
<td class="id">[(#AUTORISER{modifier,bloc,#ID_BLOC}|?{
<a href="[(#URL_ECRIRE{bloc_edit,id_bloc=#ID_BLOC})]">#ID_BLOC</a>,
......
......@@ -12,7 +12,7 @@
]
]
<h1>[(#RANG). ](#TITRE|sinon{<:info_sans_titre:/>})[(#CHEMIN_IMAGE{bloc-24.png}|balise_img{bloc,cadre-icone})]</h1>
<h1>[(#RANG). ](#INFO_TITRE{bloc,#ID_BLOC}|sinon{<:info_sans_titre:/>})[(#CHEMIN_IMAGE{bloc-24.png}|balise_img{bloc,cadre-icone})]</h1>
],simple fiche_objet})]
......
......@@ -2,7 +2,7 @@
<a href="#URL_ECRIRE{blocs}"><:bloc:titre_blocs:/></a>
<BOUCLE_hierarchie(BLOCS){id_bloc}{statut?}>
&gt; [(#URL_ECRIRE{blocs_type,id_blocs_type=#ID_BLOCS_TYPE}|lien_ou_expose{#INFO_TITRE{blocs_types,#ID_BLOCS_TYPE},''})]
&gt; <strong class="on">#ID_BLOC</strong>
&gt; <strong class="on">#INFO_TITRE{bloc,#ID_BLOC}</strong>
</BOUCLE_hierarchie>
[(#ENV{id_blocs_type}|oui)
&gt; [(#URL_ECRIRE{blocs_type,id_blocs_type=#ID_BLOCS_TYPE}|lien_ou_expose{#INFO_TITRE{blocs_types,#ID_BLOCS_TYPE},''})]
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter