Changeset 93559 in spip-zone
- Timestamp:
- Dec 11, 2015, 4:53:43 PM (5 years ago)
- Location:
- _plugins_/spipclear
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/spipclear/formulaires/configurer_spipclear.html
r64124 r93559 8 8 <form method="post" action="#ENV{action}"><div> 9 9 #ACTION_FORMULAIRE{#ENV{action}} 10 <ul >11 <li class="editer _spipclear_sommaire">10 <ul class="editer-groupe"> 11 <li class="editer editer_spipclear_sommaire"> 12 12 <label>Sommaire</label> 13 13 <p class="explication"><:spipclear:look_sommaire:></p> … … 25 25 </div> 26 26 </li> 27 <li class="editer _spipclear_navigation">27 <li class="editer editer_spipclear_navigation"> 28 28 <label>Navigation</label> 29 29 <p class="explication"><:spipclear:look_navigation:></p> … … 33 33 </div> 34 34 </li> 35 <li class="editer _secteur">#SET{secteurs,#CONFIG{spipclear/secteurs,#ARRAY{0,-1}}}35 <li class="editer editer_secteur">#SET{secteurs,#CONFIG{spipclear/secteurs,#ARRAY{0,-1}}} 36 36 <label><:spipclear:secteurs_spipclear:></label> 37 37 [<span class='erreur'>(#ENV**{erreurs}|table_valeur{secteurs})</span>] … … 43 43 </select> 44 44 </li> 45 <li class="editer _spipclear_choix_theme">45 <li class="editer editer_spipclear_choix_theme"> 46 46 <label><:spipclear:legend_theme:></label> 47 47 <p class="explication"><:spipclear:info_choix_theme:></p> … … 55 55 </div> 56 56 </li> 57 <li class="editer _spipclear_nom_theme">57 <li class="editer editer_spipclear_nom_theme"> 58 58 <p class="explication"><:spipclear:label_nom_theme:></p> 59 59 <input type="text" name="nom_theme" id="nom_theme" class="text" value="[(#ENV{nom_theme})]" size="32" /> -
_plugins_/spipclear/lang/paquet-spipclear_fr.php
r59314 r93559 9 9 // Items: 2 10 10 11 if (!defined('_ECRIRE_INC_VERSION')) return; 11 if (!defined('_ECRIRE_INC_VERSION')) { 12 return; 13 } 12 14 13 15 $GLOBALS[$GLOBALS['idx_lang']] = array( … … 15 17 // S 16 18 'spipclear_description' => 'SpipClear est conçu pour transformer un secteur en blog ou carnet web. Pour cela, il s\'inspire de DotClear, un système de gestion de blog développé en php par Neokraft.net. Il est nécessaire de créer, a minima, les pages sommaire, article-x et rubrique-x pour activer le blog sur le secteur choisi.', 19 'spipclear_nom' => 'SpipClear', 17 20 'spipclear_slogan' => 'Un site à la dotclear en Spip', 18 21 ); 19 ?> -
_plugins_/spipclear/paquet.xml
r84614 r93559 7 7 compatibilite="[2.0.6;3.0.*]" 8 8 documentation="http://contrib.spip.net/SpipClear-2-1" 9 > 9 > 10 10 11 11 <nom>SpipClear</nom> -
_plugins_/spipclear/prive/exec/configurer_spipclear.html
r64136 r93559 1 1 [(#AUTORISER{webmestre}|sinon_interdire_acces)] 2 2 <h1 class="grostitre"><:spipclear:titre_configurer:></h1> 3 3 <div class="nettoyeur"></div> 4 4 [<div class='ajax'>(#FORMULAIRE_CONFIGURER_SPIPCLEAR)</div>] -
_plugins_/spipclear/spipclear.css.html
r25419 r93559 1 1 #HTTP_HEADER{Content-Type: text/css; charset=utf-8} 2 2 #HTTP_HEADER{Vary: Accept-Encoding} 3 4 3 [(#REM) Feuille de style par defaut pour le code genere par SPIP ] 5 4 #INCLURE{#CHEMIN{spip_style.css}|url_absolue_css} … … 8 7 #INCLURE{#CHEMIN{spip_formulaires.css}|url_absolue_css} 9 8 9 [(#REM)<style>] 10 10 /* Personnalisations SpipClear */ 11 11 … … 21 21 #search #formulaire_recherche label { display: none; } 22 22 #search #formulaire_recherche input.text { background: transparent; padding-left: inherit; } 23 [(#REM)</style>] -
_plugins_/spipclear/spipclear_fonctions.php
r66886 r93559 1 1 <?php 2 2 3 function affdate_long($date) { 4 return affdate_base($date, 'nom_jour').' '.affdate_base($date, 'entier'); 3 if (!defined('_ECRIRE_INC_VERSION')) { 4 return; 5 } 6 7 /** 8 * Afficher la date au complet. 9 * 10 * @param string $date 11 * 12 * @return string 13 */ 14 function affdate_long($date) { 15 return affdate_base($date, 'nom_jour').' '.affdate_base($date, 'entier'); 16 } 17 18 /** 19 * |me compare un id_auteur avec les auteurs d'un article 20 * et renvoie la valeur booleenne true (vrai) si on trouve une correspondance 21 * utilisation: <div id="forum#ID_FORUM" [(#ID_ARTICLE|me{#ID_AUTEUR}|?{' ', ''})class="me"]>. 22 * 23 * @param int $id_article identifiant de l'article 24 * @param int $id_auteur identifiant de l'auteur 25 * 26 * @return bool true si l'id de l'auteur est celui de l'article sinon false 27 */ 28 function me($id_article, $id_auteur = 0) { 29 static $deja = false; 30 static $auteurs = array(); 31 32 /* en spip 3 auteur_articles est remplacé - adapter la requete */ 33 $table = 'spip_auteurs_articles'; 34 $where = 'id_article'; 35 if ($GLOBALS['meta']['version_installee'] >= '19268') { 36 $table = 'spip_auteurs_liens'; 37 $where = "objet='article' AND id_objet"; 38 } 39 if (!$deja) { 40 $r = spip_query('SELECT id_auteur FROM '.$table.' WHERE '.$where."=$id_article"); 41 while ($row = spip_fetch_array($r)) { 42 $auteurs[] = intval($row['id_auteur']); 43 } 44 $deja = true; 5 45 } 6 46 7 /*** 8 * |me compare un id_auteur avec les auteurs d'un article 9 * et renvoie la valeur booleenne true (vrai) si on trouve une correspondance 10 * utilisation: <div id="forum#ID_FORUM"[(#ID_ARTICLE|me{#ID_AUTEUR}|?{' ', ''})class="me"]> 11 ***/ 12 function me($id_article, $id_auteur = 0) { 13 static $deja = false; 14 static $auteurs = array(); 47 return in_array($id_auteur, $auteurs); 48 } 15 49 16 /* en spip 3 auteur_articles est remplacé - adapter la requete */ 17 $table="spip_auteurs_articles"; 18 $where="id_article"; 19 if ($GLOBALS['meta']['version_installee'] >= '19268') { 20 $table="spip_auteurs_liens"; 21 $where="objet='article' AND id_objet"; 50 /** 51 * lister les themes présents dans plugins/spipclear/themes. 52 * 53 * @return string Liste sous la forme ul/li 54 */ 55 function lister_themes() { 56 $dir = _DIR_PLUGIN_SPIPCLEAR.'themes/'; 57 $dir_perso = find_in_path('squelettes/themes/'); 58 $Treps_themes = array(); 59 $htm = ''; 60 if (is_dir($dir) and $t = @opendir($dir)) { 61 $htm .= '<ul style="height: 350px; overflow: auto; margin: 10px 0; border: 1px solid #ccc; background: #fff;">'; 62 while (($rt = readdir($t)) !== false) { 63 if (is_dir($dir.$rt) and $r = @opendir($dir.$rt) and $rt != '..') { 64 $capture = false; 65 $nom_theme = false; 66 while (($f = readdir($r)) !== false) { 67 // à minima un theme doit avoir un fichier style.css 68 if ($f == 'style.css') { 69 $nom_theme = $rt; 70 } 71 if ($f == 'screenshot.jpg') { 72 $capture = true; 73 } 74 } 75 if ($nom_theme) { 76 $htm .= '<li style="padding-left: 10px; border-bottom: 2px solid #ccc;"><p><a id="'.$nom_theme.'" class="theme" href="#" title="'._T(selectionner_theme).'">'.$nom_theme.'</p>'; 77 if ($capture) { 78 $htm .= '<img src="'._DIR_PLUGIN_SPIPCLEAR.'themes/'.$rt.'/screenshot.jpg" />'; 79 } 80 $htm .= "</a></li>\r\n"; 81 } 82 } 22 83 } 23 if(!$deja) { 24 $r = spip_query("SELECT id_auteur FROM ".$table." WHERE ".$where."=$id_article"); 25 while($row = spip_fetch_array($r)) 26 $auteurs[] = intval($row['id_auteur']); 27 $deja = true; 28 } 29 return in_array($id_auteur, $auteurs); 30 } 31 32 // lister les themes présents dans plugins/spipclear/themes 33 function lister_themes() { 34 $dir = _DIR_PLUGIN_SPIPCLEAR.'themes/'; 35 $dir_perso = find_in_path('squelettes/themes/'); 36 $Treps_themes = array(); 37 $htm = ''; 38 if (is_dir($dir) AND $t = @opendir($dir)) { 39 $htm .= '<ul style="height: 350px; overflow: auto; margin: 10px 0; border: 1px solid #ccc; background: #fff;">'; 40 while (($rt = readdir($t)) !== false) { 41 if (is_dir($dir.$rt) AND $r = @opendir($dir.$rt) AND $rt != '..') { 42 $capture = false; 43 $nom_theme = false; 44 while (($f = readdir($r)) !== false) { 45 // à minima un theme doit avoir un fichier style.css 46 if ($f == 'style.css') $nom_theme = $rt; 47 if ($f == 'screenshot.jpg') $capture = true; 48 } 49 if ($nom_theme) { 50 $htm .= '<li style="padding-left: 10px; border-bottom: 2px solid #ccc;"><p><a id="'. $nom_theme .'" class="theme" href="#" title="'. _T(selectionner_theme) .'">'. $nom_theme .'</p>'; 51 if ($capture) { 52 $htm .= '<img src="'._DIR_PLUGIN_SPIPCLEAR.'themes/'.$rt.'/screenshot.jpg" />'; 53 } 54 $htm .= "</a></li>\r\n"; 55 } 56 } 57 } 58 if (is_dir($dir_perso) AND $t = @opendir($dir_perso)) { 84 if (is_dir($dir_perso) and $t = @opendir($dir_perso)) { 59 85 while (($rt = readdir($t)) !== false) { 60 if (is_dir($dir_perso.$rt) AND $r = @opendir($dir_perso.$rt) AND$rt != '..') {86 if (is_dir($dir_perso.$rt) and $r = @opendir($dir_perso.$rt) and $rt != '..') { 61 87 $capture = false; 62 88 $nom_theme = false; 63 89 while (($f = readdir($r)) !== false) { 64 // à minima un theme doit avoir un fichier style.css 65 if ($f == 'style.css') $nom_theme = $rt; 66 if ($f == 'screenshot.jpg') $capture = true; 90 // à minima un theme doit avoir un fichier style.css 91 if ($f == 'style.css') { 92 $nom_theme = $rt; 93 } 94 if ($f == 'screenshot.jpg') { 95 $capture = true; 96 } 67 97 } 68 98 if ($nom_theme) { 69 $htm .= '<li style="padding-left: 10px; border-bottom: 2px solid #ccc;"><p><a id="'. $nom_theme .'" class="theme" href="#" title="'. _T(selectionner_theme) .'">'. $nom_theme.'</p>';99 $htm .= '<li style="padding-left: 10px; border-bottom: 2px solid #ccc;"><p><a id="'.$nom_theme.'" class="theme" href="#" title="'._T(selectionner_theme).'">'.$nom_theme.'</p>'; 70 100 if ($capture) { 71 101 $htm .= '<img src="'.$dir_perso.$rt.'/screenshot.jpg" />'; … … 77 107 } 78 108 $htm .= '</ul>'; 79 80 return $htm; 81 } 82 ?> 109 } 110 111 return $htm; 112 } -
_plugins_/spipclear/spipclear_options.php
r27110 r93559 1 1 <?php 2 3 if (!defined('_ECRIRE_INC_VERSION')) { 4 return; 5 } 6 2 7 // declarer le nouveau pipeline (en test) 3 $GLOBALS['spip_pipelines']['styliser']=''; 4 ?> 8 $GLOBALS['spip_pipelines']['styliser'] = ''; -
_plugins_/spipclear/spipclear_pipelines.php
r59201 r93559 1 1 <?php 2 3 if (!defined('_ECRIRE_INC_VERSION')) { 4 return; 5 } 2 6 3 7 // utiliser le pipeline 'styliser' pour … … 5 9 // d'une rubrique de spipClear 6 10 7 include_spip( "inc/config");8 function spipclear_styliser($flux) {11 include_spip('inc/config'); 12 function spipclear_styliser($flux) { 9 13 // si article, rubrique ou sommaire, 10 14 // on cherche si spip clear doit s'activer 11 15 if (($fond = $flux['args']['fond']) 12 AND in_array($fond, array('article','rubrique','sommaire'))) { 13 16 and in_array($fond, array('article', 'rubrique', 'sommaire'))) { 14 17 $ext = $flux['args']['ext']; 15 18 … … 23 26 } 24 27 } 25 28 26 29 // cas dans une rubrique 27 30 // uniquement si configuration de spipClear pour le secteur en question 28 31 elseif ($id_rubrique = $flux['args']['id_rubrique']) { 29 $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' .intval($id_rubrique));30 if (in_array($id_secteur, lire_config('spipclear/secteurs', array(0, -1)))) {32 $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); 33 if (in_array($id_secteur, lire_config('spipclear/secteurs', array(0, -1)))) { 31 34 if ($squelette = test_squelette_spipclear($fond, $ext)) { 32 35 $flux['data'] = $squelette; … … 35 38 } 36 39 } 40 37 41 return $flux; 38 42 } … … 42 46 return substr($squelette, 0, -strlen(".$ext")); 43 47 } 48 44 49 return false; 45 50 } 46 ?>
Note: See TracChangeset
for help on using the changeset viewer.