Changeset 94530 in spip-zone
- Timestamp:
- Jan 10, 2016, 8:39:53 AM (5 years ago)
- Location:
- _plugins_/traduction_rubriques_autrement/branches/1
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/traduction_rubriques_autrement/branches/1/action/dereferencer_traduction_rubrique.php
r60483 r94530 2 2 3 3 function action_dereferencer_traduction_rubrique_dist() { 4 $securiser_action = charger_fonction('securiser_action', 'inc');4 $securiser_action = charger_fonction('securiser_action', 'inc'); 5 5 $arg = $securiser_action(); 6 6 7 list($type, $id_objet) = explode('/', $arg);7 list($type, $id_objet) = explode('/', $arg); 8 8 if (!$type = objet_type($type) or !$id_objet = intval($id_objet)) { 9 9 if (!_AJAX) { 10 10 include_spip('inc/minipres'); 11 11 minipres('Arguments incompris'); 12 } else { 12 } 13 else { 13 14 spip_log('Arguments incompris dans action dereferencer_traduction_rubrique'); 14 15 return false; … … 24 25 if ($id_trad_old) { 25 26 include_spip('inc/modifier'); 26 modifier_contenu($objet, $id_objet, array('invalideur' => "id='$objet/$id_objet'"), array( 27 'id_trad' => 0 28 )); 29 27 modifier_contenu($objet, $id_objet, array('invalideur' => "id='$objet/$id_objet'"), array('id_trad' => 0)); 28 30 29 // si la deliaison fait qu'il ne reste plus que la source 31 30 // dans le groupe de traduction on lui remet l'id_trad a 0 32 31 if (1 == $nb_dans_groupe = sql_countsel($table, array('id_trad = ' . sql_quote($id_trad_old)))) { 33 modifier_contenu($objet, $id_trad_old, array('invalideur' => "id='$objet/$id_trad_old'"), array( 34 'id_trad' => 0 35 )); 32 modifier_contenu($objet, $id_trad_old, array('invalideur' => "id='$objet/$id_trad_old'"), array('id_trad' => 0)); 36 33 } 37 } 34 } 38 35 } -
_plugins_/traduction_rubriques_autrement/branches/1/css/trad_rub_styles.css
r86241 r94530 1 2 .onglets_traduction{ 3 width:auto; 4 height : auto; 1 .onglets_traduction { 2 width: auto; 3 height: auto; 5 4 vertical-align: baseline; 6 5 } 7 6 8 .onglets_traduction div.options {9 margin :0;10 padding: 0;7 .onglets_traduction div.options { 8 margin: 0; 9 padding: 0; 11 10 } 12 11 13 .onglets_traduction.barre_onglet li.box_onglet {14 float: left;12 .onglets_traduction.barre_onglet li.box_onglet { 13 float: left; 15 14 } 16 15 17 18 16 .onglets_traduction.barre_onglet ul > li.box_onglet:last-child { 19 17 float: none; 20 18 } 21 19 22 .changer div.onglet{background:#F2F2F2; font-style:italic;} 20 .changer div.onglet { 21 background: #F2F2F2; 22 font-style: italic; 23 } 23 24 24 25 .onglets_traduction div.options a { 25 text-align: center;26 padding: 0;27 margin: 0;26 text-align: center; 27 padding: 0; 28 margin: 0; 28 29 } 29 30 30 .onglets_traduction div.options a:hover span {31 display: block;32 width: 72px;33 text-align: center;34 background: #ffffff;35 height :auto;31 .onglets_traduction div.options a:hover span { 32 display: block; 33 width: 72px; 34 text-align: center; 35 background: #ffffff; 36 height: auto; 36 37 } 37 .onglets_traduction.barre_onglet {width: auto} 38 .onglets_traduction.barre_onglet li {display: inline-table; float: none; vertical-align: middle; margin:0} 38 .onglets_traduction.barre_onglet { 39 width: auto 40 } 41 .onglets_traduction.barre_onglet li { 42 display: inline-table; 43 float: none; 44 vertical-align: middle; 45 margin: 0 46 } 39 47 40 .onglets_traduction.barre_onglet a, 41 .onglets_traduction.barre_onglet strong {padding:5px} 42 .onglets_traduction.barre_onglet li.bouton_options {border: none;} 43 .onglets_traduction.barre_onglet .bouton_options a {padding: 0px} 48 .onglets_traduction.barre_onglet a, .onglets_traduction.barre_onglet strong { 49 padding: 5px 50 } 51 .onglets_traduction.barre_onglet li.bouton_options { 52 border: none; 53 } 54 .onglets_traduction.barre_onglet .bouton_options a { 55 padding: 0px 56 } 44 57 45 .barre_onglet .non_traduit a{background:#eeeeee;font-style:italic;} 58 .barre_onglet .traduit a { 59 background: #ffffff; 60 } 61 .barre_onglet .non_traduit a { 62 background: #eeeeee; 63 font-style: italic; 64 } 46 65 66 .bouton_options {/* float:right; */ 67 } 68 .bouton_options img { 69 margin-top: 5px 70 } 47 71 48 .bouton_options{/* float:right; */} 49 .bouton_options img {margin-top: 5px} 72 .nettoyeur { 73 clear: both; 74 } 50 75 51 .nettoyeur{clear:both;} 76 .delier { 77 height: 100px; 78 float: left, margin :0 5px; 79 float: left 80 } 52 81 53 .delier{height:100px;float:left,margin :0 5px;float:left} 82 .danger, .onglets_traduction a.cellule-h-texte { 83 background: repeat scroll 0 0 white; 84 } 54 85 55 .danger,.onglets_traduction a.cellule-h-texte {background: repeat scroll 0 0 white;} 86 .lang { 87 margin-right: 5px; 88 } 56 89 90 .changer {/* float:left; */ 91 margin-bottom: 5px 92 } 57 93 58 .lang{ margin-right:5px;} 94 .liste-elements table.spip tr.trads { 95 background: #dfdfdf 96 } 59 97 60 .changer{/* float:left; */margin-bottom:5px} 98 div.ref { 99 float: right; 100 margin: -3px -2px 0 0; 101 cursor: help; 102 } 61 103 62 .liste-elements table.spip tr.trads{background:#dfdfdf} 63 64 div.ref{float:right;margin:-3px -2px 0 0;cursor:help;} 65 66 div.ref span {display:none;} 104 div.ref span { 105 display: none; 106 } 67 107 68 108 div.ref:hover span { 69 display:block; 70 position:absolute; 71 top:-25px; 72 color: #000000; 73 font-weight:bold; 74 width:250px; 75 } 76 77 .ajouter_trads, .changer .icone_delier_traduction {/* float:left; */} 109 display: block; 110 position: absolute; 111 top: -25px; 112 color: #000000; 113 font-weight: bold; 114 width: 250px; 115 } 78 116 79 117 .icone_delier_traduction { 80 color: #333333; 81 margin: 2.0775em 0; 82 padding: 0 10px; 83 text-align: center; 84 /* position: relative */; 85 /* width:100px */} 118 color: #333333; 119 margin: 2.0775em 0; 120 padding: 0 10px; 121 text-align: center; 122 } -
_plugins_/traduction_rubriques_autrement/branches/1/formulaires/ajouter_traduction.php
r43092 r94530 1 <?php 1 <?php 2 2 3 function formulaires_ajouter_traduction_charger_dist($id_rubrique) {3 function formulaires_ajouter_traduction_charger_dist($id_rubrique) { 4 4 5 $id_trad=sql_getfetsel('id_trad','spip_rubriques','id_rubrique='.$id_rubrique); 6 7 if(!$id_trad){ 8 $id_trad=$id_rubrique; 9 $trad_new='oui'; 10 } 5 $id_trad = sql_getfetsel('id_trad', 'spip_rubriques', 'id_rubrique=' . $id_rubrique); 11 6 12 $valeurs=array( 13 'id_rubrique'=>$id_rubrique, 14 'id_trad'=>$id_trad, 15 'rubriques_menu'=>'', 16 'trad_new='=>'', 17 ); 7 if (!$id_trad) { 8 $id_trad = $id_rubrique; 9 $trad_new = 'oui'; 10 } 18 11 19 $valeurs['_hidden'] .='<input type="hidden" name="id_trad" value="'.$id_trad.'"/>'; 20 $valeurs['_hidden'] .='<input type="hidden" name="id_rubrique" value="'.$id_rubrique.'"/>'; 21 if($trad_new) $valeurs['_hidden'] .='<input type="hidden" name="trad_new" value="'.$trad_new.'"/>'; 12 $valeurs = array( 13 'id_rubrique' => $id_rubrique, 14 'id_trad' => $id_trad, 15 'rubriques_menu' => '', 16 'trad_new=' => '', 17 ); 18 19 $valeurs['_hidden'] .= '<input type="hidden" name="id_trad" value="' . $id_trad . '"/>'; 20 $valeurs['_hidden'] .= '<input type="hidden" name="id_rubrique" value="' . $id_rubrique . '"/>'; 21 if ($trad_new) 22 $valeurs['_hidden'] .= '<input type="hidden" name="trad_new" value="' . $trad_new . '"/>'; 22 23 return $valeurs; 23 } 24 24 } 25 25 26 function formulaires_ajouter_traduction_traiter_dist() {26 function formulaires_ajouter_traduction_traiter_dist() { 27 27 28 $id_trad=_request('id_trad'); 29 $trad_new=_request('trad_new'); 30 $id_rubrique=_request('rubriques_menu'); 31 $id_rubrique=explode('|',$id_rubrique[0]); 32 $id_rubrique=$id_rubrique[1]; 33 34 sql_updateq('spip_rubriques',array('id_trad'=>$id_trad),'id_rubrique='.$id_rubrique); 35 36 if($trad_new)sql_updateq('spip_rubriques',array('id_trad'=>$id_trad),'id_rubrique='.$id_trad); 28 $id_trad = _request('id_trad'); 29 $trad_new = _request('trad_new'); 30 $id_rubrique = _request('rubriques_menu'); 31 $id_rubrique = explode('|', $id_rubrique[0]); 32 $id_rubrique = $id_rubrique[1]; 33 34 sql_updateq('spip_rubriques', array('id_trad' => $id_trad), 'id_rubrique=' . $id_rubrique); 35 36 if ($trad_new) 37 sql_updateq('spip_rubriques', array('id_trad' => $id_trad), 'id_rubrique=' . $id_trad); 37 38 38 39 return $valeurs; 39 } 40 41 40 } 42 41 ?> -
_plugins_/traduction_rubriques_autrement/branches/1/lang/paquet-trad_rub_en.php
r72975 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/paquet-trad_rub_fr.php
r77980 r94530 2 2 // This is a SPIP language file -- Ceci est un fichier langue de SPIP 3 3 // Fichier source, a modifier dans svn://zone.spip.org/spip-zone/_plugins_/traduction_rubriques_autrement/trunk/lang/ 4 if (!defined('_ECRIRE_INC_VERSION')) return; 4 if (!defined('_ECRIRE_INC_VERSION')) { 5 return; 6 } 5 7 6 8 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/paquet-trad_rub_fr_tu.php
r86228 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/paquet-trad_rub_ru.php
r91360 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/paquet-trad_rub_sk.php
r77980 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_ast.php
r75750 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_ca.php
r75750 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_de.php
r64462 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_en.php
r64593 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_es.php
r64593 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_eu.php
r75750 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_fa.php
r75750 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_fr.php
r77980 r94530 2 2 // This is a SPIP language file -- Ceci est un fichier langue de SPIP 3 3 // Fichier source, a modifier dans svn://zone.spip.org/spip-zone/_plugins_/traduction_rubriques_autrement/trunk/lang/ 4 if (!defined('_ECRIRE_INC_VERSION')) return; 4 if (!defined('_ECRIRE_INC_VERSION')) { 5 return; 6 } 5 7 6 8 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_fr_tu.php
r77980 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_pt_br.php
r86694 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_ru.php
r91360 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/lang/tra_sk.php
r64462 r94530 4 4 // ** ne pas modifier le fichier ** 5 5 6 if (!defined('_ECRIRE_INC_VERSION')) return; 6 if (!defined('_ECRIRE_INC_VERSION')) { 7 return; 8 } 7 9 8 10 $GLOBALS[$GLOBALS['idx_lang']] = array( -
_plugins_/traduction_rubriques_autrement/branches/1/paquet.xml
r91360 r94530 1 1 <paquet 2 3 4 version="1.2.9"5 6 7 8 9 > 2 prefix="trad_rub" 3 categorie="edition" 4 version="1.2.10" 5 etat="stable" 6 compatibilite="[3.0.10;3.1.*]" 7 logo="img_pack/Translation-icon_32.png" 8 documentation="http://contrib.spip.net/Traductions-de-rubriques-autrement-3" 9 > 10 10 11 11 <nom>Traductions de rubriques autrement</nom> 12 13 <auteur lien="http://websimple.be">Rainer Müller</auteur> 12 <auteur lien="http://websimple.be">Rainer Müller</auteur> 14 13 <licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL 3</licence> 15 16 <traduire module="tra" reference="fr" gestionnaire="salvatore" /> 17 14 <traduire module="tra" reference="fr" gestionnaire="salvatore" /> 18 15 <pipeline nom="header_prive" inclure="trad_rub_pipelines.php" /> 19 16 <pipeline nom="formulaire_charger" inclure="trad_rub_pipelines.php" /> … … 22 19 <pipeline nom="pre_insertion" inclure="trad_rub_pipelines.php" /> 23 20 <pipeline nom="recuperer_fond" inclure="trad_rub_pipelines.php" /> 24 25 <necessite nom="tradrub" compatibilite="[3.1.1;[" /> 26 <necessite nom="saisies" compatibilite="[2.0.3;[" /> 27 <utilise nom="taa" compatibilite="[1.0.0;[" /> 21 <necessite nom="tradrub" compatibilite="[3.1.1;[" /> 22 <necessite nom="saisies" compatibilite="[2.0.3;[" /> 23 <utilise nom="taa" compatibilite="[1.0.0;[" /> 28 24 </paquet> -
_plugins_/traduction_rubriques_autrement/branches/1/trad_rub_fonctions.php
r67462 r94530 2 2 3 3 // Détermine l'id_parent de la nouvell rubrique traduite 4 function destination_traduction($lang, $id_trad,$creer_racine=''){5 $id_trad_parent='';6 $trads=array();4 function destination_traduction($lang, $id_trad, $creer_racine = '') { 5 $id_trad_parent = ''; 6 $trads = array(); 7 7 8 if($lang AND $id_trad){9 10 $id_trad_parent=sql_getfetsel('id_parent','spip_rubriques','id_rubrique='.$id_trad);8 if ($lang AND $id_trad) { 9 // on établit l'id_parent 10 $id_trad_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . $id_trad); 11 11 12 //puis sa traduction 13 if($id_trad_parent)$id_parent_trad=sql_getfetsel('id_trad','spip_rubriques','id_rubrique='.$id_trad_parent); 14 if($id_trad_parent==0)$trads=array(0=>0,1=>$id_trad,2=>''); 15 // S'il il existe une traduction parente dans la langue demandé on retourne son id 16 elseif($id_parent_trad) { 17 $rub= sql_fetsel('id_rubrique,id_trad','spip_rubriques','id_trad='.$id_parent_trad.' AND lang='.sql_quote($lang)); 18 if($rub){ 19 $trads =array(0=>$rub['id_rubrique'],1=>$id_trad,2=>$creer_racine); 20 } 21 else { 22 $id_trad= sql_getfetsel('id_trad','spip_rubriques','id_trad='.$id_parent_trad); 23 $trads=destination_traduction($lang,$id_trad,'oui'); 24 } 25 } 26 elseif($id_trad_parent){ 27 $trads=destination_traduction($lang,$id_trad_parent,'oui'); 28 } 29 else $trads =array(0=>0,1=>$id_trad); 12 //puis sa traduction 13 if ($id_trad_parent) 14 $id_parent_trad = sql_getfetsel('id_trad', 'spip_rubriques', 'id_rubrique=' . $id_trad_parent); 15 if ($id_trad_parent == 0) 16 $trads = array( 17 0 => 0, 18 1 => $id_trad, 19 2 => '' 20 ); 21 // S'il il existe une traduction parente dans la langue demandé on retourne son id 22 elseif ($id_parent_trad) { 23 $rub = sql_fetsel('id_rubrique,id_trad', 'spip_rubriques', 'id_trad=' . $id_parent_trad . ' AND lang=' . sql_quote($lang)); 24 if ($rub) { 25 $trads = array( 26 0 => $rub['id_rubrique'], 27 1 => $id_trad, 28 2 => $creer_racine 29 ); 30 } 31 else { 32 $id_trad = sql_getfetsel('id_trad', 'spip_rubriques', 'id_trad=' . $id_parent_trad); 33 $trads = destination_traduction($lang, $id_trad, 'oui'); 34 } 35 } 36 elseif ($id_trad_parent) { 37 $trads = destination_traduction($lang, $id_trad_parent, 'oui'); 38 } 39 else 40 $trads = array( 41 0 => 0, 42 1 => $id_trad 43 ); 30 44 31 return $trads; 32 33 } 34 return $trads; 35 36 } 37 45 return $trads; 46 47 } 48 return $trads; 49 50 } 38 51 ?> -
_plugins_/traduction_rubriques_autrement/branches/1/trad_rub_pipelines.php
r77980 r94530 1 1 <?php 2 function trad_rub_header_prive($flux) {2 function trad_rub_header_prive($flux) { 3 3 4 $flux .= '<link rel="stylesheet" href="'.find_in_path('css/trad_rub_styles.css').'" type="text/css" media="all" />'; 5 $flux .='<!-- Example script --> 6 <script type="text/javascript"> 7 $(document).ready( function() { 8 $(".avis_source").click( function() { 9 javascript:alert("'._T('tra:avis_rubrique_source').'"); 10 }); 11 }); 12 </script>'; 13 return $flux; 4 $flux .= '<link rel="stylesheet" href="' . find_in_path('css/trad_rub_styles.css') . '" type="text/css" media="all" />'; 5 return $flux; 14 6 15 }16 17 /*Ajoute la langue de traduction dans le chargement du formulaire edition_rubrique*/18 function trad_rub_formulaire_charger($flux){19 $form = $flux['args']['form'];20 if ($form=='editer_rubrique' AND _request('new')=='oui'){21 22 if(!$flux['data']['lang_dest'] = _request('lang_dest') AND $id_rubrique=_request('id_parent')){23 $flux['data']['lang_dest']=sql_getfetsel('lang','spip_rubriques','id_rubrique='.$id_rubrique);24 }25 if(isset($flux['data']['lang_dest']))26 $flux['data']['_hidden'] .= '<input type="hidden" name="lang_dest" value="'.$flux['data']['lang_dest'].'"/>';27 28 29 }30 return $flux;31 7 } 32 8 33 /*Ajoute l e id traduction a la rubrique d'origine*/34 function trad_rub_formulaire_traiter($flux){35 36 if ($form=='editer_rubrique'){37 $id_trad=_request('lier_trad'); 38 if($id_trad){39 sql_updateq('spip_rubriques',array('id_trad'=>$id_trad),'id_rubrique='.$id_trad);9 /*Ajoute la langue de traduction dans le chargement du formulaire edition_rubrique*/ 10 function trad_rub_formulaire_charger($flux) { 11 $form = $flux['args']['form']; 12 if ($form == 'editer_rubrique' AND _request('new') == 'oui') { 13 14 if (!$flux['data']['lang_dest'] = _request('lang_dest') AND $id_rubrique = _request('id_parent')) { 15 $flux['data']['lang_dest'] = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . $id_rubrique); 40 16 } 41 } 42 return $flux; 43 } 44 /*Prise en compte de la langue de traduction dans le traitement du formulaire edition_article*/ 45 function trad_rub_pre_insertion($flux){ 46 if ($flux['args']['table']=='spip_rubriques'){ 47 48 if($lang=_request('lang_dest')){ 49 $id_trad=_request('lier_trad'); 50 $flux['data']['lang'] = $lang; 51 $flux['data']['langue_choisie'] = 'oui'; 52 $flux['data']['id_trad'] = $id_trad; 53 } 54 } 55 return $flux; 17 if (isset($flux['data']['lang_dest'])) 18 $flux['data']['_hidden'] .= '<input type="hidden" name="lang_dest" value="' . $flux['data']['lang_dest'] . '"/>'; 19 20 } 21 return $flux; 56 22 } 57 23 24 /*Ajoute le id traduction a la rubrique d'origine*/ 25 function trad_rub_formulaire_traiter($flux) { 26 $form = $flux['args']['form']; 27 if ($form == 'editer_rubrique') { 28 $id_trad = _request('lier_trad'); 29 if ($id_trad) { 30 sql_updateq('spip_rubriques', array('id_trad' => $id_trad), 'id_rubrique=' . $id_trad); 31 } 32 } 33 return $flux; 34 } 58 35 59 function trad_rub_recuperer_fond($flux){ 36 /*Prise en compte de la langue de traduction dans le traitement du formulaire edition_article*/ 37 function trad_rub_pre_insertion($flux) { 38 if ($flux['args']['table'] == 'spip_rubriques') { 39 40 if ($lang = _request('lang_dest')) { 41 $id_trad = _request('lier_trad'); 42 $flux['data']['lang'] = $lang; 43 $flux['data']['langue_choisie'] = 'oui'; 44 $flux['data']['id_trad'] = $id_trad; 45 } 46 } 47 return $flux; 48 } 49 50 function trad_rub_recuperer_fond($flux) { 60 51 //Insertion des onglets de langue 61 52 62 if ($flux['args']['fond'] == 'prive/squelettes/contenu/rubrique'){53 if ($flux['args']['fond'] == 'prive/squelettes/contenu/rubrique') { 63 54 include_spip('inc/config'); 64 $contexte=array('id_rubrique'=> $flux['args']['contexte']['id_rubrique']); 65 66 //Verifier si le plugin taa à prévu une limitation d'affiçchage au niveau des secteur 67 $id_secteur=sql_getfetsel('id_secteur','spip_rubriques','id_rubrique='.$contexte['id_rubrique']); 68 $limiter_secteur=lire_config('taa/limiter_secteur')?lire_config('taa/limiter_secteur'):array(); 69 70 if(!in_array($id_secteur,$limiter_secteur)){ 71 $barre_langue=recuperer_fond("prive/editer/barre_traductions_rubrique",$contexte,array('ajax'=>true)); 72 $flux['data']['texte'] = str_replace('</h1>', '</h1>' . $barre_langue, $flux['data']['texte']); 73 } 74 } 55 $contexte = array('id_rubrique' => $flux['args']['contexte']['id_rubrique']); 75 56 57 //Verifier si le plugin taa à prévu une limitation d'affiçchage au niveau des secteur 58 $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . $contexte['id_rubrique']); 59 $limiter_secteur = lire_config('taa/limiter_secteur') ? lire_config('taa/limiter_secteur') : array(); 76 60 77 return $flux; 61 if (!in_array($id_secteur, $limiter_secteur)) { 62 $barre_langue = recuperer_fond("prive/editer/barre_traductions_rubrique", $contexte, array('ajax' => true)); 63 $flux['data']['texte'] = str_replace('</h1>', '</h1>' . $barre_langue, $flux['data']['texte']); 64 } 65 } 66 67 return $flux; 78 68 } 79 69 ?>
Note: See TracChangeset
for help on using the changeset viewer.