diff --git a/.gitattributes b/.gitattributes index 22e29539c6f33648fe83ae6d1595606268557679..b92188f616e100a0162c5b05e9a8836f259d0be2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,7 +8,6 @@ ecrire/action/ajouter_lien.php -text ecrire/action/auth.php -text ecrire/action/changer_mode_document.php -text ecrire/action/charger_plugin.php -text -ecrire/action/configuration.php -text ecrire/action/confirmer_email.php -text ecrire/action/converser.php -text ecrire/action/copier_local.php -text @@ -85,11 +84,6 @@ ecrire/exec/brouteur.php -text ecrire/exec/brouteur_frame.php -text ecrire/exec/charger_plugin.php -text ecrire/exec/charger_plugin_descr.php -text -ecrire/exec/config_fonctions.php -text -ecrire/exec/configuration.php -text -ecrire/exec/configurer_moderniseur_html.php -text -ecrire/exec/configurer_previsualiseur.php -text -ecrire/exec/configurer_relayeur.php -text ecrire/exec/convert_sql_utf8.php -text ecrire/exec/convert_utf8.php -text ecrire/exec/copier_local.php -text @@ -107,8 +101,6 @@ ecrire/exec/infos_perso.php -text ecrire/exec/install.php -text ecrire/exec/instituer_auteur.php -text ecrire/exec/legender.php -text -ecrire/exec/memoriser.php -text -ecrire/exec/menu_navigation.php -text ecrire/exec/menu_rubriques.php -text ecrire/exec/navigation.php -text ecrire/exec/naviguer.php -text @@ -116,11 +108,9 @@ ecrire/exec/plonger.php -text ecrire/exec/puce_statut.php -text ecrire/exec/recherche.php -text ecrire/exec/rechercher.php -text -ecrire/exec/rechercher_auteur.php -text ecrire/exec/referencer_traduction.php -text ecrire/exec/rubriques_edit.php -text ecrire/exec/selectionner.php -text -ecrire/exec/selectionner_auteur.php -text ecrire/exec/suivi_edito.php -text ecrire/exec/synchro.php -text ecrire/exec/tourner.php -text @@ -129,7 +119,6 @@ ecrire/exec/valider_xml.php -text ecrire/genie/maintenance.php -text ecrire/genie/mise_a_jour.php -text ecrire/inc/actions.php -text -ecrire/inc/afficher_objets.php -text ecrire/inc/aider.php -text ecrire/inc/ajouter_documents.php -text ecrire/inc/article_select.php -text @@ -158,8 +147,6 @@ ecrire/inc/filtres_images_lib_mini.php -text ecrire/inc/filtres_images_mini.php -text ecrire/inc/filtres_mime.php -text ecrire/inc/filtres_mini.php -text -ecrire/inc/formater_article.php -text -ecrire/inc/formater_auteur.php -text ecrire/inc/gadgets.php -text ecrire/inc/headers.php -text ecrire/inc/icone_renommer.php -text @@ -185,7 +172,6 @@ ecrire/inc/modifier.php -text ecrire/inc/nfslock.php -text ecrire/inc/notes.php -text ecrire/inc/notifications.php -text -ecrire/inc/php3.php -text ecrire/inc/pipelines.php -text ecrire/inc/pipelines_ecrire.php -text ecrire/inc/plonger.php -text @@ -193,18 +179,15 @@ ecrire/inc/plugin.php -text ecrire/inc/prepare_recherche.php -text ecrire/inc/presentation_mini.php -text ecrire/inc/presenter_enfants.php -text -ecrire/inc/presenter_liste.php -text ecrire/inc/puce_statut.php -text ecrire/inc/rechercher.php -text ecrire/inc/referencer_traduction.php -text ecrire/inc/ressembler.php -text ecrire/inc/securiser_action.php -text ecrire/inc/selectionner.php -text -ecrire/inc/selectionner_auteur.php -text ecrire/inc/tourner.php -text ecrire/inc/traduire.php -text ecrire/inc/utils.php -text -ecrire/inc/vieilles_defs.php -text ecrire/inc/vignette.php -text ecrire/inc/xml.php -text ecrire/install/etape_.php -text diff --git a/ecrire/action/configuration.php b/ecrire/action/configuration.php deleted file mode 100644 index 8ceafe63faa5f025a59ac2ba3e559e27c954b69a..0000000000000000000000000000000000000000 --- a/ecrire/action/configuration.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -// Mise a jour de l'option de configuration $arg -// il faudrait limiter a arg plutot que d'executer tout modif_config -// on traite a part seulement le cas du proxy car c'est indispensable -// (message d'erreur eventuel a afficher) - -include_spip('inc/config'); - -// http://doc.spip.org/@action_configurer_dist -function action_configuration_dist() { - - $securiser_action = charger_fonction('securiser_action', 'inc'); - $arg = $securiser_action(); - - # ceinture & bretelles, a priori le test dans exec_configurer - # suffit a empecher d'obtenir un hash qui passe le test ci-dessus - if(!autoriser('configurer', _request('configuration'))) { - include_spip('inc/minipres'); - echo minipres(_T('info_acces_interdit')); - exit; - } - - $r = rawurldecode(_request('redirect')); - $r = parametre_url($r, 'configuration', $arg,"&"); - appliquer_modifs_config(); - - // Cette globale est fixee par appliquer_modifs_config(); - // c'est un message a afficher dans l'exec de retour (relayeur si comme ici on est en ajax) - if ($arg == 'relayeur') - $r = parametre_url($r, 'retour_proxy', $GLOBALS['retour_proxy'],"&"); - else if ($arg == 'langue') { - include_spip('inc/rubriques'); - calculer_langues_rubriques(); - } - if (_request('envoi_now')) cron(0, array('mail' => -1)); - redirige_par_entete($r); -} - -?> diff --git a/ecrire/exec/config_fonctions.php b/ecrire/exec/config_fonctions.php deleted file mode 100644 index fd12444c6559b8ee898bba9ab078cb06b5e3ea29..0000000000000000000000000000000000000000 --- a/ecrire/exec/config_fonctions.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -include_spip('inc/presentation'); - -// http://doc.spip.org/@exec_config_fonctions_dist -function exec_config_fonctions_dist() -{ - if (!autoriser('configurer', 'fonctions')) { - include_spip('inc/minipres'); - echo minipres(); - } else { - - $config = charger_fonction('config', 'inc'); - $config(); - - pipeline('exec_init',array('args'=>array('exec'=>'config_fonctions'),'data'=>'')); - $commencer_page = charger_fonction('commencer_page', 'inc'); - echo $commencer_page(_T('titre_page_config_fonctions'), "configuration", "configuration"); - - echo gros_titre(_T('titre_config_fonctions'),'', false); - echo barre_onglets("configuration", "fonctions"); - - echo debut_gauche('', true); - echo pipeline('affiche_gauche',array('args'=>array('exec'=>'config_fonctions'),'data'=>'')); - echo creer_colonne_droite('', true); - echo pipeline('affiche_droite',array('args'=>array('exec'=>'config_fonctions'),'data'=>'')); - echo debut_droite('', true); - - $reducteur = charger_fonction('reducteur', 'configuration'); - $avertisseur = charger_fonction('avertisseur', 'configuration'); - $previsualiseur = charger_fonction('previsualiseur', 'configuration'); - $relayeur = charger_fonction('relayeur', 'configuration'); - $moderniseur_html = charger_fonction('moderniseur_html', 'configuration'); - - echo - - $reducteur(), // Creation automatique de vignettes - - $avertisseur(), // Notification de modification des articles - - $previsualiseur(), // Previsualisation sur le site public - - $relayeur(_request('retour_proxy')), // Proxy pour syndication & doc - - $moderniseur_html(), // Selection de la version max de HTML (4 ou 5) - - ''; - -// -// Choix supplementaires proposees par les plugins -// - $res = pipeline('affiche_milieu',array('args'=>array('exec'=>'config_fonctions'),'data'=>'')); - if ($res) - echo $res; - - echo fin_gauche(), fin_page(); - } -} - -?> diff --git a/ecrire/exec/configuration.php b/ecrire/exec/configuration.php deleted file mode 100644 index 3ada459ac38bd4de8335dc59ced6a8566c729a09..0000000000000000000000000000000000000000 --- a/ecrire/exec/configuration.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -// reaffichage du formulaire d'une option de configuration -// apres sa modification par appel du script action/configurer -// redirigeant ici. - -// http://doc.spip.org/@exec_configurer_dist -function exec_configuration_dist() -{ - if(!autoriser('configurer', _request('configuration'))) { - include_spip('inc/minipres'); - echo minipres(_T('info_acces_interdit')); - exit; - } - include_spip('inc/actions'); - $configuration = charger_fonction(_request('configuration'), 'configuration', true); - ajax_retour($configuration ? $configuration() : 'configure quoi?'); -} -?> diff --git a/ecrire/exec/configurer_moderniseur_html.php b/ecrire/exec/configurer_moderniseur_html.php deleted file mode 100644 index b628a7c4e91ddc66cf40d3aeb955557ed20549c5..0000000000000000000000000000000000000000 --- a/ecrire/exec/configurer_moderniseur_html.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -// http://doc.spip.org/@exec_configurer_moderniseur_html_dist -function exec_configurer_moderniseur_html_dist() -{ - $moderniseur_html = charger_fonction('moderniseur_html', 'configuration'); - include_spip('inc/actions'); - ajax_retour($moderniseur_html()); -} -?> diff --git a/ecrire/exec/configurer_previsualiseur.php b/ecrire/exec/configurer_previsualiseur.php deleted file mode 100644 index 6e0b09fd93a0509a83f1808e6ecc494e48809f19..0000000000000000000000000000000000000000 --- a/ecrire/exec/configurer_previsualiseur.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -// http://doc.spip.org/@exec_configurer_previsualiseur_dist -function exec_configurer_previsualiseur_dist() -{ - $previsualiseur = charger_fonction('previsualiseur', 'configuration'); - include_spip('inc/actions'); - ajax_retour($previsualiseur()); -} -?> diff --git a/ecrire/exec/configurer_relayeur.php b/ecrire/exec/configurer_relayeur.php deleted file mode 100644 index 3ec5934333bd18eb8911e3e5709623a91712ad16..0000000000000000000000000000000000000000 --- a/ecrire/exec/configurer_relayeur.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -// http://doc.spip.org/@exec_configurer_relayeur_dist -function exec_configurer_relayeur_dist() -{ - include_spip('inc/actions'); - $relayeur = charger_fonction('relayeur', 'configuration'); - ajax_retour($relayeur(_request('retour_proxy'))); -} -?> diff --git a/ecrire/exec/memoriser.php b/ecrire/exec/memoriser.php deleted file mode 100644 index 69e33209fbc2d115836eee76fadb32bd529bad96..0000000000000000000000000000000000000000 --- a/ecrire/exec/memoriser.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - - -// Recupere et affiche (en ajax) une fonction memorisee dans inc/presentation -// obsolete : utilise uniquement par afficher_objets -// http://doc.spip.org/@exec_memoriser_dist -function exec_memoriser_dist() -{ - $hash = _request('hash'); - $order = _request('order'); - $by = _request('by'); - $trad = _request('trad'); - lire_fichier(_DIR_SESSIONS.'ajax_fonctions.txt', $ajax_fonctions); - $ajax_fonctions = @unserialize($ajax_fonctions); - - if ($res = $ajax_fonctions[$hash]) { - include_spip('inc/afficher_objets'); - list(,$t,$r,$f) = $res; - if (preg_match('/^[a-z0-9+.,]+$/', $by) - AND preg_match('/^\w*$/', $order)) { - $r['ORDER BY'] = str_replace(',', " $order, ", $by) . " $order"; - sauver_requete($t, $r, $f); - } - $cpt = sql_countsel($r['FROM'], $r['WHERE'], $r['GROUP BY']); - include_spip('inc/presentation'); - $res = afficher_articles_trad($t, $r, $f, $hash, $cpt, $trad); - } else spip_log("memoriser $q vide"); - include_spip('inc/actions'); - ajax_retour($res); -} - -?> diff --git a/ecrire/exec/menu_navigation.php b/ecrire/exec/menu_navigation.php deleted file mode 100644 index b9e8f7bc9bb713508a0d352638c14e6632e58b84..0000000000000000000000000000000000000000 --- a/ecrire/exec/menu_navigation.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -include_spip('inc/presentation'); - -// http://doc.spip.org/@exec_menu_navigation_dist -function exec_menu_navigation_dist() { - global $connect_id_auteur, $spip_lang_left; - - $id_rubrique = intval(_request('id_rubrique')); - - $gadget = '<div style="width: 300px;">'; - - $vos_articles = sql_select("A.id_article, A.id_rubrique, A.titre, A.statut", "spip_articles AS A, spip_auteurs_liens AS L", "L.objet='article' AND A.id_article=L.id_objet AND L.id_auteur=$connect_id_auteur AND A.statut='prepa'", "A.date", "A.date DESC", "5"); - $vos = ''; - while($row = sql_fetch($vos_articles)) { - $id_article = $row['id_article']; - $titre = typo(sinon($row['titre'], _T('ecrire:info_sans_titre'))); - $statut = $row['statut']; - $h = generer_url_ecrire("articles","id_article=$id_article"); - $vos .= "<a class='$statut spip_xx-small' href='$h'>$titre</a>\n"; - } - if ($vos) { - $t = _T('info_en_cours_validation'); - $gadget .= debut_cadre('bandeau-rubriques',"article-24.png",'',afficher_plus(generer_url_ecrire("articles_page")).$t) - . "\n<div class='plan-articles'>\n" - . $vos - . "</div>" - . fin_cadre('bandeau-rubriques'); - } - - $vos_articles = sql_select("id_article, id_rubrique, titre, statut", "spip_articles", "statut='prop'", "date", "date DESC", "5"); - $vos = ''; - while($row = sql_fetch($vos_articles)) { - $id_article = $row['id_article']; - $titre = sinon($row['titre'], _T('ecrire:info_sans_titre')); - $statut = $row['statut']; - $h = generer_url_ecrire("articles","id_article=$id_article"); - $vos .= "<a class='$statut' href='$h'>$titre</a>"; - } - if ($vos) { - $gadget .= debut_cadre('bandeau-rubriques',"article-24.png",'',afficher_plus(generer_url_ecrire())._T('info_articles_proposes')) - . "<div class='plan-articles'>" - . $vos - . "</div>" - . fin_cadre('bandeau-rubriques'); - } - - $vos_articles = sql_select("id_breve,titre,statut", "spip_breves", "statut='prop'", "date_heure", "date_heure DESC", "5"); - $vos = ''; - while($row = sql_fetch($vos_articles)) { - $id_breve = $row['id_breve']; - $titre = typo(sinon($row['titre'], _T('ecrire:info_sans_titre'))); - $statut = $row['statut']; - $vos .= "<a class='$statut spip_xx-small' href='" . generer_url_ecrire("breves_voir","id_breve=$id_breve") . "'>$titre</a>"; - } - if ($vos) { - $gadget .= debut_cadre('bandeau-rubriques',"breve-24.png",'',afficher_plus(generer_url_ecrire("breves"))._T('info_breves_valider')) - . "<div class='plan-articles'>" - . $vos - . "</div>" - . fin_cadre('bandeau-rubriques'); - } - - $une_rubrique = sql_getfetsel('id_rubrique', 'spip_rubriques', '','','', 1); - if ($une_rubrique) { - - $gadget .= "<div> </div>"; - if ($id_rubrique > 0) { - $dans_rub = "&id_rubrique=$id_rubrique"; - $dans_parent = "&id_parent=$id_rubrique"; - } else $dans_rub = $dans_parent = ''; - if (autoriser('creerrubriquedans', 'rubrique', $id_rubrique)) { -# $gadget .= "<div style='width: 140px; float: $spip_lang_left;'>"; - if ($id_rubrique > 0) - $gadget .= icone_horizontale(_T('icone_creer_sous_rubrique'), generer_url_ecrire("rubriques_edit","new=oui$dans_parent"), "rubrique-24.png", "new", false); - else - $gadget .= icone_horizontale(_T('icone_creer_rubrique'), generer_url_ecrire("rubriques_edit","new=oui"), "rubrique-24.png", "new", false); -# $gadget .= "</div>"; - } -# $gadget .= "<div style='width: 140px; float: $spip_lang_left;'>"; - $gadget .= icone_horizontale(_T('icone_ecrire_article'), generer_url_ecrire("articles_edit","new=oui$dans_rub"), "article-24.png","new", false); -# $gadget .= "</div>"; - - if ($GLOBALS['meta']["activer_breves"] != "non") { -# $gadget .= "<div style='width: 140px; float: $spip_lang_left;'>"; - $gadget .= icone_horizontale(_T('icone_nouvelle_breve'), generer_url_ecrire("breves_edit","new=oui$dans_rub"), "breve-24.png","new", false); -# $gadget .= "</div>"; - } - - if (autoriser('creersitedans', 'rubrique', $une_rubrique)) { - $gadget .= # "<div style='width: 140px; float: $spip_lang_left;'>" . - icone_horizontale(_T('info_sites_referencer'), generer_url_ecrire("sites_edit","new=oui$dans_rub"), "site-24.png","new", false) - #. "</div>" -; - } - - } - - $gadget .="</div>"; - - ajax_retour($gadget); -} -?> diff --git a/ecrire/exec/rechercher_auteur.php b/ecrire/exec/rechercher_auteur.php deleted file mode 100644 index be0a3e6be93e81cc93b2a089e8ba02cea61f65b3..0000000000000000000000000000000000000000 --- a/ecrire/exec/rechercher_auteur.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -# gerer un charset minimaliste en convertissant tout en unicode &#xxx; - -// http://doc.spip.org/@exec_rechercher_auteur_dist -function exec_rechercher_auteur_dist() -{ - exec_rechercher_auteur_args(_request('idom')); -} - -// http://doc.spip.org/@exec_rechercher_auteur_args -function exec_rechercher_auteur_args($idom) -{ - if (!preg_match('/\w+/',$idom)) - { - include_spip('inc/minipres'); - echo minipres(); - } else { - include_spip('inc/actions'); - $where = preg_split(",\s+,", _request('nom')); - if ($where) { - foreach ($where as $k => $v) - $where[$k] = "'%" . substr(str_replace("%","\%", sql_quote($v)),1,-1) . "%'"; - $where= ("(nom LIKE " . join(" AND nom LIKE ", $where) . ")"); - } - include_spip('inc/selectionner_auteur'); - ajax_retour(selectionner_auteur_boucle($where, $idom)); - } -} -?> diff --git a/ecrire/exec/selectionner_auteur.php b/ecrire/exec/selectionner_auteur.php deleted file mode 100644 index 36a94ad4b860b153af8907c8b69c34b562bf415f..0000000000000000000000000000000000000000 --- a/ecrire/exec/selectionner_auteur.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -# afficher un mini-navigateur de rubriques - -// http://doc.spip.org/@exec_selectionner_auteur_dist -function exec_selectionner_auteur_dist() -{ - $id = intval(_request('id_article')); - $type = _request('type'); - if (!preg_match(',^[a-z_]+$,',$type)) $type = 'article'; - $selectionner_auteur = charger_fonction('selectionner_auteur', 'inc'); - include_spip('inc/actions'); - ajax_retour($selectionner_auteur($id, $type)); -} -?> diff --git a/ecrire/inc/afficher_objets.php b/ecrire/inc/afficher_objets.php deleted file mode 100644 index 73f7a2a2157da475bb0ef8e240fe2ff8a0967def..0000000000000000000000000000000000000000 --- a/ecrire/inc/afficher_objets.php +++ /dev/null @@ -1,541 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -$GLOBALS['my_sites']=array(); - -// http://doc.spip.org/@icone_table -function icone_table($type){ - $derog = array('document'=> 'doc-24.png','syndic_article'=>'site-24.png', 'groupes_mot'=>'groupes-mot-24.png'); - if (isset($derog[$type])) - return $derog[$type]; - return "$type-24.png"; -} - -// http://doc.spip.org/@lien_editer_objet -function lien_editer_objet($type,$key,$id){ - return $type == 'document' ? '' : generer_url_ecrire($type . "s_edit","$key=$id"); -} - -// http://doc.spip.org/@lien_voir_objet -function lien_voir_objet($type,$key,$id){ - if ($type == 'document') return generer_url_entite($id, 'document'); - $exec = array('article'=>'articles','breve'=>'breves_voir','rubrique'=>'naviguer','mot'=>'mots_edit', 'signature'=>'controle_petition'); - $exec = isset($exec[$type])?$exec[$type]:$type . "s"; - return generer_url_ecrire($exec,"$key=$id"); -} - -// http://doc.spip.org/@afficher_numero_edit -function afficher_numero_edit($id, $key, $type,$row=NULL) { - global $spip_lang_right, $spip_lang_left,$my_sites; - static $numero , $style='' ; - if ($type=='syndic_article') { - $redirect = _request('id_syndic') ? 'id_syndic='._request('id_syndic') : ''; - if (autoriser('modifier',$type,$id)) { - if ($row['statut'] == "publie"){ - $s = "[<a href='". redirige_action_auteur('instituer_syndic',"$id-refuse", _request('exec'), $redirect) . "'><span style='color: black'>"._T('info_bloquer_lien')."</span></a>]"; - - } - else if ($row['statut'] == "refuse"){ - $s = "[<a href='". redirige_action_auteur('instituer_syndic',"$id-publie", _request('exec'), $redirect) . "'>"._T('info_retablir_lien')."</a>]"; - } - else if ($row['statut'] == "off" - AND isset($my_sites[$id]['miroir']) AND $my_sites[$id]['miroir'] == 'oui') { - $s = '('._T('syndic_lien_obsolete').')'; - } - else /* 'dispo' ou 'off' (dans le cas ancien site 'miroir') */ - { - $s = "[<a href='". redirige_action_auteur('instituer_syndic',"$id-publie", _request('exec'), $redirect) . "'>"._T('info_valider_lien')."</a>]"; - } - return $s; - } - } - - if (!$style) { - $style = " class='spip_xx-small' style='float: $spip_lang_right; padding-$spip_lang_left: 4px; color: black; '"; - - $numero = _T('info_numero_abbreviation'); - } - - if (!autoriser('modifier',$type,$id) OR - !$href = lien_editer_objet($type,$key,$id)) { - $bal ='span'; - } else { - $bal = 'a'; - $href = "\nhref='" - . $href - . "' title='" - . _T('bouton_modifier') - . "'"; - } - return "<$bal$style$href><b>" - . $numero - . $id - . "</b></$bal>"; -} - -// libelle du titre de l'objet : -// la partie du titre a afficher dans un lien -// puis la partie hors lien -// http://doc.spip.org/@afficher_titre_objet -function afficher_titre_objet($type,$row){ - if (function_exists($f = "afficher_titre_$type")) - return $f($row); - - $titre = isset($row['titre'])?sinon($row['titre'], "("._T('info_sans_titre_2').")"): - (isset($row['nom'])?sinon($row['nom'], "("._T('info_sans_titre_2').")"): - (isset($row['nom_email'])?sinon($row['nom_email'], "("._T('info_sans_titre_2').")"): - "")); - return array(typo(supprime_img($titre,'')),''); -} -// http://doc.spip.org/@afficher_titre_site -function afficher_titre_site($row){ - $nom = $row['nom_site']; - - $nom = $nom?(strlen($nom)>1?typo($nom):_T('info_sans_titre_2')):("("._T('info_sans_titre_2').")"); - - $s2 = " <span class='spip_xx-small'>[<a href='" - .$row['url_site']."'>"._T('lien_visite_site')."</a>]</span>"; - - return array($nom,$s2); -} -// http://doc.spip.org/@afficher_titre_auteur -function afficher_titre_auteur($row){ - return array($row['nom'], - ((isset($row['restreint']) AND $row['restreint']) - ? (" <small>"._T('statut_admin_restreint')."</small>") - : '')); -} - -// http://doc.spip.org/@afficher_titre_syndic_article -function afficher_titre_syndic_article($row){ - return array('', recuperer_fond( - 'prive/contenu/syndic_article', - array('id' => $row['id_syndic_article']) - )); -} - -// http://doc.spip.org/@afficher_complement_objet -function afficher_complement_objet($type,$row){ - if (function_exists($f = "afficher_complement_$type")) - return $f($row); - return ""; -} - -// http://doc.spip.org/@afficher_complement_site -function afficher_complement_site($row){ - $syndication = $row['syndication']; - $s = ""; - if ($syndication == 'off' OR $syndication == 'sus') { - $s .= "<div style='color: red;'>" - . http_img_pack('puce-orange-anim.gif', $syndication, "class='puce'",_T('info_panne_site_syndique')) - . " "._T('info_probleme_grave')." </div>"; - } - if ($syndication == "oui" or $syndication == "off" OR $syndication == 'sus'){ - $s .= "<div style='color: red;'>"._T('info_syndication')."</div>"; - } - if ($syndication == "oui" OR $syndication == "off" OR $syndication == "sus") { - $id_syndic = $row['id_syndic']; - $total_art = sql_countsel("spip_syndic_articles", "id_syndic=$id_syndic"); - $s .= " " . $total_art . " " . _T('info_syndication_articles'); - } else { - $s .= " "; - } - return $s; -} -// http://doc.spip.org/@afficher_complement_syndic_article -function afficher_complement_syndic_article($row){ - global $my_sites; - if ($GLOBALS['exec'] != 'sites') { - $id_syndic = $row['id_syndic']; - // $my_sites cache les resultats des requetes sur les sites - if (!isset($my_sites[$id_syndic])) - $my_sites[$id_syndic] = sql_fetsel("nom_site, moderation, miroir", "spip_syndic", "id_syndic=$id_syndic"); - - $aff = $my_sites[$id_syndic]['nom_site']; - if ($my_sites[$id_syndic]['moderation'] == 'oui') - $aff = "<i>$aff</i>"; - - $s = "<a href='" . generer_url_ecrire("sites","id_syndic=$id_syndic") . "'>$aff</a>"; - - return $s; - } - return ""; -} - -// affichage des liste d'objets -// Cas generique, utilise pour tout sauf article -// http://doc.spip.org/@inc_afficher_objets_dist -function inc_afficher_objets_dist($type, $titre,$requete,$formater='', $force=false){ - if ($afficher = charger_fonction("afficher_{$type}s",'inc',true)){ - return $afficher($titre,$requete,$formater); - } - - if (($GLOBALS['meta']['multi_rubriques'] == 'oui' - AND (!isset($GLOBALS['id_rubrique']))) - OR $GLOBALS['meta']['multi_articles'] == 'oui') { - $afficher_langue = true; - - if (isset($GLOBALS['langue_rubrique'])) $langue_defaut = $GLOBALS['langue_rubrique']; - else $langue_defaut = $GLOBALS['meta']['langue_site']; - } else $afficher_langue = $langue_defaut = ''; - - $arg = array($afficher_langue, false, $langue_defaut, $formater, $type,id_table_objet($type)); - if (!function_exists($skel = "afficher_{$type}s_boucle")){ - $skel = "afficher_objet_boucle"; - } - - $presenter_liste = charger_fonction('presenter_liste', 'inc'); - $tmp_var = 't_' . substr(md5(join('', $requete)), 0, 4); - $styles = array(array('arial11', 7), array('arial11'), array('arial1'), array('arial1'), array('arial1 centered', 100), array('arial1', 38)); - - $tableau = array(); // ne sert pas ici - return $presenter_liste($requete, $skel, $tableau, $arg, $force, $styles, $tmp_var, $titre, icone_table($type)); -} - -// http://doc.spip.org/@charger_fonction_logo_if -function charger_fonction_logo_if() -{ - global $spip_display; - - if ($spip_display == 1 OR $spip_display == 4 OR !isset($GLOBALS['meta']['image_process'])) - return false; - if ($GLOBALS['meta']['image_process'] == "non") return false; - return charger_fonction('chercher_logo', 'inc'); -} - -// http://doc.spip.org/@afficher_objet_boucle -function afficher_objet_boucle($row, $own) -{ - global $connect_statut, $spip_lang_right; - static $chercher_logo = true; - - list($afficher_langue, $affrub, $langue_defaut, $formater,$type,$primary) = $own; - $vals = array(); - $id_objet = $row[$primary]; - if (autoriser('voir',$type,$id_objet)){ - - $date_heure = isset($row['date'])?$row['date']:(isset($row['date_heure'])?$row['date_heure']:""); - - $statut = isset($row['statut'])?$row['statut']:""; - if (isset($row['lang'])) - changer_typo($lang = $row['lang']); - else $lang = $langue_defaut; - $lang_dir = lang_dir($lang); - $id_rubrique = isset($row['id_rubrique'])?$row['id_rubrique']:0; - - $puce_statut = charger_fonction('puce_statut', 'inc'); - $vals[] = $puce_statut($id_objet, $statut, $id_rubrique, $type); - - list($titre,$suite) = afficher_titre_objet($type,$row); - $flogo = ''; - if ($chercher_logo) { - if ($chercher_logo !== true - OR $chercher_logo = charger_fonction_logo_if()) - if ($logo = $chercher_logo($id_objet, $primary, 'on')) { - list($fid, $dir, $nom, $format) = $logo; - include_spip('inc/filtres_images_mini'); - $logo = image_reduire("<img src='$fid' alt='' />", 26, 20); - if ($logo) - $flogo = "\n<span style='float: $spip_lang_right; margin-top: -2px; margin-bottom: -2px;'>$logo</span>"; - } - } - if ($titre) { - $titre = "<a href='" - . lien_voir_objet($type,$primary,$id_objet) - . "'>" - . $titre - . "</a>"; - } - $vals[] = "\n<div>$flogo$titre$suite</div>"; - - $s = ""; - if ($afficher_langue){ - if (isset($row['langue_choisie'])){ - $s .= " <span class='spip_xx-small' style='color: #666666' dir='$lang_dir'>"; - if ($row['langue_choisie'] == "oui") $s .= "<b>".traduire_nom_langue($lang)."</b>"; - else $s .= "(".traduire_nom_langue($lang).")"; - $s .= "</span>"; - } - elseif ($lang != $langue_defaut) - $s .= " <span class='spip_xx-small' style='color: #666666' dir='$lang_dir'>". - ($lang - ? "(".traduire_nom_langue($lang).")" - : '' - ) - ."</span>"; - } - $vals[] = $s; - - $vals[] = afficher_complement_objet($type,$row); - - $s = ""; - if ($affrub && $id_rubrique) { - $rub = sql_fetsel("id_rubrique, titre", "spip_rubriques", "id_rubrique=$id_rubrique"); - $id_rubrique = $rub['id_rubrique']; - $s .= "<a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") . "' style=\"display:block;\">".typo($rub['titre'])."</a>"; - } else - if ($statut){ - if ($statut != "prop") - $s = affdate_jourcourt($date_heure); - else - $s .= _T('info_a_valider'); - } - $vals[] = $s; - - $vals[] = afficher_numero_edit($id_objet, $primary, $type, $row); - } - return $vals; -} - -// Cas particuliers ----------------------------------------------------------------- - -// -// Afficher tableau d'articles -// -// http://doc.spip.org/@inc_afficher_articles_dist -function inc_afficher_articles_dist($titre, $requete, $formater='') { - - if (!isset($requete['FROM'])) $requete['FROM'] = 'spip_articles AS A'; - - if (!isset($requete['SELECT'])) { - $requete['SELECT'] = "A.id_article, A.titre, A.id_rubrique, A.statut, A.date, A.lang, A.id_trad, A.descriptif"; - } - - if (!isset($requete['GROUP BY'])) $requete['GROUP BY'] = ''; - - $cpt = sql_countsel($requete['FROM'], $requete['WHERE'], $requete['GROUP BY']); - - if (!$cpt) return '' ; - - $requete['FROM'] = preg_replace("/(spip_articles\s+AS\s+(\w+))/i", "\\1 LEFT JOIN spip_petitions AS P ON \\2.id_article=P.id_article", $requete['FROM']); - - $requete['SELECT'] .= ", P.id_article AS petition "; - - // memorisation des arguments pour gerer l'affichage par tranche - // et/ou par langues. - - - $hash = sauver_requete($titre, $requete, $formater); - - if (isset($requete['LIMIT'])) $cpt = min($requete['LIMIT'], $cpt); - return afficher_articles_trad($titre, $requete, $formater, $hash, $cpt); -} - -// -// Stocke la fonction ajax dans le fichier temp pour exec=memoriser -// - -// http://doc.spip.org/@sauver_requete -function sauver_requete($titre, $requete, $formater) -{ - $r = $requete; - unset($r['ORDER BY']); - $hash = substr(md5(serialize($r) . $GLOBALS['meta']['gerer_trad'] . $titre), 0, 31); - - // on lit l'existant - lire_fichier(_DIR_SESSIONS.'ajax_fonctions.txt', $ajax_fonctions); - $ajax_fonctions = @unserialize($ajax_fonctions); - - // on ajoute notre fonction - $v = array(time(), $titre, $requete, $formater); - $ajax_fonctions[$hash] = $v; - - // supprime les fonctions trop vieilles - foreach ($ajax_fonctions as $h => $fonc) - if (time() - $fonc[0] > 48*3600) - unset($ajax_fonctions[$h]); - - // enregistre - ecrire_fichier(_DIR_SESSIONS.'ajax_fonctions.txt', - serialize($ajax_fonctions)); - - return $hash; - -} -// http://doc.spip.org/@afficher_articles_trad -function afficher_articles_trad($titre_table, $requete, $formater, $hash, $cpt, $trad=0) { - - global $spip_lang_right; - - $tmp_var = 't' . substr($hash, 0, 7); - - if ($trad) { - $formater = 'afficher_articles_trad_boucle'; - $icone = "langues-off-12.gif"; - $alt = _T('masquer_trad'); - } else { - if (!$formater) - $formater = charger_fonction('formater_article', 'inc'); - $icone = 'langues-12.gif'; - $alt = _T('afficher_trad'); - } - - $texte = '<b>' . $titre_table . '</b>'; - - // Le parametre o sert a empecher le navigateur de reutiliser - // un cache de tranche issu d'un autre tri - - $arg = "hash=$hash&o=" . $requete['ORDER BY']; - -/* - // DESACTIVE CAR AJOUTE UNE COMPLEXITE INUTILE -- A REVOIR - // le micro "afficher les traductions" - if (($GLOBALS['meta']['gerer_trad'] == "oui")) { - $url = generer_url_ecrire('memoriser',"$arg&trad=" . (1-$trad)); - $texte = - "\n<span style='float: $spip_lang_right;'><a href=\"#\"" - . generer_onclic_ajax($url, $tmp_var, 0) - . "><img\nsrc='". chemin_image($icone) ."' alt='$alt' title='$alt' /></a></span>" . $texte; - } -*/ - -/* - // DESACTIVE CAR AJOUTE UNE COMPLEXITE INUTILE -- A REVOIR - $url_t = generer_url_ecrire('memoriser',"hash=$hash&by=0%2Btitre,titre"); - $url_t = afficher_boutons_tri($url_t, $tmp_var); - - $url_d = generer_url_ecrire('memoriser',"hash=$hash&by=date"); - $url_d = afficher_boutons_tri($url_d, $tmp_var); -*/ - $url_t = $url_d = ''; - $presenter_liste = charger_fonction('presenter_liste', 'inc'); - $styles = array(array('', 11), array('arial2','', $url_t), array('arial1', 80), array('arial1', 100, $url_d), array('arial1', 50)); - $tableau = array(); - $url = generer_url_ecrire('memoriser', "$arg&trad=$trad"); - $res = $presenter_liste($requete, $formater, $tableau, array(), false, $styles, $tmp_var, $texte, "article-24.png", $url, $cpt); - - return ajax_action_greffe($tmp_var, '', $res); -} - -// http://doc.spip.org/@afficher_boutons_tri -function afficher_boutons_tri($url, $tmp_var) -{ - static $monter = ''; - static $descendre = ''; - - if (!$monter) { - $monter = http_img_pack('monter-16.png', '<'); - $descendre = http_img_pack('descendre-16.png', '>'); - } - - $url_d = generer_onclic_ajax($url ."&order=desc", $tmp_var, 0); - $url_a = generer_onclic_ajax($url ."&order=asc", $tmp_var, 0); - - return "<a href='$url'$url_d>$monter</a><a href='$url'$url_a>$descendre</a>"; -} - -// http://doc.spip.org/@afficher_articles_trad_boucle -function afficher_articles_trad_boucle($row, $own='') -{ - global $spip_lang_right, $spip_display; - - $id_article = $row['id_article']; - if (!autoriser('voir','article',$id_article)) return ''; - - $titre = $row['titre']; - $id_rubrique = $row['id_rubrique']; - $statut = $row['statut']; - $id_trad = $row['id_trad']; - $lang = $row['lang']; - - $lang_dir = lang_dir($GLOBALS['lang_objet']); - $dates_art = $langues_art = array(); - $ligne = ""; - - $res_trad = sql_select("id_article, lang, date_modif", "spip_articles", "id_trad = $id_trad AND id_trad > 0"); - - while ($row_trad = sql_fetch($res_trad)) { - $id_article_trad = $row_trad["id_article"]; - $lang_trad = $row_trad["lang"]; - $date = $row_trad['date_modif']; - $dates_art[$lang_trad] = $date; - $langues_art[$lang_trad] = $id_article_trad; - if ($id_article_trad == $id_trad) $date_ref = $date; - } - - // faudrait sortir ces invariants de boucle - - if (($GLOBALS['meta']['multi_rubriques'] == 'oui' AND (!isset($GLOBALS['id_rubrique']))) OR $GLOBALS['meta']['multi_articles'] == 'oui') { - $langue_defaut = isset($GLOBALS['langue_rubrique']) - ? $GLOBALS['meta']['langue_site'] - : $GLOBALS['langue_rubrique']; - if ($lang != $langue_defaut) - $afficher_langue = " <span class='spip_xx-small' style='color: #666666' dir='$lang_dir'>(".traduire_nom_langue($lang).")</span>"; - } else $afficher_langue = ''; - - foreach(explode(',', $GLOBALS['meta']['langues_multilingue']) as $k){ - if (isset($langues_art[$k]) AND $langues_art[$k]<> $id_trad){ - $h = generer_url_ecrire("articles", "id_article=".$langues_art[$k]); - $style = strtotime($dates_art[$k]) < strtotime($date_ref); - $style = $style ? 'claire' : 'foncee'; - $ligne .= "<a href='$h' class='$style'>$k</a>"; - } - } - - if (acces_restreint_rubrique($id_rubrique)) - $img = http_img_pack(chemin_image("auteur-0minirezo-16.png"), _T('titre_image_administrateur'), "", _T('titre_image_admin_article')); - else $img = ''; - - if (!$titre) $titre = _T('ecrire:info_sans_titre'); - if ($id_article == $id_trad) $titre = "<b>$titre</b>"; - - $h = generer_url_ecrire("articles", "id_article=$id_article"); - - $titre = "\n<div>" - . $img - . "<a href='$h' dir='$lang_dir' style=\"display:block;\">" - . typo(supprime_img($titre,'')) - . "</a></div>"; - - if ($spip_display == 4) return array($ligne); - - $ligne .= "<a href='$h'><span class='lang_base'>$lang</span></a>"; - - // La petite puce de changement de statut - $puce_statut = charger_fonction('puce_statut', 'inc'); - $puce = $puce_statut($id_article, $statut, $id_rubrique,'article'); - - return array($puce, - $titre, - $afficher_langue, - "<div style='float: $spip_lang_right; margin-right: -10px;'>" - . $ligne - . "</div>"); -} - -// http://doc.spip.org/@afficher_auteurs_boucle -function afficher_auteurs_boucle($row, $own){ - $vals = array(); - list($afficher_langue, $affrub, $langue_defaut, $formater,$type,$primary) = $own; - $formater_auteur = $formater ? $formater : charger_fonction('formater_auteur', 'inc'); - if ($row['statut'] == '0minirezo') - $row['restreint'] = sql_countsel('spip_auteurs_liens', "objet='rubrique' AND id_auteur=".intval($row['id_auteur'])); - - list($s, $mail, $nom, $w, $p) = $formater_auteur($row['id_auteur'],$row); - if ($w) { - if (preg_match(',^([^>]*>)[^<]*(.*)$,', $w,$r)) { - $w = $r[1] . substr($row['site'],0,20) . $r[2]; - } - } - $vals[] = $s; - $vals[] = $mail; - $vals[] = $nom - . ((isset($row['restreint']) AND $row['restreint']) - ? (" <small>"._T('statut_admin_restreint')."</small>") - : ''); - $vals[] = $w; - $vals[] = $p; - return $vals; -} -?> diff --git a/ecrire/inc/formater_article.php b/ecrire/inc/formater_article.php deleted file mode 100644 index 6f2713ceff4f976533f3e189e1ce09649acf6f46..0000000000000000000000000000000000000000 --- a/ecrire/inc/formater_article.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; -include_spip('inc/afficher_objets'); -// Fonction appelee dans une boucle, calculer les invariants au premier appel. -// obsolete, utilise uniquement par afficher_objets - -// http://doc.spip.org/@inc_formater_article_dist -function inc_formater_article_dist($row, $own='') -{ - global $spip_lang_right, $spip_display; - static $pret = false; - static $chercher_logo, $img_admin, $formater_auteur, $nb, $langue_defaut, $afficher_langue, $puce_statut; - - $id_article = $row['id_article']; - - if (!autoriser('voir','article',$id_article)) return ''; - - if (!$pret) { - $chercher_logo = ($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non"); - if ($chercher_logo) - $chercher_logo = charger_fonction('chercher_logo', 'inc'); - $formater_auteur = charger_fonction('formater_auteur', 'inc'); - $img_admin = http_img_pack(chemin_image('auteur-0minirezo-16.png'), "", "", _T('titre_image_admin_article')); - - if (($GLOBALS['meta']['multi_rubriques'] == 'oui' AND (!isset($GLOBALS['id_rubrique']))) OR $GLOBALS['meta']['multi_articles'] == 'oui') { - $afficher_langue = true; - $langue_defaut = !isset($GLOBALS['langue_rubrique']) - ? $GLOBALS['meta']['langue_site'] - : $GLOBALS['langue_rubrique']; - } - $puce_statut = charger_fonction('puce_statut', 'inc'); - $pret = true; - } - - if ($chercher_logo) { - if ($logo = $chercher_logo($id_article, 'id_article', 'on')) { - list($fid, $dir, $nom, $format) = $logo; - include_spip('inc/filtres_images_mini'); - $logo = image_reduire("<img src='$fid' alt='' />", 26, 20); - } - } else $logo =''; - - $titre = sinon($row['titre'], _T('ecrire:info_sans_titre')); - $id_rubrique = $row['id_rubrique']; - $date = $row['date']; - $statut = $row['statut']; - $descriptif = $row['descriptif']; - $lang_dir = lang_dir(($lang = $row['lang']) ? changer_typo($lang):''); - - $lien = "<div>" - . "<a href='" - . generer_url_ecrire("articles","id_article=$id_article") - . "'" - . (!$descriptif ? '' : - (' title="'.attribut_html(typo($descriptif)).'"')) - . " dir='$lang_dir'>" - . (!$logo ? '' : - ("<span style='float: $spip_lang_right; margin-top: -2px; margin-bottom: -2px;'>" . $logo . "</span>")) - . (acces_restreint_rubrique($id_rubrique) ? $img_admin : '') - . typo(supprime_img($titre,'')) - . (!($afficher_langue AND $lang != $GLOBALS['meta']['langue_site'] AND strlen($lang)) ? '' : - (" <span class='spip_xx-small' style='color: #666666' dir='$lang_dir'>(".traduire_nom_langue($lang).")</span>")) - . (!$row['petition'] ? '' : - ("</a> <a href='" . generer_url_ecrire('controle_petition', "id_article=$id_article") . "' class='spip_xx-small' style='color: red'>"._T('lien_petitions'))) - . "</a>" - . "</div>"; - - if ($spip_display == 4) return array($lien); - - $puce = $puce_statut($id_article, $statut, $id_rubrique,'article'); - - $auteurs = auteurs_article($id_article); - foreach ($auteurs as $k => $r) { - list(, $mail, $nom,,) = $formater_auteur($r['id_auteur']); - $auteurs[$k]= "$mail $nom"; - } - - $date = affdate_jourcourt($date); - if (!$date) $date = ' '; - - $num = afficher_numero_edit($id_article, 'id_article', 'article'); - - // Afficher le numero (JMB) - - return array($puce, $lien, join('<br />', $auteurs), $date, $num); -} - -?> diff --git a/ecrire/inc/formater_auteur.php b/ecrire/inc/formater_auteur.php deleted file mode 100644 index d2a5a96a460adf64285b9f075cfd6deca7349c83..0000000000000000000000000000000000000000 --- a/ecrire/inc/formater_auteur.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -include_spip('inc/lien'); - -// -// Construit un tableau des 5 informations principales sur un auteur, -// avec des liens vers les scripts associes: -// 1. l'icone du statut, avec lien vers la page de tous ceux ayant ce statut -// 2. l'icone du mail avec un lien mailto ou a defaut la messagerie de Spip -// 3. le nom, avec lien vers la page complete des informations -// 4. le mot "site" avec le lien vers le site Web personnelle -// 5. le nombre d'objets publies -// - -// Un auteur sans autorisation de modification de soi est un visiteur; -// il n'a pas de messagerie interne, et n'a publie que des messages de forum - -// http://doc.spip.org/@inc_formater_auteur_dist -function inc_formater_auteur_dist($id_auteur, $row=NULL) { - - global $connect_id_auteur, $connect_statut; - - $id_auteur = intval($id_auteur); - - if ($row===NULL) - $row = sql_fetsel("*, " . sql_date_proche('en_ligne', -15, 'DAY') . " AS ici", "spip_auteurs", "id_auteur=$id_auteur"); - - $vals = array(); - $statut = $row['statut']; - $href = generer_url_ecrire("auteurs","statut=$statut"); - $vals[] = "<a href='$href'>" . bonhomme_statut($row) . '</a>'; - - if (($id_auteur == $connect_id_auteur) OR !$row['ici']) - $vals[]= ' '; - else $vals[]= formater_auteur_mail($row, $id_auteur); - - if (!$nom = typo($row['nom'])) - $nom = "<span style='color: red'>" . _T('texte_vide') . '</span>'; - - - $chercher_logo = ($spip_display != 1 - AND $spip_display != 4 - AND $GLOBALS['meta']['image_process'] != "non") - ? charger_fonction('chercher_logo', 'inc') - : false; - - if ($chercher_logo - AND $logo = $chercher_logo($id_auteur, 'id_auteur', 'on')) { - list($fid) = $logo; - include_spip('inc/filtres_images_mini'); - $logo = image_reduire("<img src='$fid' alt='' style='float:right;' />", 26, 20); - } - else $logo =''; - - $vals[] = "<a href='" - . generer_url_ecrire('auteur_infos', "id_auteur=$id_auteur") - . "'" - . (!$row['bio'] ? '' : (" title=\"" . attribut_html(couper(textebrut($row["bio"]), 200)) ."\"")) - . ">$nom</a>" . $logo; - - $url = traiter_lien_explicite($row["url_site"]); - - $vals[] = !$url ? " " - : "<a href='$url'>".couper(sinon(typo($row['nom_site']), $row["url_site"]),30)."</a>"; - - $contributions = array(); - if (autoriser('modifier', 'auteur', $id_auteur, $row)) { - $in = sql_in('statut', - ($connect_statut == "0minirezo" - ? array('prepa', 'prop', 'publie', 'refuse') - : array('prop', 'publie'))); - if ($cpt = sql_countsel("spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (A.id_article=L.id_objet AND objet='article')", "L.id_auteur=$id_auteur AND $in")){ - $contributions[] = ($cpt>1?$cpt.' '._T('info_article_2'):_T('info_1_article')); - } - } - - $contributions = pipeline('compter_contributions_auteur',array('args'=>array('id_auteur'=>$id_auteur,'row'=>$row),'data'=>$contributions)); - - $vals[] = (is_array($contributions) AND count($contributions))?implode('<br />',$contributions):" "; - - return $vals; -} - -// http://doc.spip.org/@formater_auteur_mail -function formater_auteur_mail($row, $id_auteur) -{ - if (!in_array($row['statut'], array('0minirezo', '1comite'))) - return ''; - - if ($row['imessage'] != 'non' - AND $GLOBALS['meta']['messagerie_agenda'] != 'non') - $href = generer_action_auteur("editer_message","normal/$id_auteur"); - else if (strlen($row['email']) - AND autoriser('voir', 'auteur', $id_auteur)) - $href = 'mailto:' . $row['email']; - else return ''; - - return "<a href='$href' title=\"" - . _T('info_envoyer_message_prive') - . "\" class='message'> </a>"; -} -?> diff --git a/ecrire/inc/php3.php b/ecrire/inc/php3.php deleted file mode 100644 index 74262288cb4620ecd2d10760d6f3e0979a4127d5..0000000000000000000000000000000000000000 --- a/ecrire/inc/php3.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -// Gestion ou simulation du register_globals a 'On' (PHP < 4.1.x) -// Code a l'agonie, heureusement. -// NB: c'est une fonction de maniere a ne pas pourrir $GLOBALS -// http://doc.spip.org/@spip_register_globals -function spip_register_globals($type='') { - - spip_log("spip_register_globals($type)"); - - // Liste des variables dont on refuse qu'elles puissent provenir du client - $refuse_gpc = array ( - # inc-public - 'fond', 'delais' /*, - - # ecrire/inc_auth (ceux-ci sont bien verifies dans $_SERVER) - 'REMOTE_USER', - 'PHP_AUTH_USER', 'PHP_AUTH_PW' - */ - ); - - // Liste des variables (contexte) dont on refuse qu'elles soient cookie - // (histoire que personne ne vienne fausser le cache) - $refuse_c = array ( - # inc-calcul - 'id_parent', 'id_rubrique', 'id_article', - 'id_auteur', 'id_breve', 'id_forum', 'id_secteur', - 'id_syndic', 'id_syndic_article', 'id_mot', 'id_groupe', - 'id_document', 'date', 'lang', - // et celles relatives aux raccourcis (cf inc/texte) - 'class_spip', 'class_spip_plus', - 'toujours_paragrapher', 'ligne_horizontale', - 'spip_raccourcis_typo', - 'puce', 'puce_prive', 'puce_rtl', 'puce_prive_rtl', - 'debut_intertitre', 'fin_intertitre', - 'debut_gras', 'fin_gras', 'debut_italique', 'fin_italique', - 'ouvre_note', 'ferme_note', 'les_notes', 'compt_note', - 'ouvre_ref', 'ferme_ref' - ); - - // Si les variables sont passees en global par le serveur, il faut - // faire quelques verifications de base - if ($type) { - foreach ($refuse_gpc as $var) { - if (isset($GLOBALS[$var])) { - if ( - // demande par le client - $_REQUEST[$var] !== NULL - // et pas modifie par les fichiers d'appel - AND $GLOBALS[$var] == $_REQUEST[$var] - ) // Alors on ne sait pas si c'est un hack - die ("register_globals: $var interdite"); - } - } - foreach ($refuse_c as $var) { - if (isset($GLOBALS[$var])) { - if ( - isset ($_COOKIE[$var]) - AND $_COOKIE[$var] == $GLOBALS[$var] - ) - define ('spip_interdire_cache', true); - } - } - } - - // sinon il faut les passer nous-memes, a l'exception des interdites. - // (A changer en une liste des variables admissibles...) - else { - foreach (array('_SERVER', '_COOKIE', '_POST', '_GET') as $_table) { - foreach ($GLOBALS[$_table] as $var => $val) { - if (!isset($GLOBALS[$var]) # indispensable securite - AND isset($GLOBALS[$_table][$var]) - AND ($_table == '_SERVER' OR !in_array($var, $refuse_gpc)) - AND ($_table <> '_COOKIE' OR !in_array($var, $refuse_c))) - $GLOBALS[$var] = $val; - } - } - } - -} -?> diff --git a/ecrire/inc/presenter_liste.php b/ecrire/inc/presenter_liste.php deleted file mode 100644 index fe8148881e4bfca5ffc83d208f32ae4f00ffca17..0000000000000000000000000000000000000000 --- a/ecrire/inc/presenter_liste.php +++ /dev/null @@ -1,144 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -define('_TRANCHES', 10); - -// Cette fonction prend un argument un tableau decrivant une requete Select -// et une fonction formatant chaque ligne du resultat de la requete -// Elle renvoie une enumeration HTML de ces lignes formatees, -// avec une pagination appelable en Ajax si $idom et $url sont fournis - -// http://doc.spip.org/@inc_presenter_liste_dist -function inc_presenter_liste_dist($requete, $fonc, &$prims, $own, $force, $styles, $idom='', $title='', $icone='', $url='', $cpt=NULL) -{ - global $spip_display, $spip_lang_left; - - // $requete est passe par reference, pour modifier l'index LIMIT - if ($idom AND $spip_display != 4) - $tranches = affiche_tranche_bandeau($requete, $idom, $url, $cpt, _TRANCHES); - else $tranches = ''; - - $prim = $prims; - $prims = array(); - $result = sql_allfetsel((isset($requete["SELECT"]) ? $requete["SELECT"] : "*"), $requete['FROM'], $requete['WHERE'], $requete['GROUP BY'], $requete['ORDER BY'], $requete['LIMIT']); - - if (!count($result)) { - if (!$force) return ''; - } else { - if ($spip_display != 4) { - $evt = !preg_match(",msie,i", $GLOBALS['browser_name']) ? '' - : " - onmouseover=\"changeclass(this,'tr_liste_over');\" - onmouseout=\"changeclass(this,'tr_liste');\"" ; - - $table = $head = ''; - $th = 0; - foreach ($result as $r) { - if ($prim) $prims[]= $r[$prim]; - if ($vals = $fonc($r, $own)) { - reset($styles); - $res = ''; - foreach ($vals as $t) { - $style = $largeur = $nom = ""; - list(,$s) = each($styles); - if (count($s)) $style = array_shift($s); - if (count($s)) $largeur = array_shift($s); - if (count($s)) $nom = array_shift($s); - if ($largeur) $largeur = " style='width: $largeur" ."px;'"; - if ($style) $style = " class=\"$style\""; - $t = !trim($t) ? " " : lignes_longues($t); - $res .= "\n<td$style$largeur>$t</td>"; - if (!$table) { - $th |= $nom ? 1 : 0; - $head .= "\n<th style='text-align:center'>$nom</th>"; - } - } - $table .= "\n<tr class='tr_liste'$evt>$res</tr>"; - } - } - if (!$th) $head= ''; - $tranches .= "<table width='100%' cellpadding='2' border='0'>$head$table</table>"; - } else { - foreach ($result as $r) { - if ($prim) $prims[]= $r[$prim]; - if ($t = $fonc($r, $own)) { - $tranches = '<li>' . join('</li><li>', $t) . '</li>'; - $tranches = "\n<ul style='text-align: $spip_lang_left; background-color: white;'>" - . $tranches - . "</ul>"; - } - } - } - } - - $id = 't'.substr(md5(join('',$requete)),0,8); - $bouton = !$icone ? '' : bouton_block_depliable($title, true, $id); - - return debut_cadre('liste', $icone, "", $bouton, "", "", false) - . debut_block_depliable(true, $id) - . $tranches - . fin_block() - . fin_cadre('liste'); -} - -// http://doc.spip.org/@afficher_tranches_requete -function afficher_tranches_requete($num_rows, $idom, $url='', $nb_aff = 10, $old_arg=NULL) { - static $ancre = 0; - global $browser_name, $spip_lang_right, $spip_display; - if ($old_arg!==NULL){ // eviter de casser la compat des vieux appels $cols_span ayant disparu ... - $idom = $url; $url = $nb_aff; $nb_aff=$old_arg; - } - - $ancre++; - $self = self(); - $ie_style = ($browser_name == "MSIE") ? "height:1%" : ''; - $style = "style='visibility: hidden; float: $spip_lang_right'"; - $nav= navigation_pagination($num_rows, $nb_aff, $url, _request($idom), $idom, true); - $script = parametre_url($self, $idom, -1); - $l = htmlentities(_T('lien_tout_afficher')); - - return http_img_pack("searching.gif", "*", "$style id='img_$idom'") - . "\n<div style='$ie_style;' class='arial1 tranches' id='a$ancre'>" - . $nav - . "<a href='$script#a$ancre' class='plus'" - . (!$url ? '' : generer_onclic_ajax($url, $idom,-1)) - . "><img title=\"$l\" alt=\"$l\"\nsrc=\"" - . chemin_image("plus-16.png") - . "\" /></a></div>\n"; -} - -// http://doc.spip.org/@affiche_tranche_bandeau -function affiche_tranche_bandeau(&$requete, $idom, $url='', $cpt=NULL, $pas=10) -{ - if (!isset($requete['GROUP BY'])) $requete['GROUP BY'] = ''; - - if ($cpt === NULL) - $cpt = sql_countsel($requete['FROM'], $requete['WHERE'], $requete['GROUP BY']); - - $deb_aff = intval(_request($idom)); - $nb_aff = $pas + ($pas>>1); - - if (isset($requete['LIMIT'])) $cpt = min($requete['LIMIT'], $cpt); - - if ($cpt > $nb_aff) { - $nb_aff = $pas; - $res = afficher_tranches_requete($cpt, $idom, $url, $nb_aff); - } else $res = ''; - - if (!isset($requete['LIMIT']) AND $deb_aff <> -1) - $requete['LIMIT'] = "$deb_aff, $nb_aff"; - - return $res; -} -?> diff --git a/ecrire/inc/selectionner_auteur.php b/ecrire/inc/selectionner_auteur.php deleted file mode 100644 index 319b3c57a60b0aa3f659a8b89d6ba1406ada0ef0..0000000000000000000000000000000000000000 --- a/ecrire/inc/selectionner_auteur.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -include_spip('inc/editer_auteurs'); -include_spip('inc/selectionner'); - -// -// Affiche un mini-navigateur ajax sur les auteurs -// - -// http://doc.spip.org/@inc_selectionner_auteur_dist -function inc_selectionner_auteur_dist($id_article, $type='article') -{ - $idom = "auteur_$type" . "_$id_article"; - $new = $idom . '_new'; - if (!$determiner_non_auteurs = charger_fonction('determiner_non_auteurs_'.$type,'inc',true)) - $determiner_non_auteurs = 'determiner_non_auteurs'; - - $futurs = selectionner_auteur_boucle($determiner_non_auteurs($type, $id_article), $idom); - - // url completee par la fonction JS onkeypress_rechercher - $url = generer_url_ecrire('rechercher_auteur', "idom=$idom&nom="); - - return construire_selectionner_hierarchie($idom, $futurs, '', $url, $new); -} - -// http://doc.spip.org/@selectionner_auteur_boucle -function selectionner_auteur_boucle($where, $idom) -{ - $info = generer_url_ecrire('informer_auteur', "id="); - $idom3 = $idom . '_selection'; - $idom2 = $idom . '_new'; - $idom1 = $idom . '_div'; - $args = "'$idom3', '$info', event"; - $res = ''; - $all = sql_allfetsel("nom, id_auteur", "spip_auteurs", $where, '', "nom, statut"); - foreach ($all as $row) { - - $id = $row["id_auteur"]; - $nom = typo($row["nom"]); - - // attention, les <a></a> doivent etre au premier niveau - // et se suivrent pour que changerhighligth fonctionne - // De plus, leur zone doit avoir une balise et une seule - // autour de la valeur pertinente pour que aff_selection - // fonctionne (faudrait concentrer tout ca). - - $res .= "<a class='highlight off'" - . "\nonclick=\"changerhighlight(this);" - . "findObj_forcer('$idom2').value=" - . $id - . "; aff_selection($id,$args); return false;" - . "\"\nondblclick=\"" - // incomplet: le selecteur devient indisponible. A ameliorer - . "findObj_forcer('$idom').parentNode.innerHTML='" - . attribut_html($nom) - . "'; findObj_forcer('$idom2').value=" - . $id - . "; return false" - . "\"><b>" - . $nom - . "</b></a>"; - } - - return $res; -} -?> diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php index 9f8140c80243e0d27ed9728e27427fdae55b2f80..28fe29f888e0f7ce22f26dfe3260a3f17b61ffc6 100644 --- a/ecrire/inc/utils.php +++ b/ecrire/inc/utils.php @@ -1238,7 +1238,7 @@ function spip_initialisation_core($pi=NULL, $pa=NULL, $ti=NULL, $ta=NULL) { if (!defined('_FILE_CONNECT')) define('_FILE_CONNECT', (@is_readable($f = _DIR_CONNECT . _FILE_CONNECT_INS . '.php') ? $f : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php') ? $f - : (@is_readable($f = _DIR_RESTREINT . 'inc_connect.php3') ? $f + : (_EXTENSION_PHP AND @is_readable($f = _DIR_RESTREINT . 'inc_connect'._EXTENSION_PHP) ? $f : false)))); // Le fichier de reglages des droits @@ -1315,8 +1315,8 @@ function spip_initialisation_core($pi=NULL, $pa=NULL, $ti=NULL, $ta=NULL) { // ne pas desinfecter les globales en profondeur car elle contient aussi les // precedentes, qui seraient desinfectees 2 fois. spip_desinfecte($GLOBALS,false); - include_spip('inc/php3'); - spip_register_globals($x); + if (include_spip('inc/php3')) + spip_register_globals($x); } // appliquer le cookie_prefix diff --git a/ecrire/inc/vieilles_defs.php b/ecrire/inc/vieilles_defs.php deleted file mode 100644 index dde493774d670887ba1473133141f5213a1eb3c8..0000000000000000000000000000000000000000 --- a/ecrire/inc/vieilles_defs.php +++ /dev/null @@ -1,950 +0,0 @@ -<?php - -/***************************************************************************\ - * SPIP, Systeme de publication pour l'internet * - * * - * Copyright (c) 2001-2011 * - * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * - * * - * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * - * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * -\***************************************************************************/ - -if (!defined('_ECRIRE_INC_VERSION')) return; - -/* Ce fichier contient des fonctions, globales ou constantes */ -/* qui ont fait partie des fichiers de configurations de Spip */ -/* mais en ont ete retires ensuite. */ -/* Ce fichier n'est donc jamais charge par la presente version */ -/* mais est present pour que les contributions a Spip puissent */ -/* fonctionner en chargeant ce fichier, en attendant d'etre */ -/* reecrites conformement a la nouvelle interface. */ - -define('_SIGNALER_ECHOS', false); - - -// Log des appels aux vieilles_defs -// http://doc.spip.org/@vieilles_log -function vieilles_log($quoi) { - static $vus = array(); - $c = crc32($quoi); - if (!isset($vus[$c])) { - spip_log($quoi.' '.$GLOBALS['REQUEST_URI'].' - '.$_SERVER['SCRIPT_NAME'], 'vieilles_defs'); - $vus[$c] = 1; - } else if (++$vus[$c] > 100) spip_log("$quoi doit imperativement etre remplacee"); -} - -foreach ( -array( -'debut_raccourcis' => '() { - vieilles_log(\'debut_raccourcis()\'); - - global $spip_display; - echo "<div> </div>"; - echo creer_colonne_droite(\'\', true); - - echo debut_cadre_enfonce(\'\',true); - if ($spip_display != 4) { - echo "<font face=\'Verdana, Geneva, Sans, sans-serif\' size=1>"; - echo "<b>"._T(\'titre_cadre_raccourcis\')."</b><p />"; - } else { - echo "<h3>"._T(\'titre_cadre_raccourcis\')."</h3>"; - echo "<ul>"; - } -} -', - -'fin_raccourcis' => '() { - vieilles_log(\'fin_raccourcis()\'); - - global $spip_display; - - if ($spip_display != 4) echo "</font>"; - else echo "</ul>"; - - echo fin_cadre_enfonce(true); -} - -', - -'include_ecrire' => '($file, $silence=false) { - vieilles_log(\'include_ecrire()\'); - - preg_match(\'/^((inc_)?([^.]*))(\.php[3]?)?$/\', $file, $r); - - // Version new style, surchargeable - # cas speciaux - if ($r[3] == \'index\') return false; // inc/indexation - if ($r[3] == \'db_mysql\') return include_spip(\'base/db_mysql\'); - if ($r[3] == \'connect\') { spip_connect(); return; } - - # cas general - if ($f=include_spip(\'inc/\'.$r[3])) - return $f; - - // fichiers old-style, ecrire/inc_truc.php - if (is_readable($f = _DIR_RESTREINT . $r[1] . \'.php\')) - return include_once($f); -} - -', - -'afficher_script_layer' => '(){ - vieilles_log(\'afficher_script_layer()\'); - -echo $GLOBALS[\'browser_layer\'];} - -', - -'test_layer' => '(){ - vieilles_log(\'test_layer()\'); - -return $GLOBALS[\'browser_layer\'];} - - -', - -'affiche_auteur_boucle' => '($row, &$tous_id){ - vieilles_log(\'affiche_auteur_boucle()\'); - - $vals = \'\'; - - $id_auteur = $row[\'id_auteur\']; - - $nom = $row[\'nom\']; - - $s = bonhomme_statut($row); - $s .= "<a href=\'" . generer_url_ecrire("auteur_infos","id_auteur=$id_auteur") . "\'>"; - $s .= typo($nom); - $s .= "</a>"; - $vals[] = $s; - - return $vals; -} - -', - -'spip_abstract_quote' => '($arg_sql) { - vieilles_log(\'spip_abstract_quote()\'); - - return sql_quote($arg_sql); -} - -', - -'creer_repertoire' => '($base, $subdir) { - vieilles_log(\'creer_repertoire()\'); - - return sous_repertoire($base, $subdir, true); -} - -', - -'parse_plugin_xml' => '($texte, $clean=true){ - vieilles_log(\'parse_plugin_xml()\'); - - include_spip(\'inc/xml\'); - return spip_xml_parse($texte,$clean); -} - -', - -'applatit_arbre' => '($arbre,$separateur = " "){ - vieilles_log(\'applatit_arbre()\'); - - include_spip(\'inc/xml\'); - return spip_xml_aplatit($arbre,$separateur); -} - - -// -// une autre boite -// -', - -'bandeau_titre_boite' => '($titre, $afficher_auteurs, $boite_importante = true) { - vieilles_log(\'bandeau_titre_boite()\'); - - global $couleur_foncee; - if ($boite_importante) { - $couleur_fond = $couleur_foncee; - $couleur_texte = \'#FFFFFF\'; - } - else { - $couleur_fond = \'#EEEECC\'; - $couleur_texte = \'#000000\'; - } - echo "<tr bgcolor=\'$couleur_fond\'><td width=\"100%\"><font face=\'Verdana, Geneva, Sans, sans-serif\' size=\'3\' color=\'$couleur_texte\'>"; - echo "<b>$titre</b></font></td>"; - if ($afficher_auteurs){ - echo "<td width=\'100\'>"; - echo http_img_pack("rien.gif", "", "width=\'100\' height=\'12\'"); - echo "</td>"; - } - echo "<td width=\'90\'>"; - echo http_img_pack("rien.gif", "", "width=\'90\' height=\'12\'"); - echo "</td>"; - echo "</tr>"; -} - -', - -'debut_page' => '($titre = "", $rubrique = "accueil", $sous_rubrique = "accueil", $onLoad = "" /* ignore */, $id_rubrique = "") { - vieilles_log(\'debut_page()\'); - - $commencer_page = charger_fonction(\'commencer_page\', \'inc\'); - echo $commencer_page($titre, $rubrique, $sous_rubrique, $id_rubrique); - if ($onLoad) vieilles_log("parametre obsolete onLoad=$onLoad"); -} - -// obsolete, utiliser calculer_url -', - -'extraire_lien' => '($regs) { - vieilles_log(\'extraire_lien()\'); - - list($lien, $class, $texte) = calculer_url($regs[3], $regs[1],\'tout\'); - // Preparer le texte du lien ; attention s\'il contient un <div> - // (ex: [<docXX|right>->lien]), il faut etre smart - $ref = "<a href=\"$lien\" class=\"$class\">$texte</a>"; - return array($ref, $lien, $texte); -} - -// Prendre la fonction inc_dater_dist, qui fait du Ajax. -', - -'afficher_formulaire_date' => '($script, $args, $texte, $jour, $mois, $annee){ - vieilles_log(\'afficher_formulaire_date()\'); - - global $couleur_foncee; - return generer_url_post_ecrire($script, $args) - . "<table cellpadding=\'5\' border=\'0\' width=\'100%\' background=\'" - . chemin_image(\'rien.gif\') - . "\'>" - . "<tr><td bgcolor=\'$couleur_foncee\' colspan=\'2\'><font size=\'2\' color=\'#ffffff\'><b>" - ._T(\'texte_date_publication_article\') - . "</b></font></tr>" - . "<tr><td align=\'center\'>" - . afficher_jour($jour, "name=\'jour\' size=\'1\' class=\'fondl\'", true) - . afficher_mois($mois, "name=\'mois\' size=\'1\' class=\'fondl\'", true) - . afficher_annee($annee, "name=\'annee\' size=\'1\' class=\'fondl\'",1996) - . "</td><td align=\'right\'>" - . "<input type=\'submit\' name=\'Changer\' class=\'fondo\' value=\'" - . _T(\'bouton_changer\') - . "\'>" - . "</td></tr></table>" - . "</form>"; -} - -', - -'ratio_image' => '($logo, $nom, $format, $taille, $taille_y, $attributs) { - vieilles_log(\'ratio_image()\'); - - // $logo est le nom complet du logo ($logo = "chemin/$nom.$format) - // $nom et $format ne servent plus du fait du passage par le filtre image_reduire - include_spip(\'inc/filtres_images_mini\'); - $res = image_reduire("<img src=\'$logo\' $attributs />", $taille, $taille_y); - return $res; -} - -', - -'entites_unicode' => '($texte) { - vieilles_log(\'entites_unicode()\'); - - return charset2unicode($texte); -} - - -// utiliser directement le corps a present. - -', - -'afficher_claret' => '() { - vieilles_log(\'afficher_claret()\'); - - include_spip(\'inc/layer\'); - return $GLOBALS[\'browser_caret\']; -} - - -', - -'spip_insert_id' => '() { - vieilles_log(\'spip_insert_id()\'); - - return mysql_insert_id(); -} - - -// revenir a la langue precedente -', - -'lang_dselect' => '() { - vieilles_log(\'lang_dselect()\'); - - lang_select(); -} -// toujours disponible pour PHP > 4.0.1 -$GLOBALS[\'flag_revisions\'] = function_exists("gzcompress"); - -// toujours a cette valeur a present -$GLOBALS[\'options\'] = \'avancees\'; - -// synonyme plus jamais utile -$GLOBALS[\'langue_site\'] = $GLOBALS[\'meta\'][\'langue_site\']; -$GLOBALS[\'all_langs\'] = @$GLOBALS[\'meta\'][\'langues_proposees\']; -', - -'generer_url_post_ecrire' => '($script, $args=\'\', $name=\'\', $ancre=\'\', $onchange=\'\') { - vieilles_log(\'generer_url_post_ecrire()\'); - - include_spip(\'inc/filtres\'); - $action = generer_url_ecrire($script, $args); - if ($name) $name = " name=\'$name\'"; - return "\n<form action=\'$action$ancre\'$name method=\'post\'$onchange>" - .form_hidden($action); -} - -', - -'afficher_articles' => '($titre, $requete, $formater=\'\') { - vieilles_log(\'afficher_articles()\'); - - afficher_objets(\'article\',$titre,$requete,$formater); -} -', - -'afficher_auteurs' => '($titre_table, $requete) { - vieilles_log(\'afficher_auteurs()\'); - - afficher_objets(\'auteur\',$titre_table,$requete,\'\'); -} -', - -'afficher_sites' => '($titre_table, $requete){ - vieilles_log(\'afficher_sites()\'); - - afficher_objets(\'site\',$titre_table,$requete,\'\'); -} -', - -'afficher_syndic_articles' => '($titre_table, $requete, $id = 0) { - vieilles_log(\'afficher_syndic_articles()\'); - - afficher_objets(\'syndic_article\',$titre_table,$requete,$id); -} - -// Retourne les droits de publication d\'un auteur selon le codage suivant: -// - le tableau de ses rubriques si c\'est un admin restreint -// - 0 si c\'est un admin de plein droit -// - la chaine indiquant son statut s\'il n\'est pas admin - -', - -'auth_rubrique' => '($id_auteur, $statut) -{ - - - if ($statut != \'0minirezo\') return $statut; - - $result = sql_select("id_objet as id_rubrique", "spip_auteurs_liens", "objet=\'rubrique\' AND id_auteur=$id_auteur AND id_objet!=\'0\'"); - if (!sql_count($result)) { - return 0; - } - $rubriques = array(); - for (;;) { - $r = array(); - while ($row = spip_fetch_array($result)) { - $id_rubrique = $row[\'id_rubrique\']; - $r[]= $rubriques[$id_rubrique] = $id_rubrique; - } - if (!$r) return $rubriques; - $r = join(\',\', $r); - - $result = sql_select("id_rubrique", "spip_rubriques", "id_parent IN ($r) AND id_rubrique NOT IN ($r)"); - } -} - -', - -'bouton_block_invisible' => '($nom_block, $icone=\'\') { - vieilles_log(\'bouton_block_invisible()\'); - include_spip(\'inc/layer\'); - return bouton_block_depliable(_T("info_sans_titre"),false,$nom_block); -} - -', - -'bouton_block_visible' => '($nom_block){ - vieilles_log(\'bouton_block_visible()\'); - include_spip(\'inc/layer\'); - return bouton_block_depliable(_T("info_sans_titre"),true,$nom_block); -} - -', - -'debut_block_visible' => '($id=""){ - vieilles_log(\'debut_block_visible()\'); - include_spip(\'inc/layer\'); - return debut_block_depliable(true,$id); -} - -', - -'debut_block_invisible' => '($id=""){ - vieilles_log(\'debut_block_invisible()\'); - include_spip(\'inc/layer\'); - return debut_block_depliable(false,$id); -} - -', - -'init_config' => '(){ - vieilles_log(\'init_config()\'); - - include_spip(\'inc/config\'); - inc_config_dist(); -} - -', - -/* -'extraire_tags' => '($texte) { - vieilles_log(\'extraire_tags()\'); - - return extraire_balises($texte, \'a\'); -} -', - -// synonyme de extraire_balise -'extraire_tag' => '($texte, $tag=\'a\') { - vieilles_log(\'extraire_tag()\'); - - return extraire_balise($texte, $tag); -} - -', -*/ - -// -// une autre boite -// - -'bandeau_titre_boite2' => '($titre, $logo="", $fond="toile_blanche", $texte="ligne_noire") { - vieilles_log(\'bandeau_titre_boite2()\'); - global $spip_lang_left, $spip_display, $browser_name; - - if (strlen($logo) > 0 AND $spip_display != 1 AND $spip_display != 4) { - $ie_style = ($browser_name == "MSIE") ? "height:1%" : \'\'; - - return "\n<div style=\'position: relative;$ie_style\'>" - . "\n<div style=\'position: absolute; top: -12px; $spip_lang_left: 3px;\'>" - . http_img_pack($logo, "", "") - . "</div>" - . "\n<div style=\'padding: 3px; padding-$spip_lang_left: 30px; border-bottom: 1px solid #444444;\' class=\'verdana2 $fond $texte\'>$titre</div>" - . "</div>"; - } else { - return "<h3 style=\'padding: 3px; border-bottom: 1px solid #444444; margin: 0px;\' class=\'verdana2 $fond $texte\'>$titre</h3>"; - } -} - -', - -'spip_free_result' => '($r) { - vieilles_log(\'spip_free_result()\'); - - sql_free($r); -} - -', - -'creer_objet_multi' => '($r, $l) { - vieilles_log(\'creer_objet_multi()\'); - - sql_multi($r, $l); -} - -', - -'envoyer_mail' => '($email, $sujet, $texte, $from = "", $headers = "") { - vieilles_log(\'envoyer_mail()\'); - define(\'_FUNCTION_ENVOYER_MAIL\', charger_fonction(\'envoyer_mail\', \'inc\')); - $args = func_get_args(); - if (_FUNCTION_ENVOYER_MAIL){ - return call_user_func_array(_FUNCTION_ENVOYER_MAIL, $args); - } -} - - -', - -'spip_num_rows' => '($r) { - vieilles_log(\'spip_num_rows()\'); - - return sql_count($r); -} - - - ', - -'spip_abstract_serveur' => '($ins_sql, $serveur) { - vieilles_log(\'spip_abstract_serveur()\'); - return sql_serveur($ins_sql, $serveur); - } - - ', - -'spip_abstract_select' => '( - $select = array(), $from = array(), $where = array(), - $groupby = \'\', $orderby = array(), $limit = \'\', - $sousrequete = \'\', $having = array(), - $table = \'\', $id = \'\', $serveur=\'\') { - return sql_select( - $select, $from, $where, - $groupby, $orderby, $limit, - $sousrequete, $having, - $table, $id, $serveur); - } - - ', - -'spip_abstract_fetch' => '($res, $serveur=\'\') { - vieilles_log(\'spip_abstract_fetch()\'); - return sql_fetch($res, $serveur); - } - - ', - -'spip_abstract_count' => '($res, $serveur=\'\') { - vieilles_log(\'spip_abstract_count()\'); - return sql_count($res, $serveur); - } - - ', - -'spip_abstract_free' => '($res, $serveur=\'\') { - vieilles_log(\'spip_abstract_free()\'); - return sql_free($res, $serveur); - } - - ', - -'spip_abstract_insert' => '($table, $noms, $valeurs, $serveur=\'\') { - vieilles_log(\'spip_abstract_insert()\'); - return sql_insert($table, $noms, $valeurs, $serveur); - } - - ', - -'spip_abstract_update' => '($table, $exp, $where, $serveur=\'\') { - vieilles_log(\'spip_abstract_update()\'); - return sql_update($table, $exp, $where, $serveur); - } - - ', - -'spip_abstract_delete' => '($table, $where, $serveur=\'\') { - vieilles_log(\'spip_abstract_delete()\'); - return sql_delete($table, $where, $serveur); - } - - ', - -'spip_abstract_replace' => '($table, $values, $keys, $serveur=\'\'){ - vieilles_log(\'spip_abstract_replace()\'); - return sql_replace($table, $values, $keys, $serveur); - } - - ', - -'spip_abstract_showtable' => '($table, $serveur=\'\', $table_spip = false) { - vieilles_log(\'spip_abstract_showtable()\'); - return sql_showtable($table, $table_spip, $serveur); - } - - ', - -'spip_abstract_create' => '($nom, $champs, $cles, $autoinc=false, $temporary=false, $serveur=\'\') { - vieilles_log(\'spip_abstract_create()\'); - return sql_create($nom, $champs, $cles, $autoinc, $temporary, $serveur); - } - - ', - -'spip_create_table' => '($nom, $champs, $cles, $autoinc=false, $temporary=false) { - vieilles_log(\'spip_create_table()\'); - return sql_create($nom, $champs, $cles, $autoinc, $temporary); - } - - ', - -'spip_abstract_multi' => '($sel, $lang, $serveur=\'\') { - vieilles_log(\'spip_abstract_multi()\'); - return sql_multi($sel, $lang, $serveur); - } - - ', - -'spip_abstract_fetsel' => '( - $select = array(), $from = array(), $where = array(), - $groupby = \'\', $orderby = array(), $limit = \'\', - $sousrequete = \'\', $having = array(), - $table = \'\', $id = \'\', $serveur=\'\') { - return sql_fetsel( - $select, $from, $where, - $groupby, $orderby, $limit, - $sousrequete, $having, - $table, $id, $serveur); - } - - ', - -'spip_abstract_countsel($from = array(), $where = array' => '(), - $groupby = \'\', $limit = \'\', $sousrequete = \'\', $having = array(), - $serveur=\'\') { - return sql_countsel($from, $where, - $groupby, $limit, $sousrequete, $having, - $serveur); - } - - ', - -'spip_sql_error' => '($query, $serveur=\'\') { - vieilles_log(\'spip_sql_error()\'); - return sql_error($query, $serveur); - } - - ', - -'spip_mysql_version' => '($serveur=\'\', $option=true) { - vieilles_log(\'spip_mysql_version()\'); - return sql_version($query, $serveur); - } - - ', - -'spip_sql_errno' => '($serveur=\'\') { - vieilles_log(\'spip_sql_errno()\'); - return sql_errno($serveur); - } - - // r9916 - ', - -'sql_calendrier_mois' => '($annee,$mois,$jour) { - vieilles_log(\'sql_calendrier_mois()\'); - return quete_calendrier_mois($annee,$mois,$jour); - } - - ', - -'sql_calendrier_semaine' => '($annee,$mois,$jour) { - vieilles_log(\'sql_calendrier_semaine()\'); - return quete_calendrier_semaine($annee,$mois,$jour); - } - - ', - -'sql_calendrier_jour' => '($annee,$mois,$jour) { - vieilles_log(\'sql_calendrier_jour()\'); - return quete_calendrier_jour($annee,$mois,$jour); - } - - ', - -'sql_calendrier_interval' => '($limites) { - vieilles_log(\'sql_calendrier_interval()\'); - return quete_calendrier_interval($limites); - } - - ', - -' sql_calendrier_interval_forums' => '($limites, &$evenements) { - vieilles_log(\' sql_calendrier_interval_forums()\'); - return quete_calendrier_interval_forums($limites, $evenements); - } - - ', - -'sql_calendrier_interval_articles' => '($avant, $apres, &$evenements) { - vieilles_log(\'sql_calendrier_interval_articles()\'); - return quete_calendrier_interval_articles($avant, $apres, $evenements); - } - - ', - -'sql_calendrier_interval_rubriques' => '($avant, $apres, &$evenements) { - vieilles_log(\'sql_calendrier_interval_rubriques()\'); - return quete_calendrier_interval_rubriques($avant, $apres, $evenements); - } - - ', - -'sql_calendrier_interval_breves' => '($avant, $apres, &$evenements) { - vieilles_log(\'sql_calendrier_interval_breves()\'); - return quete_calendrier_interval_breves($avant, $apres, $evenements); - } - - ', - -'sql_calendrier_interval_rv' => '($avant, $apres) { - vieilles_log(\'sql_calendrier_interval_rv()\'); - return quete_calendrier_interval_rv($avant, $apres); - } - - ', - -'sql_calendrier_taches_annonces' => '() { - vieilles_log(\'sql_calendrier_taches_annonces()\'); - return quete_calendrier_taches_annonces (); - } - - ', - -'sql_calendrier_taches_pb' => '() { - vieilles_log(\'sql_calendrier_taches_pb()\'); - return quete_calendrier_taches_pb (); - } - - ', - -'sql_calendrier_taches_rv' => '() { - vieilles_log(\'sql_calendrier_taches_rv()\'); - return quete_calendrier_taches_rv (); - } - - ', - -'sql_calendrier_agenda' => '($annee, $mois) { - vieilles_log(\'sql_calendrier_agenda()\'); - return quete_calendrier_agenda ($annee, $mois); - } - - //r9918 - ', - -'sql_rubrique_fond' => '($contexte) { - vieilles_log(\'sql_rubrique_fond()\'); - return quete_rubrique_fond($contexte); - } - - ', - -'sql_chapo' => '($id_article) { - vieilles_log(\'sql_chapo()\'); - return quete_chapo($id_article); - } - - ', - -'sql_parent' => '($id_rubrique) { - vieilles_log(\'sql_parent()\'); - return quete_parent($id_rubrique); - } - - ', - -'sql_profondeur' => '($id) { - vieilles_log(\'sql_profondeur()\'); - return quete_profondeur($id); - } - - ', - -'sql_rubrique' => '($id_article) { - vieilles_log(\'sql_rubrique()\'); - return quete_rubrique($id_article); - } - - ', - -'sql_petitions' => '($id_article, $table, $id_boucle, $serveur, &$cache) { - vieilles_log(\'sql_petitions()\'); - return quete_petitions($id_article, $table, $id_boucle, $serveur, $cache); - } - - ', - -'sql_accepter_forum' => '($id_article) { - vieilles_log(\'sql_accepter_forum()\'); - return quete_accepter_forum($id_article); - } - - ', - -'trouver_def_table' => '($nom, &$boucle) { - vieilles_log(\'trouver_def_table()\'); - global $tables_principales, $tables_auxiliaires, $table_des_tables, $tables_des_serveurs_sql; - - $nom_table = $nom; - $s = $boucle->sql_serveur; - if (!$s) { - $s = \'localhost\'; - if (in_array($nom, $table_des_tables)) - $nom_table = \'spip_\' . $nom; - } - $desc = $tables_des_serveurs_sql[$s]; - - if (isset($desc[$nom_table])) - return array($nom_table, $desc[$nom_table]); - include_spip(\'base/auxiliaires\'); - $nom_table = \'spip_\' . $nom; - if ($desc = $tables_auxiliaires[$nom_table]) - return array($nom_table, $desc); - if ($desc = sql_showtable($nom, $boucle->sql_serveur)) - if (isset($desc[\'field\'])) { - // faudrait aussi prevoir le cas du serveur externe - $tables_principales[$nom] = $desc; - return array($nom, $desc); - } - erreur_squelette(_T(\'zbug_table_inconnue\', array(\'table\' => $nom)), - $boucle->id_boucle); - return false; - } -', -'meme_rubrique' => '($id_rubrique, $id, $type, $order="date", $limit=NULL, $ajax=false) { - $meme_rubrique = charger_fonction("meme_rubrique", "inc"); - return $meme_rubrique($id_rubrique, $id, $type, $order, $limit, $ajax); - } -', -'afficher_liste' => '($largeurs, $table, $styles = \'\') { - global $spip_display; - - if (!$table OR !is_array($table)) return ""; - - if ($spip_display != 4) { - $res = \'\'; - foreach ($table as $t) { - $res .= afficher_liste_display_neq4($largeurs, $t, $styles); - } - } else { - $res = "\n<ul style=\'text-align: $spip_lang_left; background-color: white;\'>"; - foreach ($table as $t) { - $res .= afficher_liste_display_eq4($largeurs, $t, $styles); - } - $res .= "\n</ul>"; - } - - return $res; - } -', -'afficher_liste_display_neq4' => '($largeurs, $t, $styles = \'\') { - - global $browser_name; - - $evt = (preg_match(",msie,i", $browser_name) ? " onmouseover=\"changeclass(this,\'tr_liste_over\');\" onmouseout=\"changeclass(this,\'tr_liste\');\"" :\'\'); - - reset($largeurs); - if ($styles) reset($styles); - $res =\'\'; - while (list(, $texte) = each($t)) { - $style = $largeur = ""; - list(, $largeur) = each($largeurs); - if ($styles) list(, $style) = each($styles); - if (!trim($texte)) $texte .= " "; - $res .= "\n<td" . - ($largeur ? (" style=\'width: $largeur" ."px;\'") : \'\') . - ($style ? " class=\"$style\"" : \'\') . - ">" . lignes_longues($texte) . "\n</td>"; - } - - return "\n<tr class=\'tr_liste\'$evt>$res</tr>"; - } -', -'afficher_liste_display_eq4' => '($largeurs, $t, $styles = \'\') { - - reset($largeurs); - while (list(, $texte) = each($t)) { - $largeur = ""; - list(, $largeur) = each($largeurs); - if (!$largeur) $res .= $texte." "; - } - - return "\n<li>$res</li>\n"; -}', - -'barre_textarea' =>'($texte, $rows, $cols, $lang=\'\') { - static $num_textarea = 0; - include_spip("inc/layer"); // definit browser_barre - - $texte = entites_html($texte); - if (!$GLOBALS["browser_barre"]) - return "<textarea name=\'texte\' rows=\'$rows\' class=\'forml\' cols=\'$cols\'>$texte</textarea>"; - - $num_textarea++; - include_spip("inc/barre"); - return afficher_barre("document.getElementById(\'textarea_$num_textarea\')", true, $lang) . - " -<textarea name=\'texte\' rows=\'$rows\' class=\'forml\' cols=\'$cols\' -id=\'textarea_$num_textarea\' -onselect=\'storeCaret(this);\' -onclick=\'storeCaret(this);\' -onkeyup=\'storeCaret(this);\' -ondblclick=\'storeCaret(this);\'>$texte</textarea>"; -}', - - 'generer_url_article' => '($id, $args="", $ancre="") - { vieilles_log(\'generer_url_article\'); return generer_url_entite($id, "article", $args, $ancre);}', - - 'generer_url_rubrique' => '($id, $args="", $ancre="") { - vieilles_log(\'generer_url_rubrique\'); return generer_url_entite($id, "rubrique", $args, $ancre);}', - - 'generer_url_breve' => '($id, $args="", $ancre="") { - vieilles_log(\'generer_url_breve\'); return generer_url_entite($id, "breve", $args, $ancre);}', - - 'generer_url_mot' => '($id, $args="", $ancre="") { - vieilles_log(\'generer_url_mot\'); return generer_url_entite($id, "mot", $args, $ancre);}', - - 'generer_url_site' => '($id, $args="", $ancre="") { - vieilles_log(\'generer_url_site\'); return generer_url_entite($id, "site", $args, $ancre);}', - - 'generer_url_auteur' => '($id, $args="", $ancre="") { - vieilles_log(\'generer_url_auteur\'); return generer_url_entite($id,"auteur", $args, $ancre);}', - - 'charger_generer_url' => '($prive=NULL) { - vieilles_log(\'charger_generer_url\'); generer_url_entite("", "", "", "", !$prive);}', - - 'tester_variable' => '($n, $v) { - if (!isset($GLOBALS[$n])) $GLOBALS[$n] = $v; - return $GLOBALS[$n];}', - -// SPIP < 2.1 - 'barre_typo' => '($id,$lang=\'\',$forum=false){ - return \'\';}', - - 'afficher_barre' => '(){ - return \'\';}', - -// SPIP < 2.3 - - 'icone'=> '($texte, $lien, $fond, $fonction="", $align="", $echo=false){ - $retour = "<div style=\'padding-top: 20px;width:100px\' class=\'icone36\'>" . icone_inline($texte, $lien, $fond, $fonction, $align) . "</div>"; - if ($echo) echo_log(\'icone\',$retour); else return $retour;}', - - 'icone_horizontale_display'=> '($texte, $lien, $fond = "", $fonction = "", $af = true, $js=\'\') { - return icone_horizontale($texte, $lien, $fond, $fonction, $af, $js);}', - - -) as $f => $def) { - if (!function_exists($f)) { - eval("function $f$def"); - } -} - - -define('_DIR_DOC', _DIR_IMG); -//constantes spip pour mysql_fetch_array() -define('SPIP_BOTH', MYSQL_BOTH); -define('SPIP_ASSOC', MYSQL_ASSOC); -define('SPIP_NUM', MYSQL_NUM); - -// http://doc.spip.org/@article_select -function article_select($id_article, $id_rubrique=0, $lier_trad=0, $id_version=0) { - $article_select = charger_fonction('article_select','inc'); - return $article_select($id_article,$id_rubrique,$lier_trad,$id_version); -} - - -?> diff --git a/ecrire/inc_version.php b/ecrire/inc_version.php index 9be3a7d59f36b2eea77c96c742b89d507dd8728c..0824d09c55ce010ff2619b1875764a544c4dd654 100644 --- a/ecrire/inc_version.php +++ b/ecrire/inc_version.php @@ -17,15 +17,15 @@ define('_ECRIRE_INC_VERSION', "1"); # masquer les eventuelles erreurs sur les premiers define error_reporting(E_ALL ^ E_NOTICE); # compatibilite anciennes versions -# si vous n'avez aucun fichier .php3, redefinissez a "" -# ne concerne que le fichier mes_options.php3 -define('_EXTENSION_PHP', '.php3'); +# si vous avez encore un fichier .php3, redefinissez a ".php3" +# concerne mes_options.php3 / mes_fonctions.php3 / inc_connect.php3 +define('_EXTENSION_PHP', ''); #define('_EXTENSION_PHP', ''); #mettre a true pour compatibilite PHP3 define('_FEED_GLOBALS', false); # version PHP minimum exigee (cf. inc/utils) -define ('_PHP_MIN', '4.4.11'); +define ('_PHP_MIN', '5.1.0'); # le nom du repertoire ecrire/ if (!defined('_DIR_RESTREINT_ABS')) define('_DIR_RESTREINT_ABS', 'ecrire/'); diff --git a/ecrire/public/composer.php b/ecrire/public/composer.php index c6d9fc76364d01d45638bfabe29e88a243988f0c..8f7b4cf8b6f4340c79ef8ee707a48039dd28ab39 100644 --- a/ecrire/public/composer.php +++ b/ecrire/public/composer.php @@ -135,7 +135,7 @@ function squelette_obsolete($skel, $squelette) { // par hit if (is_null($date_change)){ if (@file_exists($fonc = 'mes_fonctions.php') - OR @file_exists($fonc = 'mes_fonctions.php3')) + OR (_EXTENSION_PHP AND @file_exists($fonc = 'mes_fonctions'._EXTENSION_PHP))) $date_change = @filemtime($fonc); # compatibilite if (defined('_FILE_OPTIONS')) $date_change = max($date_change,@filemtime(_FILE_OPTIONS));