Skip to content
Extraits de code Groupes Projets
Valider 31447219 rédigé par esj's avatar esj
Parcourir les fichiers

Evacuation de balises font

{{{
for i in $(grep -l  "<font color=.[^>]*>.*</font" [ei]*/*p)
	do 
	sed  "s,<font color=\(.\)\([^>]*\)>\(.*\)</font,<span style=\1color: \2>\3</span," $i > x
	 mv x $i
done
}}}
parent c9c93090
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -339,6 +339,8 @@ ecrire/action/instituer_forum.php -text ...@@ -339,6 +339,8 @@ ecrire/action/instituer_forum.php -text
ecrire/action/instituer_groupe_mots.php -text ecrire/action/instituer_groupe_mots.php -text
ecrire/action/instituer_langue_rubrique.php -text ecrire/action/instituer_langue_rubrique.php -text
ecrire/action/instituer_mot.php -text ecrire/action/instituer_mot.php -text
ecrire/action/instituer_rubrique_articles.php -text
ecrire/action/instituer_rubrique_breves.php -text
ecrire/action/instituer_syndic.php -text ecrire/action/instituer_syndic.php -text
ecrire/action/joindre.php -text ecrire/action/joindre.php -text
ecrire/action/legender.php -text ecrire/action/legender.php -text
...@@ -423,6 +425,7 @@ ecrire/exec/instituer_auteur.php -text ...@@ -423,6 +425,7 @@ ecrire/exec/instituer_auteur.php -text
ecrire/exec/lang_raccourcis.php -text ecrire/exec/lang_raccourcis.php -text
ecrire/exec/legender.php -text ecrire/exec/legender.php -text
ecrire/exec/legender_auteur.php -text ecrire/exec/legender_auteur.php -text
ecrire/exec/meme_rubrique.php -text
ecrire/exec/memoriser.php -text ecrire/exec/memoriser.php -text
ecrire/exec/message.php -text ecrire/exec/message.php -text
ecrire/exec/message_edit.php -text ecrire/exec/message_edit.php -text
......
...@@ -38,19 +38,34 @@ function selec_statut(id, type, decal, puce, script) { ...@@ -38,19 +38,34 @@ function selec_statut(id, type, decal, puce, script) {
if (!accepter_change_statut) if (!accepter_change_statut)
accepter_change_statut = confirm(confirm_changer_statut); accepter_change_statut = confirm(confirm_changer_statut);
if (accepter_change_statut) { if (!accepter_change_statut) return;
changestyle ('statutdecal'+type+id, 'marginLeft', decal+'px');
cacher ('statutdecal'+type+id); changestyle ('statutdecal'+type+id, 'marginLeft', decal+'px');
cacher ('statutdecal'+type+id);
$.get(script,
function (c) {
node = findObj('imgstatut'+type+id);
if (!((type == 'article') || (type == 'breve'))) {
node.innerHTML = c;
} else {
$.get(script,
function (c) {
if (!c) if (!c)
findObj('imgstatut'+type+id).src = puce; node.src = puce;
else else
alert(c); // eventuel message d'erreur (TODO) alert(c); // eventuel message d'erreur (TODO)
} }
); }
} );
}
function prepare_selec_statut(nom, type, id, action)
{
$('#' + nom + type + id).load(action + '&type='+type+'&id='+id,
function(){
findObj_forcer('statutdecal'+type+id).style.visibility = 'visible';
});
} }
function changeclass(objet, myClass) { function changeclass(objet, myClass) {
...@@ -73,7 +88,6 @@ function cacher(objet) { ...@@ -73,7 +88,6 @@ function cacher(objet) {
} }
function getHeight(obj) { function getHeight(obj) {
if (obj == "window") { if (obj == "window") {
return hauteur_fenetre(); return hauteur_fenetre();
......
...@@ -1159,43 +1159,37 @@ a.liste-mot { ...@@ -1159,43 +1159,37 @@ a.liste-mot {
overflow: hidden; overflow: hidden;
} }
.tr_liste:hover td div.liste_clip { .tr_liste:hover td div.liste_clip, span.liste_clip {
overflow: visible; overflow: visible;
height: 100%; height: 100%;
} }
div.puce_article { div.puce_article, span.puce_articlen div.puce_breve, span.puce_breve {
position: relative; position: relative;
height: 11px;
width: 11px;
} }
div.puce_article_fixe, div.puce_breve_fixe, span.puce_article_fixe, span.puce_breve_fixe {
div.puce_breve { position: relative;
position: relative;
height: 9px;
width: 9px;
}
div.puce_article_fixe, div.puce_breve_fixe {
position: absolute;
} }
div.puce_article_popup, div.puce_breve_popup { div.puce_article_popup, div.puce_breve_popup, span.puce_article_popup, span.puce_breve_popup {
position: absolute; position: absolute;
top: 0;
visibility: hidden; visibility: hidden;
margin-top: -1px; top: 0;
border: 1px solid #666; border: 1px solid #666;
background-color: #ccc; z-index: 10; background-color: #ccc; z-index: 10;
-moz-border-radius: 3px; -moz-border-radius: 3px;
} }
div.puce_article_popup img, div.puce_breve_popup img {
div.puce_article_popup img, div.puce_breve_popup img, span.puce_article_popup img, span.puce_breve_popup img {
padding: 1px; padding: 1px;
border: none; border: none;
} }
div.puce_article_popup { div.puce_article_popup, span.puce_article_popup {
width: 55px; width: 55px;
} }
div.puce_breve_popup {
div.puce_breve_popup, span.puce_breve_popup {
width: 27px; width: 27px;
} }
......
...@@ -150,10 +150,11 @@ function revisions_articles ($id_article, $c=false) { ...@@ -150,10 +150,11 @@ function revisions_articles ($id_article, $c=false) {
// statut et rubrique sont lies, car un admin restreint peut deplacer // statut et rubrique sont lies, car un admin restreint peut deplacer
// un article publie vers une rubrique qu'il n'administre pas // un article publie vers une rubrique qu'il n'administre pas
// http://doc.spip.org/@instituer_article // http://doc.spip.org/@instituer_article
function instituer_article($id_article, $c) { function instituer_article($id_article, $c, $calcul_rub=true) {
include_spip('inc/autoriser'); include_spip('inc/autoriser');
include_spip('inc/rubriques'); include_spip('inc/rubriques');
include_spip('inc/modifier');
$s = spip_query("SELECT statut, id_rubrique FROM spip_articles WHERE id_article=$id_article"); $s = spip_query("SELECT statut, id_rubrique FROM spip_articles WHERE id_article=$id_article");
$row = spip_fetch_array($s); $row = spip_fetch_array($s);
...@@ -223,7 +224,6 @@ function instituer_article($id_article, $c) { ...@@ -223,7 +224,6 @@ function instituer_article($id_article, $c) {
spip_query("UPDATE spip_articles SET ".join(', ',$update)." WHERE id_article=$id_article"); spip_query("UPDATE spip_articles SET ".join(', ',$update)." WHERE id_article=$id_article");
// Si on a deplace l'article // Si on a deplace l'article
// - propager les secteurs // - propager les secteurs
// - changer sa langue (si heritee) // - changer sa langue (si heritee)
...@@ -248,8 +248,8 @@ function instituer_article($id_article, $c) { ...@@ -248,8 +248,8 @@ function instituer_article($id_article, $c) {
// Recalculer les rubriques (statuts et dates) si l'on deplace // Recalculer les rubriques (statuts et dates) si l'on deplace
// un article publie, ou si on le depublie // un article publie, ou si on le depublie
if (($statut == 'publie' AND isset($champ['id_rubrique'])) if (($statut == 'publie' AND isset($champs['id_rubrique']))
OR ($statut_ancien=='publie' AND $champ['statut'])) OR ($statut_ancien=='publie' AND $champs['statut'] AND $calcul_rub))
calculer_rubriques(); calculer_rubriques();
// Pipeline // Pipeline
......
<?php
/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
* Copyright (c) 2001-2007 *
* 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/@action_instituer_article_dist
function action_instituer_rubrique_articles_dist() {
$securiser_action = charger_fonction('securiser_action', 'inc');
$arg = $securiser_action();
list($id, $statut) = preg_split('/\W/', $arg);
$id = intval($id);
$statut =array('statut' => $statut);
include_spip('action/editer_article');
$table = 'articles';
$key = 'id_article';
$voss = spip_query("SELECT $key AS id FROM spip_$table WHERE id_rubrique=$id AND (statut = 'publie' OR statut = 'prop' OR statut = 'prepa')");
while($row = spip_fetch_array($voss)) {
instituer_article($row['id'], $statut, false);
}
include_spip('inc/rubriques');
calculer_rubriques();
redirige_par_entete(generer_url_ecrire('meme_rubrique', "id=$id&type=article&date=date", true));
}
?>
<?php
/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
* Copyright (c) 2001-2007 *
* 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/@action_instituer_article_dist
function action_instituer_rubrique_breves_dist() {
$securiser_action = charger_fonction('securiser_action', 'inc');
$arg = $securiser_action();
list($id, $statut) = preg_split('/\W/', $arg);
$id = intval($id);
include_spip('action/editer_breve');
$table = 'articles';
$key = 'id_article';
$voss = spip_query("SELECT $key AS id FROM spip_$table WHERE id_rubrique=$id AND (statut = 'publie' OR statut = 'prop')");
while($row = spip_fetch_array($voss)) {
set_request('statut', $statut);
revisions_breves($row['id']);
}
redirige_par_entete(generer_url_ecrire('meme_rubrique', "id=$id&type=breve&date=date_heure", true));
}
?>
<?php
/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
* Copyright (c) 2001-2007 *
* 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_puce_statut_article_dist
function exec_meme_rubrique_dist()
{
$id = intval(_request('id'));
$type = _request('type');
$date = _request('date');
if (($GLOBALS['auteur_session']['statut'] != '0minirezo')
OR (!acces_rubrique($id))
OR (!preg_match('/^[\w_-]+$/',$date))
OR (!preg_match('/^[\w_-]+$/',$type))) {
include_spip('inc/minipres');
echo minipres();
exit;
}
// on connait pas le vrai 2e arg mais c'est pas dramatique
$res = meme_rubrique($id, 0, $type, $date, 30, true);
ajax_retour($res);
}
?>
\ No newline at end of file
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
\***************************************************************************/ \***************************************************************************/
if (!defined("_ECRIRE_INC_VERSION")) return; if (!defined("_ECRIRE_INC_VERSION")) return;
include_spip('inc/presentation'); include_spip('inc/presentation');
...@@ -19,12 +18,19 @@ include_spip('inc/autoriser'); ...@@ -19,12 +18,19 @@ include_spip('inc/autoriser');
// http://doc.spip.org/@exec_puce_statut_article_dist // http://doc.spip.org/@exec_puce_statut_article_dist
function exec_puce_statut_article_dist() function exec_puce_statut_article_dist()
{ {
$id = _request('id'); $id = intval(_request('id'));
$s = spip_query( $type = _request('type');
"SELECT id_rubrique,statut FROM spip_articles WHERE id_article="._q($id));
$r = spip_fetch_array($s);
ajax_retour(puce_statut_article($id,$r['statut'],$r['id_rubrique'],true)); if ($type == 'article') {
$s = spip_query("SELECT id_rubrique,statut FROM spip_articles WHERE id_article=$id");
$r = spip_fetch_array($s);
$statut = $r['statut'];
$id_rubrique = $r['id_rubrique'];
} else {
$id_rubrique = $id;
$id = 0;
$statut = 'prop'; // arbitraire
}
ajax_retour(puce_statut_article($id,$statut,$id_rubrique,$type, true));
} }
?> ?>
\ No newline at end of file
...@@ -254,12 +254,13 @@ function fin_boite_info($return=false) { ...@@ -254,12 +254,13 @@ function fin_boite_info($return=false) {
function bandeau_titre_boite2($titre, $logo="", $fond="white", $texte="black", $af = true) { function bandeau_titre_boite2($titre, $logo="", $fond="white", $texte="black", $af = true) {
global $spip_lang_left, $spip_display, $browser_name; global $spip_lang_left, $spip_display, $browser_name;
$logo = http_img_pack($logo, "", "");
if (strlen($logo) > 0 AND $spip_display != 1 AND $spip_display != 4) { if (strlen($logo) > 0 AND $spip_display != 1 AND $spip_display != 4) {
$ie_style = ($browser_name == "MSIE") ? "height:1%" : ''; $ie_style = ($browser_name == "MSIE") ? "height:1%" : '';
$retour = "\n<div style='position: relative;$ie_style'>" $retour = "\n<div style='position: relative;$ie_style'>"
. "\n<div style='position: absolute; top: -12px; $spip_lang_left: 3px;'>" . . "\n<div style='position: absolute; top: -12px; $spip_lang_left: 3px;'>"
http_img_pack("$logo", "", "") . $logo
. "</div>" . "</div>"
. "\n<div style='background-color: $fond; color: $texte; padding: 3px; padding-$spip_lang_left: 30px; border-bottom: 1px solid #444444;' class='verdana2'>$titre</div>" . "\n<div style='background-color: $fond; color: $texte; padding: 3px; padding-$spip_lang_left: 30px; border-bottom: 1px solid #444444;' class='verdana2'>$titre</div>"
. "</div>"; . "</div>";
...@@ -497,99 +498,92 @@ function afficher_liste_fin_tableau() { ...@@ -497,99 +498,92 @@ function afficher_liste_fin_tableau() {
// http://doc.spip.org/@puce_statut_article // http://doc.spip.org/@puce_statut_article
function puce_statut_article($id, $statut, $id_rubrique, $ajax = false) { function puce_statut_article($id, $statut, $id_rubrique, $type='article', $ajax = false) {
global $spip_lang_left, $dir_lang, $connect_statut, $options; global $spip_lang_left, $dir_lang, $connect_statut, $options;
static $script=NULL;
if (!$id) {
$id = $id_rubrique;
$ajax_node ='';
} else $ajax_node = " id='imgstatut$type$id'";
switch ($statut) { switch ($statut) {
case 'publie': case 'publie':
$clip = 2; $clip = 2;
$puce = 'verte'; $puce = 'puce-verte.gif';
$title = _T('info_article_publie'); $title = _T('info_article_publie');
break; break;
case 'prepa': case 'prepa':
$clip = 0; $clip = 0;
$puce = 'blanche'; $puce = 'puce-blanche.gif';
$title = _T('info_article_redaction'); $title = _T('info_article_redaction');
break; break;
case 'prop': case 'prop':
$clip = 1; $clip = 1;
$puce = 'orange'; $puce = 'puce-orange.gif';
$title = _T('info_article_propose'); $title = _T('info_article_propose');
break; break;
case 'refuse': case 'refuse':
$clip = 3; $clip = 3;
$puce = 'rouge'; $puce = 'puce-rouge.gif';
$title = _T('info_article_refuse'); $title = _T('info_article_refuse');
break; break;
case 'poubelle': case 'poubelle':
$clip = 4; $clip = 4;
$puce = 'poubelle'; $puce = 'puce-poubelle.gif';
$title = _T('info_article_supprime'); $title = _T('info_article_supprime');
break; break;
} }
$puce = "puce-$puce.gif";
$inser_puce = http_img_pack($puce, $title, " style='margin: 1px;'$ajax_node");
include_spip('inc/autoriser'); include_spip('inc/autoriser');
if (autoriser('publierdans', 'rubrique', $id_rubrique)) { if (!autoriser('publierdans', 'rubrique', $id_rubrique))
// les versions de MSIE ne font pas toutes pareil sur alt/title return $inser_puce;
// la combinaison suivante semble ok pour tout le monde.
$titles = array( $titles = array(
"blanche" => _T('texte_statut_en_cours_redaction'), "blanche" => _T('texte_statut_en_cours_redaction'),
"orange" => _T('texte_statut_propose_evaluation'), "orange" => _T('texte_statut_propose_evaluation'),
"verte" => _T('texte_statut_publie'), "verte" => _T('texte_statut_publie'),
"rouge" => _T('texte_statut_refuse'), "rouge" => _T('texte_statut_refuse'),
"poubelle" => _T('texte_statut_poubelle')); "poubelle" => _T('texte_statut_poubelle'));
if ($ajax){ if ($ajax){
$action = "\nonmouseover=\"montrer('statutdecalarticle$id');\""; $action = "\nonmouseover=\"montrer('statutdecal$type$id');\"";
$inser_puce = return "<div class='puce_article_fixe'\n$action>"
// "\n<div class='puce_article' id='statut$id'$dir_lang>" . . $inser_puce
"<div class='puce_article_fixe'\n$action>" . . "</div>"
http_img_pack($puce, $title, "id='imgstatutarticle$id' style='margin: 1px;'") ."</div>" . "<div class='puce_article_popup' id='statutdecal$type$id'\nonmouseout=\"cacher('statutdecal$type$id');\" style='margin-left: -".((11*$clip)+1)."px;'>"
. "<div class='puce_article_popup' id='statutdecalarticle$id'\nonmouseout=\"cacher('statutdecalarticle$id');\" style=' margin-left: -".((11*$clip)+1)."px;'>" . afficher_script_statut($id, $type, -1, 'puce-blanche.gif', 'prepa', $titles['blanche'], $action)
. afficher_script_statut($id, 'article', -1, 'puce-blanche.gif', 'prepa', $titles['blanche'], $action) . afficher_script_statut($id, $type, -12, 'puce-orange.gif', 'prop', $titles['orange'], $action)
. afficher_script_statut($id, 'article', -12, 'puce-orange.gif', 'prop', $titles['orange'], $action) . afficher_script_statut($id, $type, -23, 'puce-verte.gif', 'publie', $titles['verte'], $action)
. afficher_script_statut($id, 'article', -23, 'puce-verte.gif', 'publie', $titles['verte'], $action) . afficher_script_statut($id, $type, -34, 'puce-rouge.gif', 'refuse', $titles['rouge'], $action)
. afficher_script_statut($id, 'article', -34, 'puce-rouge.gif', 'refuse', $titles['rouge'], $action) . afficher_script_statut($id, $type, -45, 'puce-poubelle.gif', 'poubelle', $titles['poubelle'], $action)
. afficher_script_statut($id, 'article', -45, 'puce-poubelle.gif', 'poubelle', $titles['poubelle'], $action) . "</div>";
. "</div>"
//. "</div>"
;
}
else{
$inser_puce = "<div class='puce_article' id='statut$id'$dir_lang>".
http_img_pack($puce, $title, "id='imgstatutarticle$id' style='margin: 1px;'") ."</div>";
if ($script==NULL && _SPIP_AJAX){
$action = "'".generer_url_ecrire('puce_statut_article',"id='+id",true);
$script = "<script type='text/javascript'>//<!--\n";
$script .= "$(document).ready(function(){
$('div.puce_article').mouseover( function() {
if(this.puce_loaded) return;
this.puce_loaded = true;
id = $(this).id();
id = id.substr(6,id.length-1);
$('#statut'+id).load($action,function(){
$('#statutdecalarticle'+id).show();
/*$('#statut'+id).mouseover(function(){ $(this).children('.puce_article_popup').show(); });*/
});
});
})";
$script .= "//--></script>";
$inser_puce = $script . $inser_puce;
}
}
} else {
$inser_puce = http_img_pack($puce, $title, "id='imgstatutarticle$id' style='margin: 1px;'");
} }
return $inser_puce; $nom = "puce_statut_";
if ((! _SPIP_AJAX) AND $type != 'article')
$over ='';
else {
$action = generer_url_ecrire('puce_statut_article',"",true);
$action = "if (!this.puce_loaded) { this.puce_loaded = true; prepare_selec_statut('$nom', '$type', $id, '$action'); } }";
$over = "\nonmouseover=\"$action\"";
}
return "<div class='puce_article' id='$nom$type$id'$dir_lang$over>"
. $inser_puce
. '</div>';
} }
// http://doc.spip.org/@puce_statut_breve // http://doc.spip.org/@puce_statut_breve
function puce_statut_breve($id, $statut, $type, $droit) { function puce_statut_breve($id, $statut, $type, $droit='AUTO') {
global $spip_lang_left, $dir_lang; global $spip_lang_left, $dir_lang;
if ($droit == 'AUTO') {
include_spip('inc/autoriser');
$droit = autoriser('publierdans', 'rubrique', $id_rubrique);
}
$puces = array( $puces = array(
0 => 'puce-orange-breve.gif', 0 => 'puce-orange-breve.gif',
1 => 'puce-verte-breve.gif', 1 => 'puce-verte-breve.gif',
...@@ -626,9 +620,6 @@ function puce_statut_breve($id, $statut, $type, $droit) { ...@@ -626,9 +620,6 @@ function puce_statut_breve($id, $statut, $type, $droit) {
$type2 = "statutdecal$type$id"; $type2 = "statutdecal$type$id";
$action = "\nonmouseover=\"montrer('$type2');\""; $action = "\nonmouseover=\"montrer('$type2');\"";
// les versions de MSIE ne font pas toutes pareil sur alt/title
// la combinaison suivante semble ok pour tout le monde.
return "<div class='puce_breve' id='$type1'$dir_lang>" return "<div class='puce_breve' id='$type1'$dir_lang>"
. "<div class='puce_breve_fixe' $action>" . "<div class='puce_breve_fixe' $action>"
. $inser_puce . $inser_puce
...@@ -747,9 +738,11 @@ function afficher_articles_trad($titre_table, $requete, $formater, $tmp_var, $ha ...@@ -747,9 +738,11 @@ function afficher_articles_trad($titre_table, $requete, $formater, $tmp_var, $ha
} }
$texte .= '<b>' . $titre_table . '</b>'; $texte .= '<b>' . $titre_table . '</b>';
$icone = http_img_pack("article-24.gif",'','');
$res = "\n<div style='height: 12px;'></div>" $res = "\n<div style='height: 12px;'></div>"
. "\n<div class='liste'>" . "\n<div class='liste'>"
. bandeau_titre_boite2($texte, "article-24.gif", 'white', 'black',false) . bandeau_titre_boite2($texte, $icone, 'white', 'black',false)
. (($cpt <= $nb_aff) ? '' . (($cpt <= $nb_aff) ? ''
: afficher_tranches_requete($cpt, $tmp_var, generer_url_ecrire('memoriser', "hash=$hash&trad=$trad"), $nb_aff)) : afficher_tranches_requete($cpt, $tmp_var, generer_url_ecrire('memoriser', "hash=$hash&trad=$trad"), $nb_aff))
...@@ -913,7 +906,7 @@ function afficher_breves_boucle($row, &$tous_id, $voir_logo, $own) ...@@ -913,7 +906,7 @@ function afficher_breves_boucle($row, &$tous_id, $voir_logo, $own)
else $lang = $langue_defaut; else $lang = $langue_defaut;
$id_rubrique = $row['id_rubrique']; $id_rubrique = $row['id_rubrique'];
$vals[] = puce_statut_breve($id_breve, $statut, 'breve', ($droit && acces_rubrique($id_rubrique)), $id_rubrique); $vals[] = puce_statut_breve($id_breve, $statut, 'breve', ($droit && acces_rubrique($id_rubrique)));
$s = "\n<div>"; $s = "\n<div>";
$s .= "<a href='" . generer_url_ecrire("breves_voir","id_breve=$id_breve") . "' style=\"display:block;\">"; $s .= "<a href='" . generer_url_ecrire("breves_voir","id_breve=$id_breve") . "' style=\"display:block;\">";
...@@ -1786,7 +1779,7 @@ function debloquer_article($arg, $texte) { ...@@ -1786,7 +1779,7 @@ function debloquer_article($arg, $texte) {
} }
// http://doc.spip.org/@meme_rubrique // http://doc.spip.org/@meme_rubrique
function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30) function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30, $ajax=false)
{ {
global $options; global $options;
...@@ -1794,18 +1787,30 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30) ...@@ -1794,18 +1787,30 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30)
$table = $type . 's'; $table = $type . 's';
$key = 'id_' . $type; $key = 'id_' . $type;
$where = ($GLOBALS['auteur_session']['statut'] == '0minirezo')
? ''
: " AND (statut = 'publie' OR statut = 'prop')";
$query = "SELECT $key AS id, titre, statut FROM spip_$table WHERE id_rubrique=$id_rubrique$where AND ($key != $id)";
$voss = spip_query("SELECT $key AS id, titre, statut FROM spip_$table WHERE id_rubrique=$id_rubrique AND (statut = 'publie' OR statut = 'prop') AND ($key != $id) ORDER BY $order DESC LIMIT $limit"); $n = spip_num_rows(spip_query($query));
if (!spip_num_rows($voss)) return ''; if (!$n) return '';
$voss = spip_query($query . " ORDER BY $order DESC LIMIT $limit");
$limit -= $n;
$retour = ''; $retour = '';
$statuts = array();
$fstatut = 'puce_statut_' . $type;
while($row = spip_fetch_array($voss)) { while($row = spip_fetch_array($voss)) {
$id = $row['id']; $id = $row['id'];
$num = afficher_numero_edit($id, $key, $type); $num = afficher_numero_edit($id, $key, $type);
$statut = puce_statut_article($id, $row['statut'], $id_rubrique); $statut = $row['statut'];
$href = "<a href='" $statuts[$statut]++;
$statut = $fstatut($id, $statut, $id_rubrique);
$href = "<a class='verdana1' href='"
. generer_url_ecrire($table,"$key=$id") . generer_url_ecrire($table,"$key=$id")
. "'>" . "'>"
. typo($row['titre']) . typo($row['titre'])
...@@ -1813,12 +1818,21 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30) ...@@ -1813,12 +1818,21 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30)
$retour .= "<tr class='tr_liste' style='background-color: #e0e0e0;'><td>$statut</td><td>$href</td><td style='width: 25%;'>$num</td></tr>"; $retour .= "<tr class='tr_liste' style='background-color: #e0e0e0;'><td>$statut</td><td>$href</td><td style='width: 25%;'>$num</td></tr>";
} }
return "\n<div>&nbsp;</div>" $type = 'rubrique_' . $table;
. "\n<div class='bandeau_rubriques' style='z-index: 1;'>" $statut = array_search(max($statuts), $statuts);
. bandeau_titre_boite2('<b>' . _T('info_meme_rubrique') . '</b>', "article-24.gif",'','',false) $icone = puce_statut_article(0, $statut, $id_rubrique, $type);
$retour = bandeau_titre_boite2('<b>' . _T('info_meme_rubrique') . '</b>' . $icone, 'article-24.gif','','',false)
. "\n<table style='font-size: 11px; background-color: #e0e0e0;border: 0px; padding-left:4px;'>" . "\n<table style='font-size: 11px; background-color: #e0e0e0;border: 0px; padding-left:4px;'>"
. $retour . $retour
. "</table></div>"; . (($limit > 0) ? '' : "<tr><td colspan='3' style='text-align: center'>+ $limit</td></tr>")
. "</table>";
if ($ajax) return $retour;
// id utilise dans puce_statut_article
return "\n<div>&nbsp;</div>"
. "\n<div id='imgstatut$type$id_rubrique' class='bandeau_rubriques' style='z-index: 1;'>$retour</div>";
} }
// http://doc.spip.org/@afficher_numero_edit // http://doc.spip.org/@afficher_numero_edit
......
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