This repository was archived by the owner on May 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidgets_options.php
More file actions
66 lines (56 loc) · 1.43 KB
/
widgets_options.php
File metadata and controls
66 lines (56 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* Fichier options
*
* @plugin Widgets
* @copyright 2014
* @author Cédric
* @licence GNU/GPL
* @package SPIP\Widgets\options
*/
if (!defined("_ECRIRE_INC_VERSION")) return;
if (_request('var_mode')=='widgets'){
define('_VAR_MODE','calcul');
define('_VAR_NOCACHE',true);
}
/**
* Generer affichage des widgets d'un groupe avec boutons d'admin si besoin
*
* #WIDGETS_ASIDE
* #WIDGETS_EXTRA
*
* @param object $p
* @return object
*/
function balise_WIDGETS__dist($p) {
$nom = $p->nom_champ;
if ($nom === 'WIDGETS_') {
$msg = array('zbug_balise_sans_argument', array('balise' => ' WIDGETS_'));
erreur_squelette($msg, $p);
$p->interdire_scripts = false;
return $p;
}
$groupe = strtolower($nom);
$groupe = substr($groupe,strlen('WIDGETS_'));
$code = "
include_spip(\'inc/widgets\');
echo widgets_affiche(\'$groupe\','.var_export(@\$Pile[0],true).');
";
// les boutons d'admin en supplement
$code .= "
if (isset(\$GLOBALS[\'visiteur_session\'][\'statut\'])
AND \$GLOBALS[\'visiteur_session\'][\'statut\']==\'0minirezo\'
AND include_spip(\'inc/autoriser\')
AND autoriser(\'administrer\',\'widgets\')) {
include_spip(\'inc/widgets\');
echo \"<div class=\'boutons spip-admin actions administrerwidgets\'>\"
. widgets_boutons_admin(\'$groupe\','.var_export(@\$Pile[0],true).')
. \"</div>\";
}";
$p->code = "
'<'.'?php
$code
?'.'>'";
$p->interdire_scripts = false;
return $p;
}