Browse Source

Reecriture de la conf par defaut

svn/root/trunk
dominique.lepaisant@ac-caen.fr 2 years ago
parent
commit
f50fcf5941
  1. 2
      .gitattributes
  2. 9
      js/sdn_prive.js
  3. 5
      paquet.xml
  4. 6
      prive/squelettes/inclure/blocs_exclus.html
  5. 20
      sdn_administrations.php
  6. 8
      sdn_fonctions.php
  7. 21
      sdn_pipelines.php

2
.gitattributes vendored

@ -35,6 +35,7 @@ inclure/listes-sites-syndics.html -text
inclure/resume/article.html -text
inclure/resume/evenement.html -text
inclure/resume/site.html -text
js/sdn_prive.js -text
lang/paquet-sdn_fr.php -text
lang/sdn_fr.php -text
lang/sdnnoisettes_fr.php -text
@ -128,7 +129,6 @@ noisettes/tweets.yaml -text
prive/squelettes/_navigation/configurer_sdn.html -text
prive/squelettes/contenu/configurer_sdn.html -text
prive/squelettes/contenu/suggestions_icones.html -text
prive/squelettes/inclure/blocs_exclus.html -text
prive/squelettes/inclure/contact_site.html -text
prive/squelettes/inclure/selection_layer_page.html -text
prive/squelettes/inclure/selection_layer_page_interface.html -text

9
js/sdn_prive.js

@ -0,0 +1,9 @@
$(document).ready(function() {
$('.editer_types_noisettes_masques > div > input[type=checkbox]').each(function() {
var type_noisette = $( this ).val();
var exclus = ["socialtags_fb_like", "socialtags_fb_like_box", "socialtags_badge_fb"];
if( $.inArray( type_noisette, exclus ) != -1 ) {
$( this ).attr( 'checked','checked' ).attr( 'onclick','return false;' ).css( "opacity", "0.5" );
}
});
});

5
paquet.xml

@ -1,12 +1,12 @@
<paquet
prefix="sdn"
categorie="maintenance"
version="0.1.19"
version="0.1.20"
etat="dev"
compatibilite="[3.2.3;3.2.*]"
logo="prive/themes/spip/images/sdn-64.png"
documentation="https://pole-web.etab.ac-caen.fr/"
schema="0.1.0"
schema="1.0.1"
>
<!--
Paquet généré le 2019-02-17 11:52
@ -25,5 +25,6 @@
<pipeline nom="autoriser" inclure="sdn_autorisations.php" />
<pipeline nom="affiche_milieu" inclure="sdn_pipelines.php" />
<pipeline nom="header_prive" inclure="sdn_pipelines.php" />
</paquet>

6
prive/squelettes/inclure/blocs_exclus.html

@ -1,6 +0,0 @@
<div class="sdn_blocs_exclus hidden">
<?php
sdn_update_blocs_exclus();
sdn_types_noisettes_exclus();
?>
</div>

20
sdn_administrations.php

@ -25,7 +25,8 @@ if (!defined('_ECRIRE_INC_VERSION')) {
**/
function sdn_upgrade($nom_meta_base_version, $version_cible) {
$maj = array();
include_spip('inc/config');
// Configurations du noizetier par défaut
$config_noizetier_sdn = array(
'objets_noisettes' => array('spip_articles','spip_rubriques'),
@ -33,6 +34,7 @@ function sdn_upgrade($nom_meta_base_version, $version_cible) {
'ajax_noisette' => '',
'inclusion_dynamique_noisette' => '',
'profondeur_max' => '',
'types_noisettes_masques' => array('environnement', 'socialtags_badge_fb', 'socialtags_fb_like', 'socialtags_fb_like_box','codespip', 'conteneur')
);
// Configurations de socialtags par défaut
$config_socialtags_sdn = array(
@ -41,13 +43,25 @@ function sdn_upgrade($nom_meta_base_version, $version_cible) {
'afterorappend' => 'after',
'wopen' => 'non',
);
$maj['create'] = array(
array('ecrire_config', 'noizetier', $config_noizetier_sdn),
array('ecrire_config', 'socialtags', $config_socialtags_sdn),
);
// Maj 1.0.1
$noizetier_config = lire_config('noizetier');
foreach($config_noizetier_sdn['types_noisettes_masques'] as $type) {
if (!in_array($type,$noizetier_config['types_noisettes_masques'])) {
array_push($noizetier_config['types_noisettes_masques'] ,$type);
}
}
$blocs_exclus_sdn = serialize(array('head','head_js','header','footer','breadcrumb'));
$maj['1.0.1'] = array(
array('sql_updateq', 'spip_noizetier_pages', array('blocs_exclus' => $blocs_exclus_sdn)),
array('ecrire_config', 'noizetier', $noizetier_config)
);
include_spip('base/upgrade');
maj_plugin($nom_meta_base_version, $version_cible, $maj);

8
sdn_fonctions.php

@ -41,11 +41,3 @@ function sdn_update_blocs_exclus() {
return;
}
/*
* noisettes a exclure
*/
function sdn_types_noisettes_exclus() {
include_spip('inc/config');
ecrire_config('noizetier/types_noisettes_masques', array('environnement', 'socialtags_badge_fb', 'socialtags_fb_like', 'socialtags_fb_like_box'));
return;
}

21
sdn_pipelines.php

@ -25,15 +25,20 @@ function sdn_affiche_milieu($flux) {
if ($exec == "noizetier_page" || $exec == "noizetier_pages") {
$page = $flux["args"]["page"];
$contexte = array('page'=>$page?$page:"defaut");
$ret .= recuperer_fond("prive/squelettes/inclure/selection_layer_page_interface", $contexte);
$ret .= recuperer_fond("prive/squelettes/inclure/blocs_exclus");
$ret .= recuperer_fond("prive/squelettes/inclure/selection_layer_page_interface", $contexte);
$flux["data"] .= $ret;
}
/* if ($exec == "configurer_identite") {
$page = $flux["args"]["page"];
$ret .= recuperer_fond("prive/squelettes/inclure/contact_site");
$flux["data"] .= $ret;
}
*/
return $flux;
}
/**
* Insertion dans le head du prive
*
* @param array $flux
* @return array
*/
function sdn_header_prive($flux) {
$flux .= '<script src="' . find_in_path('js/sdn_prive.js') . '" type="text/javascript"></script>' . "\n";
return $flux;
}

Loading…
Cancel
Save