Browse Source

on bouge

svn/attic/spip-bonux-2/104327
ben.spip@gmail.com 12 years ago
commit
f058a2242e
  1. 63
      .gitattributes
  2. 8
      ajax_item_pick.html
  3. 12
      connect/condition.php
  4. 12
      connect/pour.php
  5. 34
      formulaires/dateur/datePicker.css
  6. 467
      formulaires/dateur/dates.js
  7. 34
      formulaires/dateur/inc-dateur.html
  8. 1061
      formulaires/dateur/jquery.datePicker.js
  9. 208
      formulaires/dateur/jquery.timePicker.js
  10. BIN
      formulaires/dateur/picker-16.gif
  11. 26
      formulaires/dateur/timePicker.css
  12. 10
      formulaires/recherche_ecrire.html
  13. 31
      formulaires/recherche_ecrire.php
  14. 17
      formulaires/selecteur/articles.html
  15. 9
      formulaires/selecteur/inc-nav-articles.html
  16. 9
      formulaires/selecteur/inc-nav-rubriques.html
  17. 3
      formulaires/selecteur/inc-sel-articles.html
  18. 8
      formulaires/selecteur/inc-sel-rubriques.html
  19. 2255
      formulaires/selecteur/jquery-ui-1.6.custom.js
  20. 84
      formulaires/selecteur/jquery.picker.js
  21. 24
      formulaires/selecteur/navigateur.html
  22. 34
      formulaires/selecteur/picker-ajax.html
  23. 13
      formulaires/selecteur/picker.css
  24. 24
      formulaires/selecteur/rubriques.html
  25. BIN
      img_pack/annuler-recherche.png
  26. BIN
      img_pack/article-12.png
  27. BIN
      img_pack/deplier-droite.gif
  28. BIN
      img_pack/deplier-droite.png
  29. BIN
      img_pack/frame-close.png
  30. BIN
      img_pack/item-add.gif
  31. BIN
      img_pack/item-add.png
  32. BIN
      img_pack/item-remove.png
  33. BIN
      img_pack/logo-bonux.gif
  34. BIN
      img_pack/spip-bonux.png
  35. BIN
      img_pack/tri_asc-12.png
  36. BIN
      img_pack/tri_asc-16.png
  37. BIN
      img_pack/tri_asc-24.png
  38. BIN
      img_pack/tri_asc.png
  39. BIN
      img_pack/tri_desc-12.png
  40. BIN
      img_pack/tri_desc-16.png
  41. BIN
      img_pack/tri_desc-24.png
  42. 184
      inc/core21_filtres.php
  43. 136
      inc/couleurs.php
  44. 92
      inc/importer_csv.php
  45. 23
      lang/spip_bonux_fr.php
  46. 15
      modeles/pagination.html
  47. 16
      modeles/pagination_page.html
  48. 15
      plugin.xml
  49. 74
      prive/style_prive_plugin_bonux.html
  50. 308
      public/spip_bonux_balises.php
  51. 237
      public/spip_bonux_criteres.php
  52. 526
      req/array.php
  53. 88
      spip_bonux_fonctions.php
  54. 809
      style_prive.html
  55. 374
      style_prive_formulaires.html
  56. 71
      style_prive_plugins.html
  57. 10
      style_prive_plugins_fonctions.php
  58. 30
      test_boucles_iterations.html
  59. 30
      test_boucles_si.html
  60. 117
      test_boucles_tableaux.html
  61. 16
      testnoeud.html
  62. 60
      tests/balises/set_merge.html
  63. 25
      tests/balises/set_push.html

63
.gitattributes

@ -0,0 +1,63 @@
* text=auto !eol
/ajax_item_pick.html -text
connect/condition.php -text
connect/pour.php -text
formulaires/dateur/datePicker.css -text
formulaires/dateur/dates.js -text
formulaires/dateur/inc-dateur.html -text
formulaires/dateur/jquery.datePicker.js -text
formulaires/dateur/jquery.timePicker.js -text
formulaires/dateur/picker-16.gif -text
formulaires/dateur/timePicker.css -text
formulaires/recherche_ecrire.html -text
formulaires/recherche_ecrire.php -text
formulaires/selecteur/articles.html -text
formulaires/selecteur/inc-nav-articles.html -text
formulaires/selecteur/inc-nav-rubriques.html -text
formulaires/selecteur/inc-sel-articles.html -text
formulaires/selecteur/inc-sel-rubriques.html -text
formulaires/selecteur/jquery-ui-1.6.custom.js -text
formulaires/selecteur/jquery.picker.js -text
formulaires/selecteur/navigateur.html -text
formulaires/selecteur/picker-ajax.html -text
formulaires/selecteur/picker.css -text
formulaires/selecteur/rubriques.html -text
img_pack/annuler-recherche.png -text
img_pack/article-12.png -text
img_pack/deplier-droite.gif -text
img_pack/deplier-droite.png -text
img_pack/frame-close.png -text
img_pack/item-add.gif -text
img_pack/item-add.png -text
img_pack/item-remove.png -text
img_pack/logo-bonux.gif -text
img_pack/spip-bonux.png -text
img_pack/tri_asc-12.png -text
img_pack/tri_asc-16.png -text
img_pack/tri_asc-24.png -text
img_pack/tri_asc.png -text
img_pack/tri_desc-12.png -text
img_pack/tri_desc-16.png -text
img_pack/tri_desc-24.png -text
inc/core21_filtres.php -text
inc/couleurs.php -text
inc/importer_csv.php -text
lang/spip_bonux_fr.php -text
modeles/pagination.html -text
modeles/pagination_page.html -text
/plugin.xml -text
prive/style_prive_plugin_bonux.html -text
public/spip_bonux_balises.php -text
public/spip_bonux_criteres.php -text
req/array.php -text
/spip_bonux_fonctions.php -text
/style_prive.html -text
/style_prive_formulaires.html -text
/style_prive_plugins.html -text
/style_prive_plugins_fonctions.php -text
/test_boucles_iterations.html -text
/test_boucles_si.html -text
/test_boucles_tableaux.html -text
/testnoeud.html -text
tests/balises/set_merge.html -text
tests/balises/set_push.html -text

8
ajax_item_pick.html

@ -0,0 +1,8 @@
[(#REM)
Squelette
(c) xxx
Distribue sous licence GPL
][(#HTTP_HEADER{Content-type: text/javascript[; charset=(#CHARSET)]})
]#CACHE{3600}[(#ENV{ref}|picker_identifie_id_rapide{#ENV{rubriques,0},#ENV{articles,0}})]

12
connect/condition.php

@ -0,0 +1,12 @@
<?php
/**
* Plugin Spip 2.0 Reloaded
* Ce que vous ne trouverez pas dans Spip 2.0
* (c) 2008 Cedric Morin
* Licence GPL
*
*/
if (!defined("_ECRIRE_INC_VERSION")) return;
$GLOBALS['spip_connect_version'] = 0.1;
spip_connect_db('host','port','login','pass','base','array', '','');
?>

12
connect/pour.php

@ -0,0 +1,12 @@
<?php
/**
* Plugin Spip 2.0 Reloaded
* Ce que vous ne trouverez pas dans Spip 2.0
* (c) 2008 Cedric Morin
* Licence GPL
*
*/
if (!defined("_ECRIRE_INC_VERSION")) return;
$GLOBALS['spip_connect_version'] = 0.1;
spip_connect_db('host','port','login','pass','base','array', '','');
?>

34
formulaires/dateur/datePicker.css

@ -0,0 +1,34 @@
table.jCalendar { background: #c0cad4; border-collapse: separate; border-spacing: 2px; }
table.jCalendar th { background: #c0cad4; color: #333; font-weight: bold; padding: 3px 5px; text-transform: uppercase; }
table.jCalendar td { background: #fff; color: #000; padding: 3px 5px; text-align: center; }
table.jCalendar td.other-month { color: #aaa; }
table.jCalendar td.today { background: #666; color: #fff; }
table.jCalendar td.selected { background: #f66; color: #fff; }
table.jCalendar td.selected:hover { background: #f33; color: #fff; }
table.jCalendar td:hover,
table.jCalendar td.dp-hover { background: #eee; color: #000; }
table.jCalendar td.disabled,
table.jCalendar td.disabled:hover { background: #e0e5ea; color: #888; }
/* For the popup */
/* NOTE - you will probably want to style a.dp-choose-date - see how I did it in demo.css */
div.dp-popup { position: relative; background: #e0e5ea; border: 1px solid #85909a; font-size: 10px; font-family: arial, sans-serif; padding: 2px; line-height: 1.2em; }
div#dp-popup { position: absolute; z-index: 199; }
div.dp-popup h2 { font-size: 12px; text-align: center; margin: 2px 0; padding: 0; color: #555; }
a#dp-close { font-size: 11px; padding: 4px 0; text-align: center; display: block; }
a#dp-close:hover { text-decoration: underline; }
div.dp-popup a { color: #000; text-decoration: none; padding: 3px 2px 0; }
div.dp-popup div.dp-nav-prev { position: absolute; top: 2px; left: 4px; width: 100px; }
div.dp-popup div.dp-nav-prev a { float: left; }
/* Opera needs the rules to be this specific otherwise it doesn't change the cursor back to pointer after you have disabled and re-enabled a link */
div.dp-popup div.dp-nav-prev a,
div.dp-popup div.dp-nav-next a { cursor: pointer; }
div.dp-popup div.dp-nav-prev a.disabled,
div.dp-popup div.dp-nav-next a.disabled { cursor: default; }
div.dp-popup div.dp-nav-next { position: absolute; top: 2px; right: 4px; width: 100px; }
div.dp-popup div.dp-nav-next a { float: right; }
div.dp-popup a.disabled { cursor: default; color: #aaa; }
div.dp-popup td { cursor: pointer; }
div.dp-popup td.disabled { cursor: default; }

467
formulaires/dateur/dates.js

@ -0,0 +1,467 @@
/*
* Date prototype extensions. Doesn't depend on any
* other code. Doens't overwrite existing methods.
*
* Adds dayNames, abbrDayNames, monthNames and abbrMonthNames static properties and isLeapYear,
* isWeekend, isWeekDay, getDaysInMonth, getDayName, getMonthName, getDayOfYear, getWeekOfYear,
* setDayOfYear, addYears, addMonths, addDays, addHours, addMinutes, addSeconds methods
*
* Copyright (c) 2006 J̦rn Zaefferer and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
*
* Additional methods and properties added by Kelvin Luck: firstDayOfWeek, dateFormat, zeroTime, asString, fromString -
* I've added my name to these methods so you know who to blame if they are broken!
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
/**
* An Array of day names starting with Sunday.
*
* @example dayNames[0]
* @result 'Sunday'
*
* @name dayNames
* @type Array
* @cat Plugins/Methods/Date
*/
Date.dayNames = ['', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
/**
* An Array of abbreviated day names starting with Sun.
*
* @example abbrDayNames[0]
* @result 'Sun'
*
* @name abbrDayNames
* @type Array
* @cat Plugins/Methods/Date
*/
Date.abbrDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
/**
* An Array of month names starting with Janurary.
*
* @example monthNames[0]
* @result 'January'
*
* @name monthNames
* @type Array
* @cat Plugins/Methods/Date
*/
Date.monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
/**
* An Array of abbreviated month names starting with Jan.
*
* @example abbrMonthNames[0]
* @result 'Jan'
*
* @name monthNames
* @type Array
* @cat Plugins/Methods/Date
*/
Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
/**
* The first day of the week for this locale.
*
* @name firstDayOfWeek
* @type Number
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
Date.firstDayOfWeek = 1;
/**
* The format that string dates should be represented as (e.g. 'dd/mm/yyyy' for UK, 'mm/dd/yyyy' for US, 'yyyy-mm-dd' for Unicode etc).
*
* @name format
* @type String
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
Date.format = 'dd/mm/yyyy';
//Date.format = 'mm/dd/yyyy';
//Date.format = 'yyyy-mm-dd';
//Date.format = 'dd mmm yy';
/**
* The first two numbers in the century to be used when decoding a two digit year. Since a two digit year is ambiguous (and date.setYear
* only works with numbers < 99 and so doesn't allow you to set years after 2000) we need to use this to disambiguate the two digit year codes.
*
* @name format
* @type String
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
Date.fullYearStart = '20';
(function() {
/**
* Adds a given method under the given name
* to the Date prototype if it doesn't
* currently exist.
*
* @private
*/
function add(name, method) {
if( !Date.prototype[name] ) {
Date.prototype[name] = method;
}
};
/**
* Checks if the year is a leap year.
*
* @example var dtm = new Date("01/12/2008");
* dtm.isLeapYear();
* @result true
*
* @name isLeapYear
* @type Boolean
* @cat Plugins/Methods/Date
*/
add("isLeapYear", function() {
var y = this.getFullYear();
return (y%4==0 && y%100!=0) || y%400==0;
});
/**
* Checks if the day is a weekend day (Sat or Sun).
*
* @example var dtm = new Date("01/12/2008");
* dtm.isWeekend();
* @result false
*
* @name isWeekend
* @type Boolean
* @cat Plugins/Methods/Date
*/
add("isWeekend", function() {
return this.getDay()==0 || this.getDay()==6;
});
/**
* Check if the day is a day of the week (Mon-Fri)
*
* @example var dtm = new Date("01/12/2008");
* dtm.isWeekDay();
* @result false
*
* @name isWeekDay
* @type Boolean
* @cat Plugins/Methods/Date
*/
add("isWeekDay", function() {
return !this.isWeekend();
});
/**
* Gets the number of days in the month.
*
* @example var dtm = new Date("01/12/2008");
* dtm.getDaysInMonth();
* @result 31
*
* @name getDaysInMonth
* @type Number
* @cat Plugins/Methods/Date
*/
add("getDaysInMonth", function() {
return [31,(this.isLeapYear() ? 29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()];
});
/**
* Gets the name of the day.
*
* @example var dtm = new Date("01/12/2008");
* dtm.getDayName();
* @result 'Saturday'
*
* @example var dtm = new Date("01/12/2008");
* dtm.getDayName(true);
* @result 'Sat'
*
* @param abbreviated Boolean When set to true the name will be abbreviated.
* @name getDayName
* @type String
* @cat Plugins/Methods/Date
*/
add("getDayName", function(abbreviated) {
return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()];
});
/**
* Gets the name of the month.
*
* @example var dtm = new Date("01/12/2008");
* dtm.getMonthName();
* @result 'Janurary'
*
* @example var dtm = new Date("01/12/2008");
* dtm.getMonthName(true);
* @result 'Jan'
*
* @param abbreviated Boolean When set to true the name will be abbreviated.
* @name getDayName
* @type String
* @cat Plugins/Methods/Date
*/
add("getMonthName", function(abbreviated) {
return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()];
});
/**
* Get the number of the day of the year.
*
* @example var dtm = new Date("01/12/2008");
* dtm.getDayOfYear();
* @result 11
*
* @name getDayOfYear
* @type Number
* @cat Plugins/Methods/Date
*/
add("getDayOfYear", function() {
var tmpdtm = new Date("1/1/" + this.getFullYear());
return Math.floor((this.getTime() - tmpdtm.getTime()) / 86400000);
});
/**
* Get the number of the week of the year.
*
* @example var dtm = new Date("01/12/2008");
* dtm.getWeekOfYear();
* @result 2
*
* @name getWeekOfYear
* @type Number
* @cat Plugins/Methods/Date
*/
add("getWeekOfYear", function() {
return Math.ceil(this.getDayOfYear() / 7);
});
/**
* Set the day of the year.
*
* @example var dtm = new Date("01/12/2008");
* dtm.setDayOfYear(1);
* dtm.toString();
* @result 'Tue Jan 01 2008 00:00:00'
*
* @name setDayOfYear
* @type Date
* @cat Plugins/Methods/Date
*/
add("setDayOfYear", function(day) {
this.setMonth(0);
this.setDate(day);
return this;
});
/**
* Add a number of years to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addYears(1);
* dtm.toString();
* @result 'Mon Jan 12 2009 00:00:00'
*
* @name addYears
* @type Date
* @cat Plugins/Methods/Date
*/
add("addYears", function(num) {
this.setFullYear(this.getFullYear() + num);
return this;
});
/**
* Add a number of months to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addMonths(1);
* dtm.toString();
* @result 'Tue Feb 12 2008 00:00:00'
*
* @name addMonths
* @type Date
* @cat Plugins/Methods/Date
*/
add("addMonths", function(num) {
var tmpdtm = this.getDate();
this.setMonth(this.getMonth() + num);
if (tmpdtm > this.getDate())
this.addDays(-this.getDate());
return this;
});
/**
* Add a number of days to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addDays(1);
* dtm.toString();
* @result 'Sun Jan 13 2008 00:00:00'
*
* @name addDays
* @type Date
* @cat Plugins/Methods/Date
*/
add("addDays", function(num) {
this.setDate(this.getDate() + num);
return this;
});
/**
* Add a number of hours to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addHours(24);
* dtm.toString();
* @result 'Sun Jan 13 2008 00:00:00'
*
* @name addHours
* @type Date
* @cat Plugins/Methods/Date
*/
add("addHours", function(num) {
this.setHours(this.getHours() + num);
return this;
});
/**
* Add a number of minutes to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addMinutes(60);
* dtm.toString();
* @result 'Sat Jan 12 2008 01:00:00'
*
* @name addMinutes
* @type Date
* @cat Plugins/Methods/Date
*/
add("addMinutes", function(num) {
this.setMinutes(this.getMinutes() + num);
return this;
});
/**
* Add a number of seconds to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addSeconds(60);
* dtm.toString();
* @result 'Sat Jan 12 2008 00:01:00'
*
* @name addSeconds
* @type Date
* @cat Plugins/Methods/Date
*/
add("addSeconds", function(num) {
this.setSeconds(this.getSeconds() + num);
return this;
});
/**
* Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant.
*
* @example var dtm = new Date();
* dtm.zeroTime();
* dtm.toString();
* @result 'Sat Jan 12 2008 00:01:00'
*
* @name zeroTime
* @type Date
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
add("zeroTime", function() {
this.setMilliseconds(0);
this.setSeconds(0);
this.setMinutes(0);
this.setHours(0);
return this;
});
/**
* Returns a string representation of the date object according to Date.format.
* (Date.toString may be used in other places so I purposefully didn't overwrite it)
*
* @example var dtm = new Date("01/12/2008");
* dtm.asString();
* @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy'
*
* @name asString
* @type Date
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
add("asString", function() {
var r = Date.format;
return r
.split('yyyy').join(this.getFullYear())
.split('yy').join((this.getFullYear() + '').substring(2))
.split('mmm').join(this.getMonthName(true))
.split('mm').join(_zeroPad(this.getMonth()+1))
.split('dd').join(_zeroPad(this.getDate()));
});
/**
* Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object
* (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere)
*
* @example var dtm = Date.fromString("12/01/2008");
* dtm.toString();
* @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy'
*
* @name fromString
* @type Date
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
Date.fromString = function(s)
{
var f = Date.format;
var d = new Date('01/01/1977');
var iY = f.indexOf('yyyy');
if (iY > -1) {
d.setFullYear(Number(s.substr(iY, 4)));
} else {
// TODO - this doesn't work very well - are there any rules for what is meant by a two digit year?
d.setFullYear(Number(Date.fullYearStart + s.substr(f.indexOf('yy'), 2)));
}
var iM = f.indexOf('mmm');
if (iM > -1) {
var mStr = s.substr(iM, 3);
for (var i=0; i<Date.abbrMonthNames.length; i++) {
if (Date.abbrMonthNames[i] == mStr) break;
}
d.setMonth(i);
} else {
d.setMonth(Number(s.substr(f.indexOf('mm'), 2)) - 1);
}
d.setDate(Number(s.substr(f.indexOf('dd'), 2)));
if (isNaN(d.getTime())) {
return false;
}
return d;
};
// utility method
var _zeroPad = function(num) {
var s = '0'+num;
return s.substring(s.length-2)
//return ('0'+num).substring(-2); // doesn't work on IE :(
};
})();

34
formulaires/dateur/inc-dateur.html

@ -0,0 +1,34 @@
<script type='text/javascript' src='#CHEMIN{formulaires/dateur/dates.js}'></script>
<script type='text/javascript' src='#CHEMIN{formulaires/dateur/jquery.datePicker.js}'></script>
<script type='text/javascript' src='#CHEMIN{formulaires/dateur/jquery.timePicker.js}'></script>
<script type='text/javascript'>
Date.dayNames = ['<:date_jour_1:>', '<:date_jour_2:>', '<:date_jour_3:>', '<:date_jour_4:>', '<:date_jour_5:>', '<:date_jour_6:>', '<:date_jour_7:>'];
Date.abbrDayNames = ['<:date_jour_1_abbr:>', '<:date_jour_2_abbr:>', '<:date_jour_3_abbr:>', '<:date_jour_4_abbr:>', '<:date_jour_5_abbr:>', '<:date_jour_6_abbr:>', '<:date_jour_7_abbr:>'];
Date.monthNames = ['<:date_mois_1:>', '<:date_mois_2:>', '<:date_mois_3:>', '<:date_mois_4:>', '<:date_mois_5:>', '<:date_mois_6:>', '<:date_mois_7:>', '<:date_mois_8:>', '<:date_mois_9:>', '<:date_mois_10:>', '<:date_mois_11:>', '<:date_mois_12:>'];
Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
Date.firstDayOfWeek = 1;
Date.format = 'dd/mm/yyyy';
jQuery.dpText = {
TEXT_PREV_YEAR : '<:spip_bonux:annee_precedente|texte_script:>',
TEXT_PREV_MONTH : '<:spip_bonux:mois_precedent|texte_script:>',
TEXT_NEXT_YEAR : '<:spip_bonux:annee_suivante|texte_script:>',
TEXT_NEXT_MONTH : '<:spip_bonux:mois_suivant|texte_script:>',
TEXT_CLOSE : '<:spip_bonux:bouton_fermer|texte_script:>',
TEXT_CHOOSE_DATE : '<img src=\'#CHEMIN{formulaires/dateur/picker-16.gif}\' alt=\'<:spip_bonux:afficher_calendrier|attribut_html:>\' />',
TITLE_CHOOSE_DATE : '<:spip_bonux:afficher_calendrier|texte_script:>'
}
jQuery(function()
{
jQuery('input.date').datePicker({startDate:'01/01/1900'}).dpSetPosition(jQuery.dpConst.POS_TOP, jQuery.dpConst.POS_RIGHT);
jQuery("input.heure").timePicker();
});
</script>
<style>
@import url(#CHEMIN{formulaires/dateur/datePicker.css});
@import url(#CHEMIN{formulaires/dateur/timePicker.css});
a.dp-choose-date { display: inline-block; padding: 0; margin: 3px 0 0 -19px; vertical-align: bottom; }
div.time-picker {font-size:11px; width:5em; /* needed for IE */}
.formulaire_spip input.date {width:8em;padding-right:25px;}
.formulaire_spip input.heure {width:7em;}
</style>

1061
formulaires/dateur/jquery.datePicker.js
File diff suppressed because it is too large
View File

208
formulaires/dateur/jquery.timePicker.js

@ -0,0 +1,208 @@
/*
* Copyright (c) 2006 Sam Collett (http://www.texotela.co.uk)
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*/
/*
* A time picker for jQuery
* Based on original timePicker by Sam Collet (http://www.texotela.co.uk)
* @name timePicker
* @version 0.1
* @author Anders Fajerson (http://perifer.se)
* @example $("#mytime").timePicker();
* @example $("#mytime").timePicker({step:30, startTime:"15:00", endTime:"18:00"});
*/
(function($){
$.fn.timePicker = function(options) {
// Build main options before element iteration
var settings = $.extend({}, $.fn.timePicker.defaults, options);
return this.each(function() {
$.timePicker(this, settings);
});
};
$.timePicker = function (elm, settings) {
var elm = $(elm)[0];
return elm.timePicker || (elm.timePicker = new jQuery._timePicker(elm, settings));
};
$._timePicker = function(elm, settings) {
var tpOver = false;
var startTime = normaliseTime(settings.startTime);
var endTime = normaliseTime(settings.endTime);
$(elm).attr('autocomplete', 'OFF'); // Disable browser autocomplete
var times = [];
var time = new Date(startTime); // Create a new date object.
while(time <= endTime) {
times[times.length] = formatTime(time, settings);
time = new Date(time.setMinutes(time.getMinutes() + settings.step));
}
var $tpDiv = $('<div class="time-picker'+ (settings.show24Hours ? '' : ' time-picker-12hours') +'"></div>');
var $tpList = $('<ul></ul>');
// Build the list.
for(var i = 0; i < times.length; i++) {
$tpList.append("<li>" + times[i] + "</li>");
}
$tpDiv.append($tpList);
// Store element offset.
var elmOffset = $(elm).offset();
// Append the timPicker to the body and position it.
$tpDiv.appendTo('body').css({'top':elmOffset.top, 'left':elmOffset.left}).hide();
$("li", $tpList).unbind().mouseover(function() {
$("li.selected", $tpDiv).removeClass("selected"); // TODO: only needs to run once.
$(this).addClass("selected");
}).mousedown(function() {
tpOver = true;
}).click(function() {
setTimeVal(elm, this, $tpDiv, settings);
tpOver = false;
});
// Store ananymous function in variable since it's used twice.
var showPicker = function() {
$tpDiv.show(); // Show picker.
$tpDiv.mouseover(function() { // Have to use mouseover instead of mousedown because of Opera
tpOver = true;
}).mouseout(function() {
tpOver = false;
});
$("li", $tpDiv).removeClass("selected");
// Try to find a time in the list that matches the entered time.
var time = this.value ? timeStringToDate(this.value, settings) : startTime;
var startMin = startTime.getHours() * 60 + startTime.getMinutes();
var min = (time.getHours() * 60 + time.getMinutes()) - startMin;
var steps = Math.round(min / settings.step);
var roundTime = normaliseTime(new Date(2001, 0, 0, 0, (steps * settings.step + (startMin)), 0));
roundTime = (startTime < roundTime && roundTime < endTime) ? roundTime : startTime;
var $matchedTime = $("li:contains(" + formatTime(roundTime, settings) + ")", $tpDiv);
if ($matchedTime.length) {
$matchedTime.addClass("selected");
// Scroll to matched time.
$tpDiv[0].scrollTop = $matchedTime[0].offsetTop;
}
};
$(elm).unbind().focus(showPicker).click(showPicker)
// Hide timepicker on blur
.blur(function() {
if (!tpOver && $tpDiv[0].parentNode) { // Don't remove when timePicker is clicked or when already removed
$tpDiv.hide();
}
})
// Key support
.keypress(function(e) {
switch (e.keyCode) {
case 38: // Up arrow.
case 63232: // Safari up arrow.
var $selected = $("li.selected", $tpList);
var prev = $selected.prev().addClass("selected")[0];
if (prev) {
$selected.removeClass("selected");
$tpDiv[0].scrollTop = prev.offsetTop;
}
return false;
break;
case 40: // Down arrow.
case 63233: // Safari down arrow.
var $selected = $("li.selected", $tpList);
var next = $selected.length ? $selected.next().addClass("selected")[0] : $("li:first").addClass("selected")[0];
if (next) {
$selected.removeClass("selected");
$tpDiv[0].scrollTop = next.offsetTop;
}
return false;
break;
case 13: // Enter
if (!$tpDiv.is(":hidden")) {
var sel = $("li.selected", $tpList)[0];
setTimeVal(elm, sel, $tpDiv, settings);
return false;
}
break;
}
});
// Helper function to get an inputs current time as Date object.
// Returns a Date object.
this.getTime = function() {
return timeStringToDate(elm.value, settings);
};
// Helper function to set a time input.
// Takes a Date object.
this.setTime = function(time) {
elm.value = formatTime(normaliseTime(time), settings);
// Trigger element's change events.
$(elm).change();
};
}; // End fn;
// Plugin defaults.
$.fn.timePicker.defaults = {
step:30,
startTime: new Date(0, 0, 0, 0, 0, 0),
endTime: new Date(0, 0, 0, 23, 30, 0),
separator: ':',
show24Hours: true
};
// Private functions.
function setTimeVal(elm, sel, $tpDiv, settings) {
// Update input field
elm.value = $(sel).text();
// Trigger element's change events.
$(elm).change();
// Keep focus for all but IE (which doesn't like it)
if (!$.browser.msie) {
elm.focus();
}
// Hide picker
$tpDiv.hide();
}
function formatTime(time, settings) {
var h = time.getHours();
var hours = settings.show24Hours ? h : (((h + 11) % 12) + 1);
var minutes = time.getMinutes();
return formatNumber(hours) + settings.separator + formatNumber(minutes) + (settings.show24Hours ? '' : ((h < 12) ? ' AM' : ' PM'));
}
function formatNumber(value) {
return (value < 10 ? '0' : '') + value;
}
function timeStringToDate(input, settings) {
if (input) {
var array = input.split(settings.separator);
var hours = parseFloat(array[0]);
var minutes = parseFloat(array[1]);
var time = new Date(0, 0, 0, hours, minutes, 0);
return normaliseTime(time);
}
return null;
}
/* Normalise time object to a common date. */
function normaliseTime(time) {
time.setFullYear(2001);
time.setMonth(0);
time.setDate(0);
return time;
}
})(jQuery);

BIN
formulaires/dateur/picker-16.gif

After

Width: 16  |  Height: 16  |  Size: 89 B

26
formulaires/dateur/timePicker.css

@ -0,0 +1,26 @@
div.time-picker {
position: absolute;
height: 200px;
width:4em; /* needed for IE */
overflow: auto;
background: #fff;
border: 1px solid #000;
z-index: 99;
}
div.time-picker-12hours {
width:6em; /* needed for IE */
}
div.time-picker ul {
list-style-type: none;
margin: 0;
padding: 0;
}
div.time-picker li {
padding: 1px;
cursor: pointer;
}
div.time-picker li.selected {
background: #316AC5;
color: #fff;
}

10
formulaires/recherche_ecrire.html

@ -0,0 +1,10 @@
<div class="formulaire_spip formulaire_recherche" id="formulaire_recherche">
<form action="[(#ENV{action})]" method="get"><div>
[(#ENV{action}|form_hidden)]
[<input type="hidden" name="lang" value="(#ENV{lang})" />]
<label for="recherche"><:info_rechercher_02:></label>
<input type="text" class="text" size="10" name="recherche" id="recherche"[ value="(#ENV{recherche})"] accesskey="4" />
<input type='image' src='[(#EVAL{_DIR_IMG_PACK}|concat{loupe.png})]' name='submit' class="image" alt='<:info_rechercher|attribut_html:>' />
[(#ENV{recherche}|oui)<a href='#ENV{action}' title='<:spip_bonux:annuler_recherche|attribut_html:>'>[(#CHEMIN{img_pack/annuler-recherche.png}|tag_img|inserer_attribut{alt,<:spip_bonux:annuler_recherche:>})]</a>]
</div></form>
</div>

31
formulaires/recherche_ecrire.php

@ -0,0 +1,31 @@
<?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;
// chargement des valeurs par defaut des champs du formulaire
function formulaires_recherche_ecrire_charger_dist($lien_filtre = NULL,$lien_arg = NULL){
$lien = $lien_filtre ? $lien_filtre : $lien_arg;
if ($GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
$lang = $GLOBALS['spip_lang'];
else
$lang='';
return
array(
'action' => ($lien ? $lien : generer_url_ecrire('recherche')), # action specifique, ne passe pas par Verifier, ni Traiter
'recherche' => _request('recherche'),
'lang' => $lang
);
}
?>

17
formulaires/selecteur/articles.html

@ -0,0 +1,17 @@
<script type='text/javascript'>var img_unpick='#CHEMIN{img_pack/item-remove.png}';</script>
<script type='text/javascript' src='#CHEMIN{formulaires/selecteur/jquery.picker.js}'></script>
[(#REM) afficher la selection dans un ul class item_picked ----------------------------------------
select=1 => le selecteur se comporte comme un select, avec un seul choix possible
]<ul class='item_picked[ (#ENV{select,''}|?{select})]'>
[(#ENV{rubriques,0}|oui)<INCLURE{fond=formulaires/selecteur/inc-sel-rubriques}{name}{selected}{select}{img_unpick=#CHEMIN{img_pack/item-remove.png}}>]
<INCLURE{fond=formulaires/selecteur/inc-sel-articles}{name}{selected}{select}{img_unpick=#CHEMIN{img_pack/item-remove.png}}>
</ul>
#SET{id_rubrique,#ENV{id_rubrique}}
<BOUCLE_art(ARTICLES){statut?}{tout}{id_article}>#SET{id_rubrique,#ID_RUBRIQUE}</BOUCLE_art>
[(#REM) le container item_picker est ici pour etre voisin de item_picked ------]
<div class='item_picker'>
<INCLURE{fond=formulaires/selecteur/picker-ajax}{id_rubrique=#GET{id_rubrique}}{id_article}{articles=1}{ajax}{env}>
</div>

9
formulaires/selecteur/inc-nav-articles.html

@ -0,0 +1,9 @@
#SET{p,pa_#ID_RUBRIQUE}<B_articles>
[<p class='pagination'>(#PAGINATION)</p>]
<ul>
<BOUCLE_articles(ARTICLES){id_rubrique}{statut?}{pagination 10 #GET{p}}>
<li class='article[ (#EXPOSE)]'><a href='#' onclick="jQuery(this).item_pick('article|#ID_ARTICLE','#ENV{name,id_item}','[(#TITRE*|texte_script|attribut_html)]','article');return false;"
><img class='add' src='#CHEMIN{img_pack/item-add.png}' />#TITRE</a></li>
</BOUCLE_articles>
</ul>
</B_articles>

9
formulaires/selecteur/inc-nav-rubriques.html

@ -0,0 +1,9 @@
#SET{p,pr_#ID_RUBRIQUE}<B_enfants>
[<p class='pagination'>(#PAGINATION)</p>]
<ul class='items'>
<BOUCLE_enfants(RUBRIQUES){id_parent=#ID_RUBRIQUE}{statut?}{pagination 10 #GET{p}}>
<li class='rubrique'>[(#ENV{rubriques,0}|oui)<a href='#' onclick="jQuery(this).item_pick('rubrique|#ID_RUBRIQUE','#ENV{name,id_item}','[(#TITRE*|extraire_multi|texte_script|attribut_html)]','rubrique');return false;"
><img class='add' src='#CHEMIN{img_pack/item-add.png}' /></a>#TITRE]<a class='ajax' href='[(#SELF|parametre_url{id_r,#ID_RUBRIQUE})]'>[#TITRE(#ENV{rubriques,0}|non)]<img class='ouvrir' src='#CHEMIN{img_pack/deplier-droite.png}' /></a></li>
</BOUCLE_enfants>
</ul>
</B_enfants>

3
formulaires/selecteur/inc-sel-articles.html

@ -0,0 +1,3 @@
<BOUCLE_sel(ARTICLES){id_article IN #ENV{selected}|picker_selected{article}}{statut?}{tout}>
<li class='article'><input type="hidden" name="[(#ENV{name,id_item})][]" value="article|#ID_ARTICLE" />#TITRE[(#ENV{select,''}|non)
<a href='#' onclick='jQuery(this).item_unpick();return false;'><img src='#ENV{img_unpick}' /></a>]<span class="sep">, </span></li></BOUCLE_sel>

8
formulaires/selecteur/inc-sel-rubriques.html

@ -0,0 +1,8 @@
<BOUCLE_pour(POUR){tableau #ENV{selected}|picker_selected{rubrique}}>
<BOUCLE_sel(RUBRIQUES){id_rubrique=#VALEUR}{statut?}{tout}>
<li class='rubrique'><input type="hidden" name="[(#ENV{name,id_item})][]" value="rubrique|#ID_RUBRIQUE" />#TITRE[(#ENV{select,''}|non)
<a href='#' onclick='jQuery(this).item_unpick();return false;'><img src='#ENV{img_unpick}' /></a>]<span class="sep">, </span></li></BOUCLE_sel>[
(#VALEUR|=={0}|oui)
<li class='rubrique'><input type="hidden" name="[(#ENV{name,id_item})][(#VAL{91}|chr)][(#VAL{93}|chr)]" value="rubrique|[(#VALEUR)]" /><:info_racine_site:>[(#ENV{select,''}|non)
<a href='#' onclick='jQuery(this).item_unpick();return false;'><img src='[(#ENV{img_unpick})]' /></a>]<span class="sep">, </span></li>
]<//B_sel></BOUCLE_pour>

2255
formulaires/selecteur/jquery-ui-1.6.custom.js
File diff suppressed because it is too large
View File

84
formulaires/selecteur/jquery.picker.js

@ -0,0 +1,84 @@
/**
item_picked et picker doivent seulement etre voisins
<ul class='item_picked'>..</ul>
...
...
<xx class='item_picker'>
<div class='picker_bouton'>..</div>
</xx>
...
**/
jQuery(document).ready(function(){
var picked = jQuery('ul.item_picked');
if (picked.length) {
picked.find('>li').removeClass('last').find('li:last').addClass('last');
}
});
jQuery.fn.picker_toggle = function(){
var browser = jQuery(this).parents('.item_picker').find('.browser');
if (browser.is(':visible')){
if (jQuery.browser.msie)
browser.hide();
else
browser.slideUp();
jQuery('a.close',this).hide();
jQuery('a.edit',this).show();
}
else {
browser.show();
jQuery('a.close',this).show();
jQuery('a.edit',this).hide();
}
}
// stop animation du bloc cible pour faire patienter
jQuery.fn.stopAnimeajax = function(end) {
this.children().css('opacity', 1.0);
this.find('.image_loading').html('');
return this; // don't break the chain
}
jQuery.fn.item_pick = function(id_item,name,title,type){
var picker = this.parents('.item_picker');
var picked = picker.siblings('ul.item_picked');
if (!picked.length) {
picker.before("<ul class='item_picked'></ul>");
picked = picker.siblings('ul.item_picked');
}
var select = picked.is('.select');
if (select)
picked.html('');
else
jQuery('li.on',picked).removeClass('on');
var sel=jQuery('input[value='+id_item+']',picked);
if (sel.length==0){
picked.addClass('changing').animeajax();
// simulons de la latence pour l'oeil de l'utilisateur
setTimeout(function(){
jQuery('li:last',picked).removeClass('last');
picked.append('<li class="last on '+type+'">'
+'<input type="hidden" name="'+name+'[]" value="'+id_item+'"/>'
+ title
+(select?"":" <a href='#' onclick='jQuery(this).item_unpick();return false;'>"
+"<img src='"+img_unpick+"' /></a>"
)
+'<span class="sep">, </span></li>').removeClass('changing').stopAnimeajax();
// masquer le selecteur apres un pick
picker.find('.picker_bouton').picker_toggle();
},300);
}
else
sel.parent().addClass('on');
return this; // don't break the chain
}
jQuery.fn.item_unpick = function(){
var picked = this.parents('ul.item_picked');
var me = this.parent();
jQuery(me).fadeOut('fast');
setTimeout(function(){
me.remove();
picked.find('>li').removeClass('last').find('li:last').addClass('last');
},400);
}

24
formulaires/selecteur/navigateur.html

@ -0,0 +1,24 @@
<BOUCLE_rub(RUBRIQUES){id_rubrique=#ENV{id_r,#ENV{id_rubrique}}}{statut?}>
<div class='chemin'>
<a href='[(#SELF|parametre_url{id_r,0})]' class='ajax'><:info_racine_site:></a>
<BOUCLE_chemin(HIERARCHIE){id_rubrique}> &gt; <a href='[(#SELF|parametre_url{id_r,#ID_RUBRIQUE})]' class='ajax'>#TITRE</a></BOUCLE_chemin> &gt; <strong class='on'>#TITRE</strong>
</div>#SET{n,0}
<B_contenu>
[(#REM) afficher la racine si la profondeur le permer]
[(#GRAND_TOTAL|<{#TOTAL_BOUCLE}|oui)
<div class='frame[ total_(#GRAND_TOTAL|max{#TOTAL_BOUCLE|moins{1}})]frame_0'><h2>[<a(#ENV{rubriques,0}|oui) href='#' onclick="jQuery(this).item_pick('rubrique|0','#ENV{name,id_item}','<:info_racine_site|texte_script|attribut_html:>','rubrique');return false;"
><img class='add' src='#CHEMIN{img_pack/item-add.png}' /></a>]<:info_racine_site:></h2>
[(#INCLURE{fond=formulaires/selecteur/inc-nav-rubriques}{id_rubrique=0}{env})]</div>]
<BOUCLE_contenu(HIERARCHIE){id_rubrique}{tout}{n-4,4}>#SET{n,0}
<div class='frame[ total_(#GRAND_TOTAL|min{#TOTAL_BOUCLE|moins{1}})][ frame_(#COMPTEUR_BOUCLE|moins{#GRAND_TOTAL|plus{1}|max{#TOTAL_BOUCLE}}|plus{#TOTAL_BOUCLE})]'><a
href='[(#SELF|parametre_url{id_r,#_rub:ID_PARENT|?{#_rub:ID_PARENT,racine}})]' class='frame_close ajax'><img src='#CHEMIN{img_pack/frame-close.png}' /></a>
<h2><a class='ajax' href='[(#SELF|parametre_url{id_r,#ID_RUBRIQUE})]'>#TITRE</a></h2>
[(#INCLURE{fond=formulaires/selecteur/inc-nav-rubriques}{id_rubrique}{env})]
[(#ENV{articles,0}|oui) [(#INCLURE{fond=formulaires/selecteur/inc-nav-articles}{id_rubrique}{id_article}{env})] ]
</div>
</BOUCLE_contenu>
</BOUCLE_rub>
<div class='chemin'><strong class='on'><:info_racine_site:></strong></div>
<div class='frame total_0 frame_0'><h2><:info_racine_site:></h2>[(#INCLURE{fond=formulaires/selecteur/inc-nav-rubriques}{id_rubrique=0}{env})]</div>
<//B_rub>

34
formulaires/selecteur/picker-ajax.html

@ -0,0 +1,34 @@
#SET{bouton_modif,#ENV{select,''}|?{bouton_modifier,bouton_ajouter}|_T}
[(#REM) Afficher un bouton ajax Modifier a la premiere fois ----------------------------------------
][(#ENV{picker,''}|non)
<div class='picker_bouton'>&#91;<a href='[(#SELF|parametre_url{picker,1})]' class='ajax'>#GET{bouton_modif}</a>&#93;</div>
]
[(#REM) Afficher un bouton Fermer/Modifier ensuite ----------------------------------------
][(#ENV{picker,''}|oui)
<div class='picker_bouton'>&#91;<a class='close'
href='[(#SELF|parametre_url{picker,0})]'
onclick="jQuery(this).parent().picker_toggle();return false;"
><:spip_bonux:bouton_fermer:></a><a class='edit'
href='[(#SELF|parametre_url{picker,1})]'
onclick="jQuery(this).parent().picker_toggle();return false;"
style='display:none;'>#GET{bouton_modif}</a>&#93;</div>
[(#REM) et enfin le navigateur ------]
<div class='browser'>
<div class="choix choix_rapide">
<label for="picker_id"><:spip_bonux:id_rapide:></label>
<input type="text" value="" id="picker_id" size="10" />
<a href="#"
onclick="jQuery.ajax({'url':'[(#URL_PAGE{ajax_item_pick,rubriques=[(#ENV{rubriques})]&articles=[(#ENV{articles})]&ref=})]'+jQuery('#picker_id').attr('value'),
'success':function(r){
eval('r = '+r); // JSON envoye par ajax_item_pick.html
if (r){
jQuery('#picker_id').item_pick(r.id,'#ENV{name,id_item}',r.titre,r.type);
}
jQuery('#picker_id').attr('value','');
}
});return false;">#GET{bouton_modif}</a>
</div>
<INCLURE{fond=formulaires/selecteur/navigateur}{ajax}{env}>
</div>
]

13
formulaires/selecteur/picker.css

@ -0,0 +1,13 @@
.item_picker .chemin {border-bottom:1px sold #eee;margin:0.5em 0 0.25em;}
.item_picker .frame {border:1px solid #999;width:180px;height:400px;float:left;overflow:auto;}
.item_picker .frame h2 {margin:0;padding:5px;background:#999;}
.item_picker .frame ul {list-style:none;margin:0;padding:0;}
.item_picker .frame ul li {list-style:none;margin:0;padding:2px;padding-left:26px;}
.item_picker .frame ul li.rubrique {background:url(prive/images/rubrique-24.gif) no-repeat top left;}
.item_picker .frame ul li.article {background:url(prive/images/article-24.gif) no-repeat top left;}
.item_picker .frame ul li:hover {background-color:#999;}
.browser .choix_rapide {font-size:0.9em;}
.browser #picker_id {padding:0;margin:0 5px;border:1px solid;}

24
formulaires/selecteur/rubriques.html

@ -0,0 +1,24 @@
<script type='text/javascript'>var img_unpick='#CHEMIN{img_pack/item-remove.png}';</script>
<script type='text/javascript' src='#CHEMIN{formulaires/selecteur/jquery.picker.js}'></script>
[(#REM) afficher la selection dans un ul class item_picked ----------------------------------------
select=1 => le selecteur se comporte comme un select, avec un seul choix possible
]<ul class='item_picked[ (#ENV{select,''}|?{select})]'>
<INCLURE{fond=formulaires/selecteur/inc-sel-rubriques}{name}{selected}{select}{img_unpick=#CHEMIN{img_pack/item-remove.png}}>
</ul>
#SET{id_rubrique,#ENV{id_rubrique}}
<BOUCLE_art(ARTICLES){statut?}{tout}{id_article}>#SET{id_rubrique,#ID_RUBRIQUE}</BOUCLE_art>
[(#REM) le container item_picker est ici pour etre voisin de item_picked ------]
<div class='item_picker'>
<INCLURE{fond=formulaires/selecteur/picker-ajax}{id_rubrique=#GET{id_rubrique}}{id_article}{rubriques=1}{articles=0}{ajax}{env}>
</div>
[(#ENV{sortable,'non'}|=={oui}|oui)
<script type='text/javascript' src='#CHEMIN{formulaires/selecteur/jquery-ui-1.6.custom.js}'></script>
<script type='text/javascript'>
jQuery(function() {
jQuery("ul.item_picked").sortable();
});
</script>
]

BIN
img_pack/annuler-recherche.png

After

Width: 24  |  Height: 20  |  Size: 713 B

BIN
img_pack/article-12.png

After

Width: 12  |  Height: 12  |  Size: 619 B

BIN
img_pack/deplier-droite.gif

After

Width: 16  |  Height: 16  |  Size: 319 B

BIN
img_pack/deplier-droite.png

After

Width: 16  |  Height: 16  |  Size: 480 B

BIN
img_pack/frame-close.png

After

Width: 16  |  Height: 16  |  Size: 443 B

BIN
img_pack/item-add.gif

After

Width: 16  |  Height: 16  |  Size: 571 B

BIN
img_pack/item-add.png

After

Width: 16  |  Height: 16  |  Size: 654 B

BIN
img_pack/item-remove.png

After

Width: 10  |  Height: 10  |  Size: 456 B

BIN
img_pack/logo-bonux.gif

After

Width: 128  |  Height: 66  |  Size: 5.8 KiB

BIN
img_pack/spip-bonux.png

After

Width: 150  |  Height: 158  |  Size: 38 KiB

BIN
img_pack/tri_asc-12.png

After

Width: 12  |  Height: 12  |  Size: 476 B

BIN
img_pack/tri_asc-16.png

After

Width: 16  |  Height: 16  |  Size: 628 B

BIN
img_pack/tri_asc-24.png

After

Width: 24  |  Height: 24  |  Size: 786 B

BIN
img_pack/tri_asc.png

After

Width: 12  |  Height: 12  |  Size: 477 B

BIN
img_pack/tri_desc-12.png

After

Width: 12  |  Height: 12  |  Size: 462 B

BIN
img_pack/tri_desc-16.png

After

Width: 16  |  Height: 16  |  Size: 615 B

BIN
img_pack/tri_desc-24.png

After

Width: 24  |  Height: 24  |  Size: 772 B

184
inc/core21_filtres.php

@ -0,0 +1,184 @@
<?php
/**
* Plugin Spip-Bonux
* Le plugin qui lave plus SPIP que SPIP
* (c) 2008 Mathieu Marcillaud, Cedric Morin, Romy Tetue
* Licence GPL
*
* Fonctions integrees au core en branche 2.1 que l'on rend disponible en branche 2.0.x
*
*/
// s'assurer que les filtres du core sont deja charges
// pour eviter tout risque de conflit
include_spip('inc/filtres');
if (!function_exists('lien_ou_expose')){
/**
* une fonction pour generer des menus avec liens
* ou un <strong class='on'> non clicable lorsque l'item est selectionne
*
* @param string $url
* @param string $libelle
* @param bool $on
* @param string $class
* @param string $title
* @return string
*/
function lien_ou_expose($url,$libelle,$on=false,$class="",$title="",$rel=""){
return
($on ?"<strong class='on'>":
"<a href='$url'"
.($title?" title='".attribut_html($title)."'":'')
.($class?" class='".attribut_html($class)."'":'')
.($rel?" rel='".attribut_html($rel)."'":'')
.">"
)
. $libelle
. ($on ? "</strong>":"</a>");
}
}
if (!function_exists('balise_img')){
/**
* une fonction pour generer une balise img a partir d'un nom de fichier
*
* @param string $img
* @param string $alt
* @param string $class
* @return string
*/
function balise_img($img,$alt="",$class=""){
$taille = taille_image($img);
list($hauteur,$largeur) = $taille;
if (!$hauteur OR !$largeur)
return "";
return
"<img src='$img' width='$largeur' height='$hauteur'"
." alt='".attribut_html($alt)."'"
.($class?" class='".attribut_html($class)."'":'')
.' />';
}
}
if (!function_exists('singulier_ou_pluriel')){
/**
* Afficher un message "un truc"/"N trucs"
*
* @param int $nb
* @return string
*/
function singulier_ou_pluriel($nb,$chaine_un,$chaine_plusieurs,$var='nb'){
if (!$nb=intval($nb)) return "";
if ($nb>1) return _T($chaine_plusieurs, array($var => $nb));
else return _T($chaine_un);
}
}
if (!function_exists('filtre_icone_dist')){
/**
* un filtre icone mappe sur icone_inline, qui cree une icone a gauche par defaut
* le code de icone_inline est grandement reproduit ici car les liens ajax portent simplement une class ajax
* lorsque les interfaces sont en squelette, alors que l'implementation d'ajax de des scripts php
* est plus complexe
*
* @param string $lien
* @param string $texte
* @param string $fond
* @param string $align
* @param string $fonction
* @return string
*/
function filtre_icone_dist($lien, $texte, $fond, $align="", $fonction="", $class=""){
$align = $align?$align:$GLOBALS['spip_lang_left'];
global $spip_display;
if ($fonction == "supprimer.gif") {
$style = 'icone36 danger';
} else {
$style = 'icone36';
if (strlen($fonction) < 3) $fonction = "rien.gif";
}
$style .= " " . substr(basename($fond),0,-4);
if ($spip_display == 1){
$hauteur = 20;
$largeur = 100;
$title = $alt = "";
}
else if ($spip_display == 3){
$hauteur = 30;
$largeur = 30;
$title = "\ntitle=\"$texte\"";
$alt = $texte;
}
else {
$hauteur = 70;
$largeur = 100;
$title = '';
$alt = $texte;
}
$size = 24;
if (preg_match("/-([0-9]{1,3})[.](gif|png)$/i",$fond,$match))
$size = $match[1];
if ($spip_display != 1 AND $spip_display != 4){
if ($fonction != "rien.gif"){
$icone = http_img_pack($fonction, $alt, "$title width='$size' height='$size'\n" .
http_style_background($fond, "no-repeat center center"));
}
else {
$icone = http_img_pack($fond, $alt, "$title width='$size' height='$size'");
}
} else $icone = '';
// cas d'ajax_action_auteur: faut defaire le boulot
// (il faudrait fusionner avec le cas $javascript)
if (preg_match(",^<a\shref='([^']*)'([^>]*)>(.*)</a>$,i",$lien,$r))
list($x,$lien,$atts,$texte)= $r;
else $atts = '';
if ($align && $align!='center') $align = "float: $align; ";
$icone = "<a style='$align' class='$style $class'"
. $atts
. $javascript
. "\nhref='"
. $lien
. "'>"
. $icone
. (($spip_display == 3) ? '' : "<span>$texte</span>")
. "</a>\n";
if ($align <> 'center') return $icone;
$style = " style='text-align:center;'";
return "<div$style>$icone</div>";
}
}
if (!function_exists('filtre_explode_dist')){
/**
* filtre explode pour les squelettes permettant d'ecrire
* #GET{truc}|explode{-}
*
* @param strong $a
* @param string $b
* @return array
*/
function filtre_explode_dist($a,$b){return explode($b,$a);}
}
if (!function_exists('filtre_implode_dist')){
/**
* filtre implode pour les squelettes permettant d'ecrire
* #GET{truc}|implode{-}
*
* @param array $a
* @param string $b
* @return string
*/
function filtre_implode_dist($a,$b){return implode($b,$a);}
}
?>

136
inc/couleurs.php

@ -0,0 +1,136 @@
<?php
/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
* Copyright (c) 2001-2008 *
* 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;
// Appelee sans argument, cette fonction retourne un menu de couleurs
// Avec un argument numerique, elle retourne les parametres d'URL
// pour les feuilles de style calculees (cf commencer_page et svg)
// Avec un argument de type tableau, elle remplace le tableau par defaut
// par celui donne en argument
// http://doc.spip.org/@inc_couleurs_dist
function inc_couleurs_dist($choix=NULL,$ajouter = false)
{
static $couleurs_spip = array(
// Vert de gris
1 => array (
"couleur_foncee" => "#999966",
"couleur_claire" => "#CCCC99",
"couleur_lien" => "#666633",
"couleur_lien_off" => "#999966"
),
// Rose vieux
2 => array (
"couleur_foncee" => "#EB68B3",
"couleur_claire" => "#E4A7C5",
"couleur_lien" => "#8F004D",
"couleur_lien_off" => "#BE6B97"
),
// Orange
3 => array (
"couleur_foncee" => "#fa9a00",
"couleur_claire" => "#ffc000",
"couleur_lien" => "#FF5B00",
"couleur_lien_off" => "#B49280"
),
// Bleu truquoise
4 => array (
"couleur_foncee" => "#5da7c5",