Completed
Push — spip-2.1 ( b6b097 )
by cam
42:28 queued 30:44
created

bandeau.php ➔ definir_barre_boutons()   F

Complexity

Conditions 44
Paths > 20000

Size

Total Lines 211
Code Lines 128

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 44
eloc 128
nc 3649560
nop 0
dl 0
loc 211
rs 2
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/***************************************************************************\
4
 *  SPIP, Systeme de publication pour l'internet                           *
5
 *                                                                         *
6
 *  Copyright (c) 2001-2016                                                *
7
 *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
8
 *                                                                         *
9
 *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
10
 *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
11
\***************************************************************************/
12
13
if (!defined('_ECRIRE_INC_VERSION')) return;
14
15
include_spip('inc/boutons');
16
17
define('_LARGEUR_ICONES_BANDEAU',
18
       ((@$GLOBALS['spip_display'] == 3) ? 60 : 80)
19
       + ((@$GLOBALS['spip_ecran'] == 'large') ? 30 : 0)
20
       + (($GLOBALS['connect_toutes_rubriques']) ? 0 : 30));
21
22
23
/**
24
 * definir la liste des boutons du haut et de ses sous-menus
25
 * On defini les boutons a metrtre selon les droits de l'utilisateur
26
 * puis on balance le tout au pipeline "ajouter_boutons" pour que des plugins
27
 * puissent y mettre leur grain de sel
28
 */
29
// http://doc.spip.org/@definir_barre_boutons
30
function definir_barre_boutons() {
31
	global $boutons_admin;
32
33
	global $spip_lang, $spip_lang_rtl, $spip_lang_left, $spip_lang_right;
34
35
	$boutons_admin=array();
36
37
	$boutons_admin['accueil'] = new Bouton(
38
		'asuivre-48.png', 'icone_a_suivre');
39
40
	$boutons_admin['naviguer'] = new Bouton(
41
		"documents-48$spip_lang_rtl.png", 'icone_edition_site');
42
43
	if ($GLOBALS['meta']['forum_prive'] != 'non' OR sql_countsel('spip_forum'))
44
		$boutons_admin['forum'] = new Bouton(
45
			'messagerie-48.png', 'titre_forum');
46
47
	$boutons_admin['auteurs'] = new Bouton(
48
		'redacteurs-48.png', 'icone_auteurs');
49
50
51
	if ($GLOBALS['meta']["activer_statistiques"] != 'non'
52
	AND autoriser('voirstats')) {
53
		$boutons_admin['statistiques_visites']=
54
		  new Bouton('statistiques-48.png', 'icone_statistiques_visites');
55
	}
56
57
	// autoriser('configurer') => forcement admin complet (ou webmestre)
58
	if (autoriser('configurer')) {
59
		$boutons_admin['configuration']=
60
		  new Bouton('administration-48.png', 'icone_configuration_site');
61
	}
62
	// autres admins (restreints ou non webmestres) peuvent aller sur les backups
63
	else
64
	if (autoriser('sauvegarder', 'admin_tech')) {
65
		$boutons_admin['admin_tech']=
66
		  new Bouton('administration-48.png', 'texte_sauvegarde_base');
67
	}
68
69
	$boutons_admin['espacement']=null;
70
71
	$urlAide= generer_url_ecrire('aide_index')."&amp;var_lang=$spip_lang";
72
	$boutons_admin['aide_index']=
73
		  new Bouton('aide-48'.$spip_lang_rtl.'.png', 'icone_aide_ligne',
74
					 $urlAide, null, "javascript:window.open('$urlAide', 'spip_aide', 'scrollbars=yes,resizable=yes,width=740,height=580');", 'aide_spip');
75
76
	$boutons_admin['visiter']=
77
		new Bouton("visiter-48$spip_lang_rtl.png", 'icone_visiter_site',
78
		url_de_base());
79
80
	// les sous menu des boutons, que si on est admin
81
	if ($GLOBALS['connect_statut'] == '0minirezo'
82
	AND $GLOBALS['connect_toutes_rubriques']) {
83
84
	// sous menu edition
85
86
	$sousmenu=array();
87
88
	$nombre_articles = sql_fetsel('id_article', 'spip_auteurs_articles', "id_auteur=".$GLOBALS['connect_id_auteur']);
89
90
	if ($nombre_articles > 0) {
91
		$sousmenu['articles_page']=
92
		  new Bouton('article-24.gif', 'icone_tous_articles');
93
	}
94
95
	if ($GLOBALS['meta']["activer_breves"] != "non") {
96
		$sousmenu['breves']=
97
		  new Bouton('breve-24.gif', 'icone_breves');
98
	}
99
100
	$articles_mots = $GLOBALS['meta']['articles_mots'];
101
	if ($articles_mots != "non") {
102
			$sousmenu['mots_tous']=
103
			  new Bouton('mot-cle-24.gif', 'icone_mots_cles');
104
	}
105
106
	$activer_sites = $GLOBALS['meta']['activer_sites'];
107
	if ($activer_sites<>'non')
108
			$sousmenu['sites_tous']=
109
			  new Bouton('site-24.gif', 'icone_sites_references');
110
111
	$n = sql_countsel('spip_documents_liens', 'id_objet>0 AND objet=\'rubrique\'');
112
	if ($n) {
113
			$sousmenu['documents_liste']=
114
			  new Bouton('doc-24.gif', 'icone_doc_rubrique');
115
	}
116
	$boutons_admin['naviguer']->sousmenu= $sousmenu;
117
118
	// sous menu forum
119
120
	$sousmenu=array();
121
122
	if ($GLOBALS['meta']['forum_prive_admin'] == 'oui'
123
	AND autoriser('forum_admin'))
124
		$sousmenu['forum_admin']=
125
		  new Bouton('forum-admin-24.gif', 'icone_forum_administrateur');
126
127
	if (sql_countsel('spip_forum'))
128
		$sousmenu['controle_forum']=
129
			new Bouton("suivi-forum-24.gif", "icone_suivi_forums");
130
	if (sql_countsel('spip_signatures'))
131
		$sousmenu['controle_petition']=
132
			new Bouton("suivi-petition-24.gif", "icone_suivi_pettions");
133
134
	// Si le forum a ete desactive, mais qu'il y a un sous-menu de suivi
135
	// des forums ou des petitions, on colle ce suivi sous le menu "a suivre"
136
	if ($sousmenu) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $sousmenu of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
137
		if (isset($boutons_admin['forum']))
138
			$boutons_admin['forum']->sousmenu= $sousmenu;
139
		else
140
			$boutons_admin['accueil']->sousmenu= $sousmenu;
141
	}
142
143
144
145
	// sous menu auteurs
146
147
	$sousmenu=array();
148
149
	if (avoir_visiteurs(true)) {
150
		include_spip('exec/auteurs');
151
		$sousmenu['auteurs'] =
152
			new Bouton("fiche-perso.png", 'icone_afficher_visiteurs', null, "statut=!".AUTEURS_MIN_REDAC);
153
	}
154
155
	$sousmenu['auteur_infos']=
156
		new Bouton("auteur-24.gif", "icone_creer_nouvel_auteur", null, 'new=oui');
157
158
	$boutons_admin['auteurs']->sousmenu= $sousmenu;
159
160
	// sous menu statistiques
161
	if (isset($boutons_admin['statistiques_visites'])) {
162
		$sousmenu=array(
163
			//'espacement' => null,// les espacements debloquent si on a des icones sur 2 lignes
164
			'statistiques_repartition' =>
165
				new Bouton("rubrique-24.gif", "icone_repartition_visites")
166
		);
167
168
		if ($GLOBALS['meta']['multi_articles'] == 'oui'
169
		OR $GLOBALS['meta']['multi_rubriques'] == 'oui')
170
			$sousmenu['statistiques_lang']=
171
				new Bouton("langues-24.gif", "onglet_repartition_lang");
172
173
		$sousmenu['statistiques_referers']=
174
		  new Bouton("referers-24.gif", "titre_liens_entrants");
175
176
		$boutons_admin['statistiques_visites']->sousmenu= $sousmenu;
177
	}
178
179
	// sous menu configuration
180
	if (autoriser('configurer')) {
181
		$sousmenu = array();
182
		if (autoriser('configurer', 'lang')) {
183
			$sousmenu['config_lang'] =
184
				new Bouton("langues-24.gif", "icone_gestion_langues");
185
			//$sousmenu['espacement'] = null; // les espacements debloquent si on a des icones sur 2 lignes
186
		}
187
188
		if (autoriser('sauvegarder')) {
189
			$sousmenu['admin_tech']=
190
				new Bouton("base-24.gif", "icone_maintenance_site");
191
		}
192
		if (autoriser('configurer', 'admin_vider')) {
193
			$sousmenu['admin_vider']=
194
				new Bouton("cache-24.gif", "onglet_vider_cache");
195
		}
196
197
		// Si _DIR_PLUGINS est definie a '', pas de bouton
198
		if (_DIR_PLUGINS
199
		AND autoriser('configurer', 'admin_plugin')) {
200
			$sousmenu['admin_plugin']=
201
				new Bouton("plugin-24.gif", "icone_admin_plugin");
202
		}
203
204
		if ($sousmenu)
0 ignored issues
show
Bug Best Practice introduced by
The expression $sousmenu of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
205
			$boutons_admin['configuration']->sousmenu= $sousmenu;
206
	}
207
208
	} // fin si admin
209
210
	// ajouter les boutons issus des plugin via plugin.xml
211
	if (function_exists('boutons_plugins')
212
	  AND is_array($liste_boutons_plugins = boutons_plugins())){
213
		foreach($liste_boutons_plugins as $id => $infos){
214
			if (autoriser('bouton',$id)){
215
				if (($parent = $infos['parent']) && isset($boutons_admin[$parent]))
216
					$boutons_admin[$parent]->sousmenu[$id]= new Bouton(
217
					  find_in_path($infos['icone']),  // icone
218
					  $infos['titre'],	// titre
219
					  $infos['url']?$infos['url']:null,
220
					  $infos['args']?$infos['args']:null
221
					  );
222
				if (!$parent) {
223
					$b = array();
224
					foreach($boutons_admin as $k=>$v){
225
						if ($k=='espacement')
226
							$b = $b + array($id=> new Bouton(
227
					  find_in_path($infos['icone']),  // icone
228
					  $infos['titre'],	// titre
229
					  $infos['url']?generer_url_ecrire($infos['url'],$infos['args']?$infos['args']:''):null
230
					  ));
231
						$b = $b + array($k=>$v);
232
					}
233
					$boutons_admin = $b;
234
				}
235
			}
236
		}
237
	}
238
239
	$boutons_admin = pipeline('ajouter_boutons', $boutons_admin);
240
}
241
242
// http://doc.spip.org/@bandeau_creer_url
243
function bandeau_creer_url($url, $args=""){
244
	if (preg_match(',[\/\?],',$url))
245
		return $url;
246
	else
247
		return generer_url_ecrire($url,$args);
248
}
249
// http://doc.spip.org/@bandeau_principal
250
function bandeau_principal($rubrique, $sous_rubrique, $largeur)
251
{
252
	$num = count($GLOBALS['boutons_admin']);
253
	// Reperer si on veut un espacement entre les 2 parties du bandeau.
254
	if (key_exists('espacement', $GLOBALS['boutons_admin'])) $num--;
255
    // Et eviter de produire un UL vide.
256
	if ($num <= 0) return '';
257
	$res = '';
258
	$decal = 0;
259
260
	foreach($GLOBALS['boutons_admin'] as $page => $detail) {
261
		if ($page=='espacement') {
262
			$espacement = $largeur-($num*_LARGEUR_ICONES_BANDEAU) . 'px';
263
			$res .= "<li class='cellule48' style='width:$espacement'><span class='menu-item' style='width:"._LARGEUR_ICONES_BANDEAU."px'>&nbsp;</span></li>";
264
		} else {
265
			if ($detail->url)
266
				$lien_noscript = bandeau_creer_url($detail->url);
267
			else
268
				$lien_noscript = generer_url_ecrire($page);
269
270
			if ($detail->url2)
271
				$lien = bandeau_creer_url($detail->url2);
272
			else
273
				$lien = $lien_noscript;
274
275
			$res .= icone_bandeau_principal(
276
					$detail,
277
					$lien,
278
					$page,
279
					$rubrique,
280
					$lien_noscript,
281
					$page,
282
					$sous_rubrique,
283
          $largeur,$decal);
284
		}
285
		$decal += _LARGEUR_ICONES_BANDEAU;
286
	}
287
288
	return "<div class='h-list centered' style='width:{$largeur}px'><ul>\n$res</ul></div>";
289
}
290
291
// http://doc.spip.org/@icone_bandeau_principal
292
function icone_bandeau_principal($detail, $lien, $rubrique_icone = "vide", $rubrique = "", $lien_noscript = "", $sous_rubrique_icone = "", $sous_rubrique = "",$largeur,$decal){
0 ignored issues
show
Unused Code introduced by
The parameter $rubrique_icone is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
293
	global $spip_display, $menu_accesskey, $compteur_survol;
294
295
	$alt = $accesskey = $title = '';
0 ignored issues
show
Unused Code introduced by
$alt is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
296
	$texte = _T($detail->libelle);
297
	if ($spip_display == 3){
298
		$title = " title=\"$texte\"";
299
	}
300
301
	if (!$menu_accesskey = intval($menu_accesskey)) $menu_accesskey = 1;
302 View Code Duplication
	if ($menu_accesskey < 10) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
303
		$accesskey = " accesskey='$menu_accesskey'";
304
		$menu_accesskey++;
305
	}
306
	else if ($menu_accesskey == 10) {
307
		$accesskey = " accesskey='0'";
308
		$menu_accesskey++;
309
	}
310
311
	$class_select = " style='width:"._LARGEUR_ICONES_BANDEAU."px' class='menu-item boutons_admin".($sous_rubrique_icone == $sous_rubrique ? " selection" : "")."'";
312
313
	if (strncasecmp("javascript:",$lien,11)==0) {
314
		$a_href = "\nonclick=\"$lien; return false;\" href='$lien_noscript' ";
315
	}
316
	else {
317
		$a_href = "\nhref=\"$lien\"";
318
	}
319
320
	$compteur_survol ++;
321
322
	if ($spip_display != 1 AND $spip_display != 4) {
323
		$class ='cellule48';
324
		$texte = "<span class='icon_fond'><span".http_style_background($detail->icone)."></span></span>".($spip_display == 3 ? '' :  "<span class='icon_texte'>$texte</span>");
325
	} else {
326
		$class = 'cellule-texte';
327
	}
328
329
	return "<li style='width: "
330
	. _LARGEUR_ICONES_BANDEAU
331
	. "px' class='$class boutons_admin'><a$accesskey$a_href$class_select$title onfocus=\"$(this).parent().siblings('li').find('.bandeau_sec').hide();\" onkeypress=\"$(this).siblings('.bandeau_sec').show();\">"
332
	. $texte
333
	. "</a>\n"
334
	. bandeau_principal2($detail->sousmenu,$rubrique, $sous_rubrique, $largeur, $decal)
335
  . "</li>\n";
336
}
337
338
// http://doc.spip.org/@bandeau_principal2
339
function bandeau_principal2($sousmenu,$rubrique, $sous_rubrique, $largeur, $decal) {
0 ignored issues
show
Unused Code introduced by
The parameter $rubrique is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
340
341
	$res = '';
342
	$coeff_decalage = 0;
343
	if ($GLOBALS['browser_name']=="MSIE") $coeff_decalage = 1.0;
344
	$largeur_maxi_menu = $largeur-100;
345
	$largitem_moy = 85;
346
347
	//    if (($rubrique == $page) AND (!_SPIP_AJAX)) {  $page ??????
348
	if ((!_SPIP_AJAX)) {
349
			$class = "visible_au_chargement";
0 ignored issues
show
Unused Code introduced by
$class is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
350
		} else {
351
			$class = "invisible_au_chargement";
0 ignored issues
show
Unused Code introduced by
$class is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
352
		}
353
354
355
		if($sousmenu) {
356
			//offset is not necessary when javascript is active. It can be usefull when js is disabled
357
      $offset = (int)round($decal-$coeff_decalage*max(0,($decal+count($sousmenu)*$largitem_moy-$largeur_maxi_menu)));
358
			if ($offset<0){	$offset = 0; }
0 ignored issues
show
Unused Code introduced by
$offset is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
359
360
			$width=0;
361
			$max_width=0;
362
			foreach($sousmenu as $souspage => $sousdetail) {
363
				if ($width+1.25*$largitem_moy>$largeur_maxi_menu){
364
          $res .= "</ul><ul>\n";
365
          if($width>$max_width) $max_width=$width;
366
          $width=0;
367
        }
368
				$largitem = 0;
369
				if($souspage=='espacement') {
370
					if ($width>0){
371
						$res .= "<li class='separateur' style='width:20px;'></li>\n";
372
					}
373
				} else {
374
				  list($html,$largitem) = icone_bandeau_secondaire (_T($sousdetail->libelle),
375
				    bandeau_creer_url($sousdetail->url?$sousdetail->url:$souspage, $sousdetail->urlArg),
376
				    $sousdetail->icone, $souspage, $sous_rubrique
377
				  );
378
				  $res .= $html;
379
				}
380
				$width+=$largitem+10;
381
				if($width>$max_width) $max_width+=$largitem;
382
			}
383
			$res .= "</ul></div>\n";
384
			$res = "<div class='bandeau_sec h-list' style='width:{$max_width}px;'><ul>".$res;
385
		}
386
387
	return $res;
388
}
389
390
 //script to show the submenus in IE6, not supporting :hover on li elements
391
392
define('_JS_ADMIN_IE6', "
393
	<script type='text/javascript'><!--
394
	var boutons_admin = jQuery('#bandeau-principal li.boutons_admin');
395
	if(jQuery.browser.msie) boutons_admin.hover(
396
	function(){jQuery(this).addClass('sfhover');change_menu_lang(false);},
397
	function(){jQuery(this).removeClass('sfhover');change_menu_lang(true);});
398
  	boutons_admin.one('mouseover',decaleSousMenu);
399
	function change_menu_lang(show){
400
	if(!jQuery('#menu_langues0').length) return;
401
	if (show) {jQuery('#menu_langues0').show().siblings('input.lang_ecrire').hide();}
402
	else {
403
  	if (!jQuery('#menu_langues0').siblings('input.lang_ecrire').length){
404
  	jQuery('#menu_langues0').before('<input type=\"text\" name=\"dummy\" class=\"lang_ecrire\" value=\"\" />');
405
  	}
406
  	jQuery('#menu_langues0').hide().siblings('input.lang_ecrire').attr('value',jQuery('#menu_langues0 option').eq(jQuery('#menu_langues0').get(0).selectedIndex).html()).show();
407
	}}
408
       // --></script>
409
	");
410
411
// http://doc.spip.org/@icone_bandeau_secondaire
412
function icone_bandeau_secondaire($texte, $lien, $fond, $rubrique_icone = "vide", $rubrique, $aide=""){
413
	global $spip_display;
414
	global $menu_accesskey, $compteur_survol;
415
416
	$alt = '';
417
	$title = '';
418
	$accesskey = '';
419
	if ($spip_display == 1) {
420
		//$hauteur = 20;
421
		$largeur = 80;
422
	}
423
	else if ($spip_display == 3){
424
		//$hauteur = 26;
425
		$largeur = 40;
426
		$title = "title=\"$texte\"";
427
		$alt = $texte;
428
	}
429
	else {
430
		//$hauteur = 68;
431
		if (count(explode(" ", $texte)) > 1) $largeur = 80;
432
		else $largeur = 70;
433
		$alt = "";
434
	}
435
	if ($aide AND $spip_display != 3) {
436
		$largeur += 50;
437
		//$texte .= aide($aide);
438
	}
439
	if ($spip_display != 3 AND strlen($texte)>16) $largeur += 20;
440
441
	if (!$menu_accesskey = intval($menu_accesskey)) $menu_accesskey = 1;
442 View Code Duplication
	if ($menu_accesskey < 10) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
443
		$accesskey = " accesskey='$menu_accesskey'";
444
		$menu_accesskey++;
445
	}
446
	else if ($menu_accesskey == 10) {
447
		$accesskey = " accesskey='0'";
448
		$menu_accesskey++;
449
	}
450
	if ($spip_display == 3) $accesskey_icone = $accesskey;
0 ignored issues
show
Unused Code introduced by
$accesskey_icone is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
451
452
	$class_select = " class='menu-item".($rubrique_icone != $rubrique ? "" : " selection")."'";
453
	$compteur_survol ++;
454
455
	$a_href = "<a$accesskey href=\"$lien\"$class_select>";
456
457
	if ($spip_display != 1) {
458
		$res = "<li class='cellule36' style='width: ".$largeur."px;'>";
459
		$res .= $a_href .
460
		  http_img_pack("$fond", $alt, "$title");
461
		if ($aide AND $spip_display != 3) $res .= aide($aide)." ";
462
		if ($spip_display != 3) {
463
			$res .= "<span>$texte</span>";
464
		}
465
		$res .= "</a></li>\n";
466
	}
467
	else $res = "<li style='width: $largeur" . "px' class='cellule-texte'>$a_href". $texte . "</a></li>\n";
468
469
	return array($res, $largeur);
470
}
471
472
function inc_bandeau_dist($rubrique, $sous_rubrique, $largeur)
473
{
474
	definir_barre_boutons();
475
	return "<div id='bandeau-principal'>\n"
476
	  . bandeau_principal($rubrique, $sous_rubrique, $largeur)
477
	  . "</div>" .
478
	  _JS_ADMIN_IE6;
479
}
480
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
481