Browse Source

_plugins_/_core_ vers _core_/plugins

spip-3.0 v1.0
ben.spip@gmail.com 14 years ago
commit
99f5a8d96e
  1. 18
      .gitattributes
  2. 29
      action/instituer_syndic_article.php
  3. BIN
      images/actions-24.png
  4. BIN
      images/actions-filigrane-24.png
  5. BIN
      images/annuler-recherche.png
  6. BIN
      images/syndic-bg-item.png
  7. BIN
      images/syndic-statut-dispo-24.png
  8. BIN
      images/syndic-statut-off-24.png
  9. BIN
      images/syndic-statut-publie-24.png
  10. 34
      lang/syndic_fr.php
  11. 19
      plugin.xml
  12. 2
      prive/exec/controler_syndication.html
  13. 38
      prive/listes/controler_syndication.html
  14. 19
      prive/listes/inc-boutons-filtres-statut-syndic.html
  15. 13
      prive/modeles/syndic-actions-moderer.html
  16. 20
      prive/modeles/syndic_article.html
  17. 71
      prive/style_prive_plugin_syndic.html
  18. 29
      syndic_autoriser.php

18
.gitattributes vendored

@ -0,0 +1,18 @@
* text=auto !eol
action/instituer_syndic_article.php -text
images/actions-24.png -text
images/actions-filigrane-24.png -text
images/annuler-recherche.png -text
images/syndic-bg-item.png -text
images/syndic-statut-dispo-24.png -text
images/syndic-statut-off-24.png -text
images/syndic-statut-publie-24.png -text
lang/syndic_fr.php -text
/plugin.xml -text
prive/exec/controler_syndication.html -text
prive/listes/controler_syndication.html -text
prive/listes/inc-boutons-filtres-statut-syndic.html -text
prive/modeles/syndic-actions-moderer.html -text
prive/modeles/syndic_article.html -text
prive/style_prive_plugin_syndic.html -text
/syndic_autoriser.php -text

29
action/instituer_syndic_article.php

@ -0,0 +1,29 @@
<?php
/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
* Copyright (c) 2001-2009 *
* 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_syndic_article_dist
function action_instituer_syndic_article_dist() {
$securiser_action = charger_fonction('securiser_action', 'inc');
$arg = $securiser_action();
list($id_syndic_article, $statut) = preg_split('/\W/', $arg);
$id_syndic_article = intval($id_syndic_article);
$row = sql_fetsel("*", "spip_syndic_articles", "id_syndic_article=$id_syndic_article");
if (!$row) return;
sql_updateq("spip_syndic_articles", array("statut" => $statut), "id_syndic_article=".intval($id_syndic_article));
}
?>

BIN
images/actions-24.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/actions-filigrane-24.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
images/annuler-recherche.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

BIN
images/syndic-bg-item.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/syndic-statut-dispo-24.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
images/syndic-statut-off-24.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
images/syndic-statut-publie-24.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

34
lang/syndic_fr.php

@ -0,0 +1,34 @@
<?php
// This is a SPIP language file -- Ceci est un fichier langue de SPIP
$GLOBALS[$GLOBALS['idx_lang']] = array(
'icone_controler_syndication'=>'Publication des articles syndiqu&eacute;s',
'aucun_article_syndic' => 'Aucun article syndiqu&eacute;',
'un_article_syndic' => '1 article syndiqu&eacute;',
'nombre_articles_syndic' => '@nb@ articles syndiqu&eacute;s',
'icone_valider_article' => 'Valider cet article',
'icone_supprimer_article' => 'Supprimer cet article',
'icone_valider_articles' => 'Valider ces articles',
'icone_supprimer_articles' => 'Supprimer ces articles',
'articles_meme_auteur' => 'Tous les articles de cet auteur',
// statuts
'articles_tous' => 'Tous',
'articles_publie' => 'Publi&eacute;s',
'articles_prop' => 'En attente',
'articles_off' => 'Supprim&eacute;s',
'statut_prop' => 'En attente',
'statut_publie' => 'Publi&eacute;',
'statut_off' => 'Supprim&eacute;',
'tout_voir' => 'Voir tous les articles syndiqu&eacute;s',
);
?>

19
plugin.xml

@ -0,0 +1,19 @@
<plugin>
<nom>Sites</nom>
<auteur>Collectif SPIP</auteur>
<version>1.0</version>
<version_base>1.0</version_base>
<etat>test</etat>
<description>Sites et syndication dans SPIP (priv&eacute; et public)</description>
<prefix>syndic</prefix>
<pipeline>
<nom>autoriser</nom>
<inclure>syndic_autoriser.php</inclure>
</pipeline>
<bouton id='controler_syndication' parent='bando_publication' position="-1">
<icone>images/v1/site-16.png</icone>
<titre>syndic:icone_controler_syndication</titre>
</bouton>
</plugin>

2
prive/exec/controler_syndication.html

@ -0,0 +1,2 @@
<h1 class="grostitre"><:syndic:icone_controler_syndication:></h1>
[(#INCLURE{fond=prive/listes/controler_syndication}{env}{ajax})]

38
prive/listes/controler_syndication.html

@ -0,0 +1,38 @@
#SET{self,#SELF|parametre_url{id_syndic_article|lesauteurs|debut_id_syndic_article,''}}
<BOUCLE_repart(SITES){id_syndic}><a class='annule_filtre' href='[(#GET{self}|parametre_url{id_article,''})]' title="<:syndic:tout_voir|attribut_html:>">[(#CHEMIN{images/annuler-recherche.png}|balise_img|inserer_attribut{alt,<:syndic:tout_voir:>})]</a>
<:texte_messages_publics:><h1><a href='[(#URL_SITE|ancre_url{syndic#ID_SYNDIC_ARTICLE})]'>#NOM_SITE</a></h1>
</BOUCLE_repart>
[<h1><:resultats_recherche:> &#171;&nbsp;(#ENV{recherche})&nbsp;&#187;</h1>]
#FORMULAIRE_RECHERCHE_ECRIRE{#GET{self}}
#SET{self,#SELF|parametre_url{id_syndic_article|lesauteurs|debut_id_syndic_article|statut,''}}
<B_syndic>
[(#REM) Les boutons pour tout le lot de message d'un emetteur ---------------------------------------------------------]
[(#ENV{lesauteurs}|ou{#ENV{id_syndic}})
<a class='annule_filtre ajax' href='#GET{self}' title="<:syndic:tout_voir|attribut_html:>">[(#CHEMIN{images/annuler-recherche.png}|balise_img|inserer_attribut{alt,<:syndic:tout_voir:>})]</a>
]
[
<div class='source'>
<div class='par'><:par:> (#ENV{lesauteurs})</div>
</div>
]
[(#INCLURE{fond=prive/listes/inc-boutons-filtres-statut-syndic}{env})]
<h2>[(#GRAND_TOTAL|singulier_ou_pluriel{syndic:un_article_syndic,syndic:nombre_articles_syndic}|sinon{<:syndic:aucun_article_syndic:>})]</h2>
[<p class='pagination'>(#PAGINATION)</p>]
<ul class='liste_items syndic_articles'>
<BOUCLE_syndic(SYNDIC_ARTICLES){id_syndic_article?}{id_rubrique ?}{id_syndic ?}{!par id_syndic_article}{pagination 10}{statut?}{lesauteurs?}{recherche?}>
<li class="item syndic statut_#STATUT[ (#COMPTEUR_BOUCLE|alterner{'','odd'})]" id='syndic#ID_SYNDIC_ARTICLE'>
[(#INCLURE{fond=prive/modeles/syndic_article}{id_syndic_article}{self})]
</li>
</BOUCLE_syndic>
</ul>
[<p class='pagination'>(#PAGINATION)</p>]
</B_syndic>
[(#INCLURE{fond=prive/listes/inc-boutons-filtres-statut-syndic}{env})]
<h2><:syndic:aucun_article_syndic:></h2>
<//B_syndic>

19
prive/listes/inc-boutons-filtres-statut-syndic.html

@ -0,0 +1,19 @@
#SET{self,#SELF|parametre_url{debut_syndic_article,''}}
<div class='filtres second'>
<ul>
<li>[(#GET{self}|parametre_url{statut,''}|lien_ou_expose{<:syndic:articles_tous:>,#ENV{statut,''}|=={''},ajax})]</li>
#SET{statut,publie}
<BOUCLE_cpt_1(SYNDIC_ARTICLES){id_syndic?}{statut=#GET{statut}}{recherche?} />
[(#TOTAL_BOUCLE|oui) <li class='#GET{statut}'>[(#GET{self}|parametre_url{statut,#GET{statut}}|lien_ou_expose{#VAL{syndic:articles_#GET{statut}}|_T|concat{' (',#TOTAL_BOUCLE,')'},#ENV{statut,''}|=={#GET{statut}},'ajax'})]</li>]<//B_cpt_1>
#SET{statut,dispo}
<BOUCLE_cpt_2(SYNDIC_ARTICLES){id_syndic?}{statut=#GET{statut}}{recherche?} />
[(#TOTAL_BOUCLE|oui) <li class='#GET{statut}'>[(#GET{self}|parametre_url{statut,#GET{statut}}|lien_ou_expose{#VAL{syndic:articles_#GET{statut}}|_T|concat{' (',#TOTAL_BOUCLE,')'},#ENV{statut,''}|=={#GET{statut}},'ajax'})]</li>]<//B_cpt_2>
#SET{statut,off}
<BOUCLE_cpt_3(SYNDIC_ARTICLES){id_syndic?}{statut=#GET{statut}}{recherche?} />
[(#TOTAL_BOUCLE|oui) <li class='#GET{statut}'>[(#GET{self}|parametre_url{statut,#GET{statut}}|lien_ou_expose{#VAL{syndic:articles_#GET{statut}}|_T|concat{' (',#TOTAL_BOUCLE,')'},#ENV{statut,''}|=={#GET{statut}},'ajax'})]</li>]<//B_cpt_3>
</ul>
<div class='nettoyeur'></div>
</div>

13
prive/modeles/syndic-actions-moderer.html

@ -0,0 +1,13 @@
#SET{action,'<p class="actions moderer"><span>'}
[(#AUTORISER{instituer,syndic_article,#ID_SYNDIC_ARTICLE})
[(#STATUT|in_any{#ARRAY{1,dispo,2,off}})
#GET{action}#SET{action,''}
[(#BOUTON_ACTION{<:syndic:icone_valider_article:>,#URL_ACTION_AUTEUR{instituer_syndic_article,#ID_SYNDIC_ARTICLE-publie,#SELF|ancre_url{syndic#ID_SYNDIC_ARTICLE}},'ajax valider'})]
<br />
]
[(#STATUT|in_any{#ARRAY{0,publie,1,dispo}})
#GET{action}#SET{action,''}
[(#BOUTON_ACTION{<:syndic:icone_supprimer_article:>,#URL_ACTION_AUTEUR{instituer_syndic_article,#ID_SYNDIC_ARTICLE-off,#SELF|ancre_url{syndic#ID_SYNDIC_ARTICLE}},'ajax supprimer'})]
]
]
[(#GET{action}|non)</span></p>]

20
prive/modeles/syndic_article.html

@ -0,0 +1,20 @@
<BOUCLE_syndic_article(SYNDIC_ARTICLES){id_syndic_article}{statut?}{tout}>
#SET{self,#SELF|parametre_url{debut_syndic_article|email_auteur|ip|id_auteur|auteur,''}}
[(#REM) Le cartouche ---------------------------------------------------------]
<div class='cartouche'>
<h3 class='titre'><span class='info_statut'>[(#CHEMIN{#VAL{images/syndic-statut-}|concat{#STATUT,-24.png}}|balise_img|inserer_attribut{alt,#VAL{syndic:statut_}|concat{#STATUT}|_T})]</span>
<a href='#syndic#ID_SYNDIC_ARTICLE' title='[<:info_numero_abbreviation|attribut_html:> (#ID_SYNDIC_ARTICLE)]'>[(#TITRE|sinon{<:info_sans_titre:>})]</a></h3>
[<div class="lien"><a href="(#URL)"><:voir_en_ligne:></a></div>]
<div class='date'>[(#DATE|date_interface)]</div>
[<div class='par'><:par:> <a class='ajax' href='[(#GET{self}|parametre_url{lesauteurs,#LESAUTEURS})]' title='<:syndic:articles_meme_auteur|attribut_html:>' >(#LESAUTEURS)</a> &mdash;</div>]
<BOUCLE_sit(SITES){id_syndic}><div class='reponse_a'><a href='[(#URL_ECRIRE{sites,id_syndic=#ID_SYNDIC})]'>#NOM_SITE</a></div></BOUCLE_sit>
</div>
[(#REM) Le corps ---------------------------------------------------------]
[<div class='texte'>(#DESCRIPTIF|lignes_longues)</div>]
[<div class='notes'>(#NOTES|lignes_longues)</div>]
[<div class='site'><a href='#URL_SOURCE'>(#SOURCE|sinon{#URL_SOURCE}|lignes_longues)</a></div>]
[(#REM) Les boutons ---------------------------------------------------------]
[(#INCLURE{fond=prive/modeles/syndic-actions-#ENV{boutons,moderer}}{id_syndic_article}{id_syndic}{statut}{self})]
</BOUCLE_syndic_article>

71
prive/style_prive_plugin_syndic.html

@ -0,0 +1,71 @@
[(#REM)
Ce squelette definit les styles de l'espace prive
Note: l'entete "Vary:" sert a repousser l'entete par
defaut "Vary: Cookie,Accept-Encoding", qui est (un peu)
genant en cas de "rotation du cookie de session" apres
un changement d'IP (effet de clignotement).
ATTENTION: il faut absolument le charset sinon Firefox croit que
c'est du text/html !
]
#CACHE{3600*100,cache-client}
#HTTP_HEADER{Content-Type: text/css; charset=iso-8859-15}
#HTTP_HEADER{Vary: Accept-Encoding}
#SET{claire,##ENV{couleur_claire,edf3fe}}
#SET{foncee,##ENV{couleur_foncee,3874b0}}
#SET{left,#ENV{ltr}|choixsiegal{left,left,right}}
#SET{right,#ENV{ltr}|choixsiegal{left,right,left}}
.filtres { margin:1em 0;clear:#GET{left};border-bottom:1px solid #GET{foncee};padding-#GET{left}:5px;}
.filtres ul {list-style:none;margin-left:1px;padding:0;}
.filtres ul li {float:left;padding:0;margin:0;margin-bottom:-1px;}
.filtres ul li.publie strong,.filtres ul li.publie a {background-image:url(#CHEMIN{images/syndic-statut-publie-24.png});padding-#GET{right}:27px;}
.filtres ul li.off strong,.filtres ul li.off a {background-image:url(#CHEMIN{images/syndic-statut-off-24.png});padding-#GET{right}:27px;}
.filtres ul li.dispo strong,.filtres ul li.dispo a {background-image:url(#CHEMIN{images/syndic-statut-prop-24.png});padding-#GET{right}:27px;}
.filtres ul li strong,.filtres ul li a {display:block;float:#GET{left};padding:4px 7px;border:1px solid #GET{foncee};margin-#GET{left}:5px;background-color:#eee;background-position:center right;background-repeat:no-repeat;}
.filtres ul li strong,.filtres ul li a:hover {background-color:#f8f7f3;}
.filtres ul li strong {border-bottom:1px solid #f8f7f3;color:#555;}
.filtres.second {font-size:0.9em;border:0;padding-#GET{left}:0;}
.filtres.second ul li strong,.filtres.second ul li a {margin-#GET{left}:0px;margin-#GET{right}:5px;margin-bottom:5px;}
.filtres.second ul li strong {border:1px solid #GET{foncee};}
.filtres.second ul li strong,.filtres.second ul li a:hover {background-color:#fff;}
.source {font-size:12px;font-weight:bold;background:#fff;padding:5px;border:1px solid #GET{foncee};}
.source .actions {font-weight:normal;}
.annule_filtre {float:#GET{right};}
/* Habillage des articles syndic en liste pour moderation
---------------------------------------------- */
ul.syndic_articles li.item { margin: 0; padding: 0 0 .8em 0; background: #F8F7F3 url(#CHEMIN{images/syndic-bg-item.png}); border: 0; border-top: 5px solid #ccc; }
ul.syndic_articles li.statut_publie { background-image: none; border-color: #B2BF6B; }
ul.syndic_articles li.statut_off,
ul.syndic_articles li.statut_off.odd { background-color: #edd3d3; border-color: #FF5F5F; }
ul.syndic_articles li.statut_dispo,
ul.syndic_articles li.statut_dispo.odd { background-color: #FFFBEF; border-color: #EFCA68; }
ul.syndic_articles li .cartouche { min-height: 30px; padding: 5px; padding-#GET{left}: 30px; border-bottom: 1px solid #eee; }
ul.syndic_articles li.statut_off .cartouche { border-color: #edd3d3; }
ul.syndic_articles li.statut_dispo .cartouche { border-color: #FFFBEF; }
ul.syndic_articles li .cartouche h3 {font-size:1.1em;margin-bottom:0.25em;}
ul.syndic_articles li .cartouche .date,ul.syndic_articles li .cartouche .par {display:inline;}
ul.syndic_articles li .cartouche .info_statut {display:block;float:#GET{left};margin-#GET{left}:-30px;position:relative;display:inline;}
ul.syndic_articles li .cartouche .reponse_a {font-weight:bold;}
ul.syndic_articles li .cartouche .reponse_a a {font-weight:normal;}
ul.syndic_articles li .cartouche .lien_admin {display:block;}
ul.syndic_articles li.item .texte p { margin: 0; padding: .8em 30px; }
ul.syndic_articles >li.item .actions.moderer {padding-top:5px;padding-bottom:5px;margin-#GET{right}:5px;background:url(#CHEMIN{images/actions-filigrane-24.png}) no-repeat bottom right;padding-#GET{right}:30px;}
ul.syndic_articles >li.item:hover .actions.moderer {/*background-image:none;*/}
ul.syndic_articles >li.item .actions.moderer > span {visibility:hidden;}
ul.syndic_articles >li.item:hover .actions.moderer > span {visibility:visible;}
ul.syndic_articles li .actions .supprimer input.submit {color:#cf4d4d;}

29
syndic_autoriser.php

@ -0,0 +1,29 @@
<?php
/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
* Copyright (c) 2001-2009 *
* 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. *
\***************************************************************************/
// Moderer le forum ?
// = modifier l'objet correspondant (si forum attache a un objet)
// = droits par defaut sinon (admin complet pour moderation complete)
// http://doc.spip.org/@autoriser_modererforum_dist
function autoriser_moderersyndic_dist($faire, $type, $id, $qui, $opt) {
return
autoriser('modifier', $type, $id, $qui, $opt);
}
function autoriser_bouton_controle_syndic_dist($faire, $type, $id, $qui, $opt){
return (sql_countsel('spip_syndic_articles'));
}
?>
Loading…
Cancel
Save