Skip to content
Extraits de code Groupes Projets
Valider 836bd3b5 rédigé par cerdic's avatar cerdic
Parcourir les fichiers

retablir la cesure des textes trop long

cela ne semble lie qu'a certains navigateurs (IE ?), il serait bon de ne pas l'activer sur les autres
desactiver l'ajax de articles_edit pour le moment (seuls cas d'utilisation = les controles md5)
inc/editer_article disparait, remplace par formulaires/editer_article/charger
parent 02f90fec
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -641,7 +641,6 @@ ecrire/inc/distant.php -text ...@@ -641,7 +641,6 @@ ecrire/inc/distant.php -text
ecrire/inc/documenter.php -text ecrire/inc/documenter.php -text
ecrire/inc/drapeau_edition.php -text ecrire/inc/drapeau_edition.php -text
ecrire/inc/editer.php -text ecrire/inc/editer.php -text
ecrire/inc/editer_article.php -text
ecrire/inc/editer_auteurs.php -text ecrire/inc/editer_auteurs.php -text
ecrire/inc/editer_mot.php -text ecrire/inc/editer_mot.php -text
ecrire/inc/envoyer_mail.php -text ecrire/inc/envoyer_mail.php -text
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
[<p class="formulaire_message">(#ENV*{message_ok})</p>] [<p class="formulaire_message">(#ENV*{message_ok})</p>]
[<p class='formulaire_erreur'>(#ENV*{message_erreur})</p>] [<p class='formulaire_erreur'>(#ENV*{message_erreur})</p>]
[(#ENV{editable}) [(#ENV{editable})
<form method='post' action='#ENV{action}' enctype='multipart/form-data' > <form method='post' action='#ENV{action}' enctype='multipart/form-data' class='noajax'>
[(#REM) declarer les hidden qui declencheront le service du formulaire [(#REM) declarer les hidden qui declencheront le service du formulaire
parametre : url d'action ] parametre : url d'action ]
#ACTION_FORMULAIRE{#ENV{action}} #ACTION_FORMULAIRE{#ENV{action}}
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<input type='text' name='surtitre' id='surtitre' class='forml' value="[(#ENV**{surtitre})]" /> <input type='text' name='surtitre' id='surtitre' class='forml' value="[(#ENV**{surtitre})]" />
[<span class='erreur'>(#ENV**{erreurs}|table_valeur{surtitre})</span>] [<span class='erreur'>(#ENV**{erreurs}|table_valeur{surtitre})</span>]
</li>] </li>]
<li class="gauche gauche_obligatoire"> <li class="gauche obligatoire">
<label for="titre"><:info_titre:><em>#AIDER{arttitre}</em></label> <label for="titre"><:info_titre:><em>#AIDER{arttitre}</em></label>
<input type='text' name='titre' id='titre' class='formo' value="[(#ENV**{titre,#REM|concat{info_nouvel_article}|_T})]" <input type='text' name='titre' id='titre' class='formo' value="[(#ENV**{titre,#REM|concat{info_nouvel_article}|_T})]"
[(#ENV{titre,''}|?{'',' '})onfocus="if(!antifocus){this.value='';antifocus=true;}"]/> [(#ENV{titre,''}|?{'',' '})onfocus="if(!antifocus){this.value='';antifocus=true;}"]/>
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
[(#ENV**{config}|table_valeur{articles_texte}|=={non}|?{#ENV**{texte,''},' '}|?{' '}) [(#ENV**{config}|table_valeur{articles_texte}|=={non}|?{#ENV**{texte,''},' '}|?{' '})
<li class="haut"> <li class="haut">
<label for="text_area"><:info_texte:><em>#AIDER{arttexte}</em></label> <label for="text_area"><:info_texte:><em>#AIDER{arttexte}</em></label>
[(#ENV**{_texte_trop_long,''})]
<div class="commentaire"><:texte_enrichir_mise_a_jour:><em>#AIDER{raccourcis}</em></div> <div class="commentaire"><:texte_enrichir_mise_a_jour:><em>#AIDER{raccourcis}</em></div>
[(#ENV**{config}|table_valeur{afficher_barre}|?{#VAL{text_area}|barre_typo{#LANG}})] [(#ENV**{config}|table_valeur{afficher_barre}|?{#VAL{text_area}|barre_typo{#LANG}})]
<textarea name='texte' id='text_area' class='formo barre_inserer' rows='[(#ENV**{config}|table_valeur{lignes}|plus{2})]' cols='40'[ <textarea name='texte' id='text_area' class='formo barre_inserer' rows='[(#ENV**{config}|table_valeur{lignes}|plus{2})]' cols='40'[
......
...@@ -14,7 +14,6 @@ if (!defined("_ECRIRE_INC_VERSION")) return; ...@@ -14,7 +14,6 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
include_spip('inc/actions'); include_spip('inc/actions');
include_spip('inc/editer'); include_spip('inc/editer');
include_spip('inc/editer_article');
// http://doc.spip.org/@inc_editer_article_dist // http://doc.spip.org/@inc_editer_article_dist
function formulaires_editer_article_charger_dist($id_article='new', $id_rubrique=0, $lier_trad=0, $retour='', $config_fonc='articles_edit_config', $row=array(), $hidden=''){ function formulaires_editer_article_charger_dist($id_article='new', $id_rubrique=0, $lier_trad=0, $retour='', $config_fonc='articles_edit_config', $row=array(), $hidden=''){
...@@ -34,6 +33,12 @@ function formulaires_editer_article_charger_dist($id_article='new', $id_rubrique ...@@ -34,6 +33,12 @@ function formulaires_editer_article_charger_dist($id_article='new', $id_rubrique
$contexte = $row; $contexte = $row;
$contexte['config'] = $config = $config_fonc($row); $contexte['config'] = $config = $config_fonc($row);
$att_text = " class='formo' "
. $GLOBALS['browser_caret']
. " rows='"
. ($config['lignes'] +15)
. "' cols='40'";
list($contexte['texte'],$contexte['_texte_trop_long']) = editer_article_recolle($contexte['texte'],$att_text);
// on veut conserver la langue de l'interface ; // on veut conserver la langue de l'interface ;
// on passe cette donnee sous un autre nom, au cas ou le squelette // on passe cette donnee sous un autre nom, au cas ou le squelette
...@@ -70,4 +75,76 @@ function formulaires_editer_article_charger_dist($id_article='new', $id_rubrique ...@@ -70,4 +75,76 @@ function formulaires_editer_article_charger_dist($id_article='new', $id_rubrique
return $contexte; return $contexte;
} }
//
// Gestion des textes trop longs (limitation brouteurs)
// utile pour les textes > 32ko
// http://doc.spip.org/@coupe_trop_long
function coupe_trop_long($texte){
$aider = charger_fonction('aider', 'inc');
if (strlen($texte) > 28*1024) {
$texte = str_replace("\r\n","\n",$texte);
$pos = strpos($texte, "\n\n", 28*1024); // coupe para > 28 ko
if ($pos > 0 and $pos < 32 * 1024) {
$debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n";
$suite = substr($texte, $pos + 2);
} else {
$pos = strpos($texte, " ", 28*1024); // sinon coupe espace
if (!($pos > 0 and $pos < 32 * 1024)) {
$pos = 28*1024; // au pire (pas d'espace trouv'e)
$decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere
} else {
$decalage = 1;
}
$debut = substr($texte,0,$pos + $decalage); // Il faut conserver l'espace s'il y en a un
$suite = substr($texte,$pos + $decalage);
}
return (array($debut,$suite));
}
else
return (array($texte,''));
}
// http://doc.spip.org/@editer_article_recolle
function editer_article_recolle($texte, $att_text)
{
if ((strlen($texte)<29*1024)
/*OR pas le navigateur qui pose probleme */ )
return array($texte,"");
include_spip('inc/barre');
$textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n";
$nombre = 0;
while (strlen($texte)>29*1024) {
$nombre ++;
list($texte1,$texte) = coupe_trop_long($texte);
$id = "document.getElementById('texte$nombre')";
$textes_supplement .= "<br />" . afficher_barre($id) .
"<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n";
}
return array($texte,$textes_supplement);
}
// Choix par defaut des options de presentation
// http://doc.spip.org/@articles_edit_config
function articles_edit_config($row)
{
global $champs_extra, $spip_ecran, $spip_lang, $spip_display;
$config = $GLOBALS['meta'];
$config['lignes'] = ($spip_ecran == "large")? 8 : 5;
$config['afficher_barre'] = $spip_display != 4;
$config['langue'] = $spip_lang;
if ($champs_extra) {
include_spip('inc/extra');
$config['extra'] = true;
} else $config['extra'] = false;
$config['restreint'] = ($row['statut'] == 'publie');
return $config;
}
?> ?>
\ No newline at end of file
...@@ -14,7 +14,6 @@ if (!defined("_ECRIRE_INC_VERSION")) return; ...@@ -14,7 +14,6 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
include_spip('inc/actions'); include_spip('inc/actions');
include_spip('inc/editer'); include_spip('inc/editer');
include_spip('inc/editer_article');
// http://doc.spip.org/@inc_editer_article_dist // http://doc.spip.org/@inc_editer_article_dist
function formulaires_editer_article_traiter_dist($id_article='new', $id_rubrique=0, $lier_trad=0, $retour='', $config_fonc='articles_edit_config', $row=array(), $hidden=''){ function formulaires_editer_article_traiter_dist($id_article='new', $id_rubrique=0, $lier_trad=0, $retour='', $config_fonc='articles_edit_config', $row=array(), $hidden=''){
......
...@@ -138,6 +138,10 @@ ol.formfx .commentaire_bas{ ...@@ -138,6 +138,10 @@ ol.formfx .commentaire_bas{
float: #GET{left}; float: #GET{left};
margin-#GET{left}: -20px; margin-#GET{left}: -20px;
} }
ol.formfx li.obligatoire label {
font-weight: bold;
}
ol.formfx li.gauche { ol.formfx li.gauche {
clear: left; clear: left;
list-style: none; list-style: none;
...@@ -153,7 +157,7 @@ ol.formfx li.gauche label { ...@@ -153,7 +157,7 @@ ol.formfx li.gauche label {
width: 110px; width: 110px;
background: url([(#REM|sinon{[(#EVAL{ _DIR_IMG_PACK})]label-fond-gauche-[(#ENV{ltr})].gif}|image_sepia{#ENV{couleur_foncee,3874b0}}|extraire_attribut{src})]) center [(#GET{right})] no-repeat; background: url([(#EVAL{_DIR_IMG_PACK}|concat{label-fond-gauche-,#ENV{ltr},.gif}|image_sepia{#ENV{couleur_foncee,3874b0}}|extraire_attribut{src})]) center [(#GET{right})] no-repeat;
font-size: 9px; font-size: 9px;
color: white; color: white;
...@@ -166,14 +170,13 @@ ol.formfx li.gauche label { ...@@ -166,14 +170,13 @@ ol.formfx li.gauche label {
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
} }
ol.formfx li.gauche_obligatoire label { ol.formfx li.gauche.obligatoire label {
background: url([(#REM|sinon{[(#EVAL{ _DIR_IMG_PACK})]label-fond-gauche-[(#ENV{ltr})].gif}|image_sepia{#666666}|extraire_attribut{src})]) center [(#GET{right})] no-repeat; background: url([(#EVAL{_DIR_IMG_PACK}|concat{label-fond-gauche-,#ENV{ltr},.gif}|image_sepia{#666666}|extraire_attribut{src})]) center [(#GET{right})] no-repeat;
font-weight: bold;
} }
ol.formfx li.gauche input, ol.formfx textarea { ol.formfx li.gauche input, ol.formfx textarea {
// border-color: #GET{foncee}; // border-color: #GET{foncee};
} }
ol.formfx li.gauche_obligatoire input, ol.formfx li.haut_obligatoire input { ol.formfx li.obligatoire input {
font-weight: bold; font-weight: bold;
border-color: #GET{foncee}; border-color: #GET{foncee};
} }
...@@ -200,9 +203,12 @@ ol.formfx li.haut label { ...@@ -200,9 +203,12 @@ ol.formfx li.haut label {
padding-left: 5px; padding-left: 5px;
padding-right: 5px; padding-right: 5px;
margin-bottom: 0px; margin-bottom: 0px;
background: url([(#REM|sinon{[(#EVAL{ _DIR_IMG_PACK})]label-fond-haut-[(#ENV{ltr})].gif}|image_sepia{#ENV{couleur_foncee,3874b0}}|extraire_attribut{src})]) bottom [(#GET{left})] no-repeat; background: url([(#EVAL{_DIR_IMG_PACK}|concat{label-fond-haut-,#ENV{ltr},.gif}|image_sepia{#ENV{couleur_foncee,3874b0}}|extraire_attribut{src})]) bottom [(#GET{left})] no-repeat;
} }
ol.formfx li.haut.obligatoire label {
background: url([(#EVAL{_DIR_IMG_PACK}|concat{label-fond-haut-,#ENV{ltr},.gif}|image_sepia{#666666}|extraire_attribut{src})]) bottom [(#GET{left})] no-repeat;
}
ol.formfx fieldset { ol.formfx fieldset {
margin-top: 7px; margin-top: 7px;
border: 1px solid #GET{foncee}; border: 1px solid #GET{foncee};
...@@ -215,7 +221,7 @@ ol.formfx fieldset legend { ...@@ -215,7 +221,7 @@ ol.formfx fieldset legend {
clear: #GET{left}; clear: #GET{left};
margin-#GET{left}: -20px; margin-#GET{left}: -20px;
background: url([(#REM|sinon{[(#EVAL{ _DIR_IMG_PACK})]label-fond-haut-[(#ENV{ltr})].gif}|image_sepia{#ENV{couleur_foncee,3874b0}}|extraire_attribut{src})]) bottom [(#GET{left})] no-repeat; background: url([(#EVAL{_DIR_IMG_PACK}|concat{label-fond-haut-,#ENV{ltr},.gif}|image_sepia{#ENV{couleur_foncee,3874b0}}|extraire_attribut{src})]) bottom [(#GET{left})] no-repeat;
font-size: 9px; font-size: 9px;
color: white; color: white;
...@@ -237,7 +243,7 @@ table.spip_barre { ...@@ -237,7 +243,7 @@ table.spip_barre {
table.spip_barre a img { table.spip_barre a img {
background: #GET{claire}; background: #GET{claire};
background: url([(#REM|sinon{[(#EVAL{ _DIR_IMG_PACK})]fond-fondo.gif}|image_sepia{#ENV{couleur_claire,edf3fe}}|extraire_attribut{src})]) center center; background: url([(#EVAL{_DIR_IMG_PACK}|concat{fond-fondo.gif}|image_sepia{#ENV{couleur_claire,edf3fe}}|extraire_attribut{src})]) center center;
padding: 3px; border: 1px outset #GET{claire}; } padding: 3px; border: 1px outset #GET{claire}; }
table.spip_barre a:hover img { background: #FFF; border: 1px solid #CC9; } table.spip_barre a:hover img { background: #FFF; border: 1px solid #CC9; }
table.spip_barre input.barre { width: 99%; background: transparent; border: 0; color: #F57900; } table.spip_barre input.barre { width: 99%; background: transparent; border: 0; color: #F57900; }
......
...@@ -89,8 +89,6 @@ function articles_edit($id_article, $id_rubrique, $lier_trad, $id_version, $new, ...@@ -89,8 +89,6 @@ function articles_edit($id_article, $id_rubrique, $lier_trad, $id_version, $new,
echo debut_cadre_formulaire("", true); echo debut_cadre_formulaire("", true);
echo articles_edit_presentation($new, $row['id_rubrique'], $lier_trad, $row['id_article'], $row['titre'],$config_fonc); echo articles_edit_presentation($new, $row['id_rubrique'], $lier_trad, $row['id_article'], $row['titre'],$config_fonc);
/*$editer_article = charger_fonction('editer_article', 'inc');
echo $editer_article($new, $id_rubrique, $lier_trad, generer_url_ecrire("articles"), $config_fonc, $row);*/
echo fin_cadre_formulaire(true); echo fin_cadre_formulaire(true);
echo pipeline('affiche_milieu',array('args'=>array('exec'=>'articles_edit','id_article'=>$id_article),'data'=>'')); echo pipeline('affiche_milieu',array('args'=>array('exec'=>'articles_edit','id_article'=>$id_article),'data'=>''));
......
...@@ -139,7 +139,7 @@ if ($connect_statut=="0minirezo" OR $statut=="prop" OR $new == "oui") { ...@@ -139,7 +139,7 @@ if ($connect_statut=="0minirezo" OR $statut=="prop" OR $new == "oui") {
$chercher_rubrique = charger_fonction('chercher_rubrique', 'inc'); $chercher_rubrique = charger_fonction('chercher_rubrique', 'inc');
$form = "<ol class='formfx'>"; $form = "<ol class='formfx'>";
$form .= "<li class='gauche gauche_obligatoire'><label for='titre'>" . _T('info_titre') . "</label>" $form .= "<li class='gauche obligatoire'><label for='titre'>" . _T('info_titre') . "</label>"
. "<input type='text' class='formo' name='titre' id='titre' value=\"$titre\" size='40' $onfocus /></li>" . "<input type='text' class='formo' name='titre' id='titre' value=\"$titre\" size='40' $onfocus /></li>"
. "<input type='hidden' name='id_rubrique_old' value=\"$id_rubrique\" />" . "<input type='hidden' name='id_rubrique_old' value=\"$id_rubrique\" />"
."<li class='haut'>" ."<li class='haut'>"
......
...@@ -183,7 +183,7 @@ function exec_mots_edit_args($id_mot, $id_groupe, $new, $table='', $table_id='', ...@@ -183,7 +183,7 @@ function exec_mots_edit_args($id_mot, $id_groupe, $new, $table='', $table_id='',
$res .= "<ol class='formfx'>"; $res .= "<ol class='formfx'>";
$res .= "<li class='gauche gauche_obligatoire'>"; $res .= "<li class='gauche obligatoire'>";
$res .= "<label for='titre'>"._T('info_titre_mot_cle'); $res .= "<label for='titre'>"._T('info_titre_mot_cle');
$res .= aide ("mots")."</label>"; $res .= aide ("mots")."</label>";
......
...@@ -113,7 +113,7 @@ function exec_rubriques_edit_args($id_rubrique, $id_parent, $new) ...@@ -113,7 +113,7 @@ function exec_rubriques_edit_args($id_rubrique, $id_parent, $new)
$form = "<ol class='formfx'>"; $form = "<ol class='formfx'>";
$form .= "<li class='gauche gauche_obligatoire'><label for='titre'>" . _T('info_titre') ."</label>" $form .= "<li class='gauche obligatoire'><label for='titre'>" . _T('info_titre') ."</label>"
. "<input type='text' class='formo' name='titre' id='titre' value=\"$titre\" size='40' $onfocus /></li>"; . "<input type='text' class='formo' name='titre' id='titre' value=\"$titre\" size='40' $onfocus /></li>";
$form .= "<li>" $form .= "<li>"
......
<?php
/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
* Copyright (c) 2001-2008 *
* 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/actions');
include_spip('inc/editer');
// http://doc.spip.org/@inc_editer_article_dist
function inc_editer_article_dist($new, $id_rubrique=0, $lier_trad=0, $retour='', $config_fonc='articles_edit_config', $row=array(), $hidden='')
{
// Appel en tant que filtre d'un squelette
if (!$row) {
include_spip('inc/presentation');
include_spip('inc/article_select');
$row = article_select($new, $id_rubrique, $lier_trad);
if (!$row) return '';
if (is_numeric($new)) $new = '';
}
// Gaffe: sans ceci, on ecrase systematiquement l'article d'origine
// (et donc: pas de lien de traduction)
$id_article = ($new OR $lier_trad) ? 'oui' : $row['id_article'];
$contexte = $row;
$contexte['config'] = $config = $config_fonc($row);
$form = "<input type='hidden' name='editer_article' value='oui' />\n" .
(!$lier_trad ? '' :
("\n<input type='hidden' name='lier_trad' value='" .
$lier_trad .
"' />" .
"\n<input type='hidden' name='changer_lang' value='" .
$config['langue'] .
"' />"));
// on veut conserver la langue de l'interface ;
// on passe cette donnee sous un autre nom, au cas ou le squelette
// voudrait l'exploiter
if (isset($contexte['lang'])) {
$contexte['langue'] = $contexte['lang'];
unset($contexte['lang']);
}
$contexte['browser_caret']=$GLOBALS['browser_caret'];
include_spip('public/assembler');
$form .= recuperer_fond("prive/editer/article", $contexte);
// Ajouter le controles md5
if (intval($id_article)) {
include_spip('inc/editer');
$form .= controles_md5($row);
}
$form .= $hidden
. ("<div style='text-align: right'><input class='fondo' type='submit' value='"
. _T('bouton_enregistrer')
. "' /></div>");
$form = pipeline(
'editer_contenu_objet',
array(
'data'=>$form,
'args'=>array('type'=>'article','id'=>$id_article,'contexte'=>$contexte)
)
);
return generer_action_auteur("editer_article", $id_article, $retour, $form, " method='post'");
}
/*
// code mort
// http://doc.spip.org/@editer_article_texte
function editer_article_texte($texte, $config, $aider, $lang='')
{
// cette meta n'est pas activable par l'interface, mais elle peut venir
// d'ailleurs : http://www.spip-contrib.net/Personnaliser-les-champs-de-l
if (($config['articles_texte'] == 'non') AND !strlen($texte))
return '';
$att_text = " class='formo' "
. $GLOBALS['browser_caret']
. " rows='"
. ($config['lignes'] +15)
. "' cols='40'";
if ($config['afficher_barre']) {
include_spip('inc/barre');
$afficher_barre = '<div>'
. afficher_barre("document.getElementById('text_area')",false,$lang)
. '</div>';
} else $afficher_barre = '';
$texte = entites_html($texte);
// texte > 32 ko -> decouper en morceaux
if (strlen($texte)>29*1024) {
list($texte, $sup) = editer_article_recolle($texte, $att_text);
} else $sup='';
return "\n<p><label for='text_area'><b>" ._T('info_texte') ."</b></label>"
. $aider ("arttexte") . "<br />\n"
. _T('texte_enrichir_mise_a_jour')
. $aider("raccourcis")
. "</p>"
. $sup
. "<br />"
. $afficher_barre
. "<textarea id='text_area' name='texte'$att_text>"
. $texte
. "</textarea>\n"
. (test_espace_prive()
? "<script type='text/javascript'><!--
jQuery(function(){
jQuery('#text_area')
.css('height',(jQuery(window).height()-80)+'px');
});\n//--></script>\n"
: ''
);
}
*/
//
// Gestion des textes trop longs (limitation brouteurs)
// utile pour les textes > 32ko
// http://doc.spip.org/@coupe_trop_long
function coupe_trop_long($texte){
$aider = charger_fonction('aider', 'inc');
if (strlen($texte) > 28*1024) {
$texte = str_replace("\r\n","\n",$texte);
$pos = strpos($texte, "\n\n", 28*1024); // coupe para > 28 ko
if ($pos > 0 and $pos < 32 * 1024) {
$debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n";
$suite = substr($texte, $pos + 2);
} else {
$pos = strpos($texte, " ", 28*1024); // sinon coupe espace
if (!($pos > 0 and $pos < 32 * 1024)) {
$pos = 28*1024; // au pire (pas d'espace trouv'e)
$decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere
} else {
$decalage = 1;
}
$debut = substr($texte,0,$pos + $decalage); // Il faut conserver l'espace s'il y en a un
$suite = substr($texte,$pos + $decalage);
}
return (array($debut,$suite));
}
else
return (array($texte,''));
}
// http://doc.spip.org/@editer_article_recolle
function editer_article_recolle($texte, $att_text)
{
$textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n";
$nombre = 0;
while (strlen($texte)>29*1024) {
$nombre ++;
list($texte1,$texte) = coupe_trop_long($texte);
$id = "document.getElementById('texte$nombre')";
$textes_supplement .= "<br />" . afficher_barre($id) .
"<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n";
}
return array($texte,$textes_supplement);
}
// Choix par defaut des options de presentation
// http://doc.spip.org/@articles_edit_config
function articles_edit_config($row)
{
global $champs_extra, $spip_ecran, $spip_lang, $spip_display;
$config = $GLOBALS['meta'];
$config['lignes'] = ($spip_ecran == "large")? 8 : 5;
$config['afficher_barre'] = $spip_display != 4;
$config['langue'] = $spip_lang;
if ($champs_extra) {
include_spip('inc/extra');
$config['extra'] = true;
} else $config['extra'] = false;
$config['restreint'] = ($row['statut'] == 'publie');
return $config;
}
?>
...@@ -58,7 +58,7 @@ function redirige_par_entete($url, $equiv='') { ...@@ -58,7 +58,7 @@ function redirige_par_entete($url, $equiv='') {
// http://doc.spip.org/@redirige_formulaire // http://doc.spip.org/@redirige_formulaire
function redirige_formulaire($url, $equiv = '') { function redirige_formulaire($url, $equiv = '') {
if (!_request('var_ajax') && !_request('var_ajaxcharset')) if (!_request('var_ajax') && !_request('var_ajaxcharset'))
redirige_par_entete($url, $equiv); redirige_par_entete(str_replace('&amp;','&',$url), $equiv);
else { else {
$url = strtr($url, "\n\r", " "); $url = strtr($url, "\n\r", " ");
# en theorie on devrait faire ca tout le temps, mais quand la chaine # en theorie on devrait faire ca tout le temps, mais quand la chaine
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter