[(#LOGO_SITE_SPIP||image_reduire{150,100}) ]
#NOM_SITE_SPIP
[(#CHEMIN{images/thickbox.png}||image_reduire{150,100})] Thickbox v3
by
Version 3 (stable) - (c) 2009 GNU GPL v3
[ thickbox : <:phpdoc:map:> | <:phpdoc:index:> ]

<:phpdoc:source_file_for:> 'Pipelines'

  <:phpdoc:back_to_doc:> : Pipelines

  1. <?php
  2. /**
  3.  * @name         Pipelines
  4.  * @author         Piero Wbmstr <@link piero.wbmstr@gmail.com>
  5.  * @copyright     CreaDesign 2009 {@link http://creadesignweb.free.fr/}
  6.  * @license        http://opensource.org/licenses/gpl-license.php GNU Public License
  7.  * @version     0.2 (06/2009)
  8.  * @package        thickbox
  9.  *
  10.  *  BASED ON :
  11.  *  - Thickbox 3.1 - One Box To Rule Them All.
  12.  *    By Cody Lindley (http://www.codylindley.com)
  13.  *    Copyright (c) 2007 cody lindley - MIT License
  14.  *
  15.  *  - plugin SPIP 'Thickbox 2'
  16.  *    By Fil, Izo, BoOz (http://spip-zone.info/spip.php?article31)
  17.  */
  18. if (!defined("_ECRIRE_INC_VERSION")) return;
  19.  
  20. function thickbox_insert_head($flux){
  21.     // cette ligne ne charge pas le plugin sans couteau suisse?
  22. //    if(!$GLOBALS["spip_pipeline"]["insert_js"])
  23.     $flux thickbox_header_prive($flux);
  24.     return $flux;
  25. }
  26.  
  27. function thickbox_header_prive($flux{
  28.     include_spip("inc/filtres");
  29.     global $closer$closer_ttl$nexter$previouser$img_close;
  30.     $th_meta thickbox_config();
  31.  
  32.     $img_close sprintf("<img src='%s' width='16px' border=0 />&nbsp;",
  33.         strlen($th_meta['img_closer']url_absolue(find_in_path($th_meta['img_closer'])) url_absolue(find_in_path($GLOBALS['THICKBOX_DEFAULTS']['img_closer'])) )
  34.     );
  35.     $closer texte_backend(_T('thickbox:close'))."&nbsp;".$img_close;
  36.     $closer_ttl texte_backend(_T('thickbox:fermer'));
  37.     $nexter texte_backend(_T('thickbox:previous'));
  38.     $previouser texte_backend(_T('thickbox:next'));
  39.  
  40.     if$th_meta['include_css'== 'oui')
  41.         $flux .= "\n<link rel='stylesheet' href='".url_absolue(find_in_path('css/thickbox.css'))."' type='text/css' media='projection, screen, tv' />";
  42.     $flux .= "\n<script src='".url_absolue(find_in_path('javascript/thickbox-3.1.js'))."' type='text/javascript'></script>"
  43.         ."\n<!--[if lte IE 6]><link rel='stylesheet' href='".url_absolue(find_in_path('css/thickbox_ie6.css'))."' type='text/css' media='projection, screen, tv' /><![endif]-->";
  44.     $flux .=
  45. '
  46. <script type="text/javascript"><!--
  47. //on page load call tb_init
  48. var init_f = function() {
  49.     var tb_pathToImage = "'.url_absolue(find_in_path('images/circle_animation.gif')).'";
  50.     if (jQuery("a.thickbox,a[type=\'image/jpeg\'],a[type=\'image/png\'],a[type=\'image/gif\']",this).size()) {
  51.         jQuery("a[type=\'image/jpeg\'],a[type=\'image/png\'],a[type=\'image/gif\']").addClass("thickbox")';
  52.     if($th_meta['option_onclick'== 'oui'$flux .= '.removeAttr("onClick")';
  53.     $flux .= ';';
  54.     if(strlen($th_meta['titre_default'])) $flux .= 
  55. '
  56.         jQuery("a.thickbox, area.thickbox, input.thickbox").attr("title", function(arr){
  57.             var str = jQuery(this).attr("title");
  58.             if(str.length == 0) return "'.texte_backend($th_meta['titre_default']).'";
  59.             else return str;
  60.         });';
  61.     $flux .=
  62. '
  63.         tb_lang("'.$closer.'", "'.$closer_ttl.'", "'.$nexter.'", "'.$previouser.'");
  64.         tb_init("a.thickbox, area.thickbox, input.thickbox");
  65.         imgLoader = new Image();
  66.         imgLoader.src = tb_pathToImage;
  67.     }
  68. }
  69. if (window.jQuery) jQuery(document).ready(init_f);
  70. // --></script>';
  71.     $flux .= "";
  72.     return $flux;
  73. }
  74.  
  75. // ? verifier l utilisation
  76. function thickbox_insert_js($flux){
  77.     include_spip("inc/filtres");
  78.     if($flux['type']=='inline')
  79.         $flux["data"]["thickbox"=
  80. '
  81. <!-- thick box plugin --><script type="text/javascript"><!--
  82. var init_f = function() {
  83.     var tb_pathToImage = "'.url_absolue(find_in_path('images/circle_animation.gif')).'";
  84.     if ($("a.thickbox,a[type=\'image/jpeg\'],a[type=\'image/png\'],a[type=\'image/gif\']",this).size()) {
  85.         var TB_initload = function(){
  86.             $("a[type=\'image/jpeg\'],a[type=\'image/png\'],a[type=\'image/gif\']").addClass("thickbox");
  87.             tb_init("a.thickbox, area.thickbox, input.thickbox");
  88.             imgLoader = new Image();
  89.             imgLoader.src = tb_pathToImage;
  90.         };
  91.         if (typeof tb_init == "function") {
  92.             TB_initload();
  93.         } else {
  94.             $("head")
  95.             .prepend("<link rel=\'stylesheet\'type=\'text/css\' href=\''.url_absolue(find_in_path('css/thickbox.css')).'\' />");
  96.             $.getScript("'
  97.                 .url_absolue(find_in_path('javas/thickbox-3.1.js'))
  98.                 .'", TB_initload)
  99.         }
  100.     };
  101. }
  102. if(typeof onAjaxLoad == "function") onAjaxLoad(init_f);
  103. $(document).ready(function(){setTimeout(init_f.apply(document),200)});
  104. // --></script>';
  105.     return $flux;
  106. }
  107.  
  108. // ? verifier l utilisation
  109. function thickbox_verifie_js_necessaire($flux{
  110.     $page $flux["page"]["texte"];
  111.     $necessaire preg_match(",<a[^>]+(?:(type)|class)\s*=\s*['\"](?(1)image/(?:jpeg|png|gif)|[^>'\"]*\bthickbox\b[^>'\"]*)['\"],iUs"$page);
  112.     $flux["data"]["thickbox"$necessaire;
  113.     return $flux;
  114. }
  115. ?>

PhpDoc phpDocumentor 1.4.1
| <:phpdoc:date_generation:>
| Mon, 28 Feb 2011 12:54:19 +0100

CreaDesign Crea Design
 | PhpDocumentor plugin pour SPIP
 | version 1.0.09 (c) 08/2009

| SPIP | <:accueil_site:> | <:espace_prive:> | <:phpdoc:accueil_doc:> Thickbox v3 |