[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / ecrire / inc / aider.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2014 *
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/filtres');
16
17 // L'aide en ligne de SPIP est disponible sous forme d'articles de www.spip.net
18 // qui ont des reperes nommes arrtitre, artdesc etc.
19 // La fonction inc_aider(_dist) recoit soit ces reperes,
20 // soit le nom du champ de saisie, le nom du squelette le contenant et enfin
21 // l'environnement d'execution du squelette (inutilise pour le moment).
22 // Le tableau ci-dessous donne le repere correspondant a ces informations.
23
24 $GLOBALS['aider_index'] = array(
25 'editer_article.html' => array (
26 'surtitre' => 'arttitre',
27 'titre' => 'arttitre',
28 'soustitre' => 'arttitre',
29 'id_parent' => 'artrub',
30 'descriptif' => 'artdesc',
31 'virtuel' => 'artvirt',
32 'chapo' => 'arttitre',
33 'text_area' => 'arttexte'),
34
35 'editer_breve.html' => array(
36 'id_parent' => 'brevesrub',
37 'lien_titre' => 'breveslien',
38 'statut' => 'brevesstatut'),
39
40 'editer_groupe_mot.html' => array(
41 'titre' => 'motsgroupes'),
42
43 'editer_mot.html' => array(
44 'titre' => 'mots',
45 'id_groupe' => 'motsgroupes'),
46
47 'editer_rubrique.html' => array(
48 'titre' => 'arttitre',
49 'id_parent' => 'rubrub',
50 'text_area' => 'raccourcis')
51 );
52
53 // http://doc.spip.org/@inc_aider_dist
54 function inc_aider_dist($aide='', $skel='', $env=array()) {
55 global $spip_lang, $spip_display, $aider_index;
56
57 if (!$aide OR $spip_display == 4) return '';
58
59 if (($skel = basename($skel))
60 AND isset($aider_index[$skel])
61 AND isset($aider_index[$skel][$aide]))
62 $aide = $aider_index[$skel][$aide];
63
64 $args = "aide=$aide&var_lang=$spip_lang";
65
66 return aider_icone(generer_url_ecrire("aide_index", $args));
67 }
68
69 function aider_icone($url, $clic= '')
70 {
71 global $spip_lang, $spip_lang_rtl;
72
73 if (!$clic) {
74 $t = _T('titre_image_aide');
75 $clic = http_img_pack("aide-12".aide_lang_dir($spip_lang,$spip_lang_rtl).".png",
76 _T('info_image_aide'),
77 " title=\"$t\" class='aide'");
78 }
79 return "\n&nbsp;<a class='aide'\nhref='"
80 . $url
81 . "'\nonclick=\"javascript:window.open(this.href,"
82 . "'spip_aide', "
83 . "'scrollbars=yes, resizable=yes, width=740, height=580'); "
84 . "return false;\">"
85 . $clic
86 . "</a>";
87 }
88
89
90 // en hebreu le ? ne doit pas etre inverse
91 // http://doc.spip.org/@aide_lang_dir
92 function aide_lang_dir($spip_lang,$spip_lang_rtl) {
93 return ($spip_lang<>'he') ? $spip_lang_rtl : '';
94 }
95 ?>