\n"; $frame_menu = "\n"; $frame_body = "\n"; if ($GLOBALS['spip_lang_rtl']) { echo ''; echo $frame_body.$frame_menu; } else { echo ''; echo $frame_menu.$frame_body; } echo ''; echo "\n"; } ///////////////////////////// // Le contenu demande // // Erreur aide non disponible function erreur_aide_indisponible() { include_ecrire('inc_presentation.php3'); install_debut_html(_T('forum_titre_erreur')); echo "
"._T('aide_non_disponible')."
"; echo "
".menu_langues('var_lang_ecrire')."
"; install_fin_html(); exit; } // Selection de l'aide correspondant a la langue demandee function fichier_aide($lang_aide = '') { global $help_server; if (!$lang_aide) $lang_aide = $GLOBALS['spip_lang']; // fichier local ? if (@file_exists($fichier_aide = "../AIDE/aide-$lang_aide-aide.html")) { return array(spip_file_get_contents($fichier_aide), $lang_aide); } // fichier local ? si reduction ISO du code langue oc_prv_ni => oc else if (ereg("(.*)_", $lang_aide, $regs) AND (@file_exists($fichier_aide = "../AIDE/aide-".$regs[1]."-aide.html"))) return array(spip_file_get_contents($fichier_aide), $regs[1]); // Aide internet else { // en cache ? if (!@file_exists($fichier_aide = _DIR_CACHE . "aide-$lang_aide-aide.html")) { if ($help_server) { include_ecrire('inc_sites.php3'); if (ecrire_fichier(_DIR_CACHE . 'aide-test', "test") AND ($contenu = recuperer_page("$help_server/$lang_aide-aide.html"))) ecrire_fichier ($fichier_aide, $contenu); } } lire_fichier($fichier_aide, $contenu); if (strlen($contenu) > 500) { return array($contenu, $lang_aide); } // Pas d'aide meme sur internet : n'existe pas dans la langue // Hack: comportement special sur le serveur d'aide SPIP.NET // (definir la constante SPIP.NET_...) if (defined('SPIP.NET_PAS_DE_BOUCLE_AIDE')) { $GLOBALS['clean_link'] = new Link("../aide/?aide=$aide"); } erreur_aide_indisponible(); } return false; } function help_body($aide, $html) { global $help_server; // Recuperation du contenu de l'aide demandee if ($aide) { $html = analyse_aide($html, $aide); if (!$html) { erreur_aide_indisponible(); } } else { // panneau d'accueil $html = '
SPIP

Système de publication pour l\'Internet
'. preg_replace(",'; } // Recherche des images de l'aide $suite = $html; $html = ""; while (preg_match("@(]* +)? src=['\"])" . "((AIDE|IMG)/([-_a-zA-Z0-9]*/?)([^'\"<>]*))@i", $suite, $r)) { $image = $r[3]; $image_plat = str_replace('/', '-', $image); $f = "aide_index.php3?img=$image_plat"; $p = strpos($suite, $r[0]); $html .= substr($suite, 0, $p) . $r[1].$f; $suite = substr($suite, $p + strlen($r[0])); } $html .= $suite; ?> "; if ($aide == 'spip') { echo '
SPIP
'; } // Il faut que la langue de typo() soit celle de l'aide en ligne changer_typo($lang_aide); $html = justifier($html."

"); // Remplacer les liens externes par des liens ouvrants (a cause des frames) $html = ereg_replace(']*)>', '', $html); echo $html; } ///////////////////////////////////// // Recuperer une image dans le cache // function help_img($regs) { global $help_server; list ($cache, $rep, $lang, $file, $ext) = $regs; header("Content-Type: image/$ext"); if (@file_exists($img = _DIR_CACHE . 'aide-'.$cache)) { readfile($img); } else if (@file_exists($img = '../AIDE/aide-'.$cache)) { readfile($img); } else if ($help_server) { include_ecrire('inc_sites.php3'); if (ecrire_fichier(_DIR_CACHE . 'aide-test', "test") AND ($contenu = recuperer_page("$help_server/$rep/$lang/$file"))) { echo $contenu; ecrire_fichier (_DIR_CACHE . 'aide-'.$cache, $contenu); } else header ("Location: $help_server/$rep/$lang/$file"); } exit; } /////////////////////////////////////// // Le menu de gauche // function help_menu($aide, $html) { global $spip_lang_left, $spip_lang_rtl, $spip_lang_right; $triangle = "url(" . _DIR_IMG_PACK . 'triangle'.$spip_lang_rtl.'.gif) '; echo ' '; afficher_script_layer(); echo ' "; // Recuperation et analyse de la structure de l'aide demandee $sections = analyse_aide($html); foreach ($sections as $section) { if ($section[1] == '1') { if ($rubrique_vue) fin_rubrique(); rubrique($section[3].$section[5]); $rubrique_vue = true; } else article($section[5], $section[3]); } fin_rubrique(); } function rubrique($titre, $statut = "redac") { global $ligne_rubrique; global $block_rubrique; global $titre_rubrique; global $afficher_rubrique, $ouvrir_rubrique; global $larubrique; global $aide_statut; $afficher_rubrique = 0; if (($statut == "admin" AND $aide_statut == "admin") OR ($statut == "redac")) { $larubrique++; $titre_rubrique = $titre; $ligne_rubrique = array(); $block_rubrique = "block$larubrique"; $afficher_rubrique = 1; $ouvrir_rubrique = 0; } } function fin_rubrique() { global $ligne_rubrique; global $block_rubrique; global $titre_rubrique; global $afficher_rubrique, $ouvrir_rubrique; global $texte; if ($afficher_rubrique && count($ligne_rubrique)) { echo "

"; if ($ouvrir_rubrique) echo bouton_block_visible($block_rubrique); else echo bouton_block_invisible($block_rubrique); echo $titre_rubrique; echo "
\n"; if ($ouvrir_rubrique) echo debut_block_visible($block_rubrique); else echo debut_block_invisible($block_rubrique); echo "\n"; reset($ligne_rubrique); while (list(, $ligne) = each($ligne_rubrique)) { echo $texte[$ligne]; } echo fin_block(); echo "\n\n"; } } function article($titre, $lien, $statut = "redac") { global $aide; global $ligne; global $ligne_rubrique; global $rubrique; global $texte; global $afficher_rubrique, $ouvrir_rubrique; global $aide_statut; global $spip_lang; if ($afficher_rubrique AND (($statut == "admin" AND $aide_statut == "admin") OR ($statut == "redac"))) { $ligne_rubrique[] = ++$ligne; $texte[$ligne] = ''; $id = "ligne$ligne"; $url = "aide_index.php3?aide=$lien&frame=body&var_lang=$spip_lang"; if ($aide == $lien) { $ouvrir_rubrique = 1; $class = "article-actif"; $texte[$ligne] .= "\n"; } else { $class = "article-inactif"; } $texte[$ligne] .= "$titre
\n"; } } function analyse_aide($html, $aide=false) { preg_match_all(',([^/]+?)(/(.+?))?,ism', $html, $regs, PREG_SET_ORDER); if ($aide) { unset ($regs); $preg = ',$aide/(.+?)(.*)$,ism"; preg_match($preg, $html, $regs); $regs = preg_replace(',