<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Renoir Boulanger &#187; Programmation</title>
	<atom:link href="http://renoirboulanger.com/blog/category/programmation/feed/" rel="self" type="application/rss+xml" />
	<link>http://renoirboulanger.com</link>
	<description>Un geek social et Linuxien de nature</description>
	<lastBuildDate>Thu, 08 Sep 2011 18:02:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>L&#8217;appel aux conférenciers pour ConFoo 2011 est lancé!</title>
		<link>http://renoirboulanger.com/blog/2010/09/lappel-aux-conferenciers-pour-confoo-2011-est-lance/</link>
		<comments>http://renoirboulanger.com/blog/2010/09/lappel-aux-conferenciers-pour-confoo-2011-est-lance/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 02:04:11 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Actualites]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[confoo11]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=2380</guid>
		<description><![CDATA[L&#8217;appel aux conférenciers pour ConFoo 2011 est lancé!Depuis cet été j&#8217;ai commencé à m&#8217;impliquer dans l&#8217;organisation de la conférence «ConFoo Web Techno Conference». Je crois que j&#8217;en ai parlé dans ce billet. Il s&#8217;agit d&#8217;un événement annuel pensé pour les programmeurs, les passionnés du web et des logiciels libres.
La semaine passée, nous avons publié officiellement [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2010/09/lappel-aux-conferenciers-pour-confoo-2011-est-lance/' class='retweet '  style='display:block;margin:10px 0px;' >L&#8217;appel aux conférenciers pour ConFoo 2011 est lancé!</a><div id="attachment_2390" class="wp-caption alignright" style="width: 410px"><a href="http://renoirboulanger.com/wp-content/uploads/2010/09/4463325427_251399c227.jpg" rel="lightbox[2380]"><img class="size-full wp-image-2390" style="border: none;" title="Passe ConFoo 2010" src="http://renoirboulanger.com/wp-content/uploads/2010/09/4463325427_251399c227.jpg" alt="Passe ConFoo 2010" width="400" height="266" /></a><p class="wp-caption-text">Photo prise sur Flickr par Pyxis technologies</p></div>
<p><a href="http://renoirboulanger.com/wp-content/uploads/2010/05/Codefest.jpg" rel="lightbox[2380]"></a>Depuis cet été j&#8217;ai commencé à m&#8217;impliquer dans l&#8217;organisation de la conférence «<a href="http://confoo.ca/">ConFoo Web Techno Conference</a>». Je crois que <a href="http://renoirboulanger.com/blog/2010/09/lancement-de-lannee-2011-pour-la-conference-confoo/">j&#8217;en ai parlé dans ce billet</a>. Il s&#8217;agit d&#8217;un événement annuel pensé pour les programmeurs, les passionnés du web et des logiciels libres.</p>
<p>La semaine passée, nous avons publié officiellement l&#8217;appel aux conférenciers. C&#8217;est la première annonce grand public du début de la programmation 2011. Jusqu&#8217;au 26 Novembre 2010, nous acceptons les propositions de présentations.</p>
<p>La procédure est simple, il faut proposer sa présentation par le <a href="http://bit.ly/b3pX8P">formulaire &#8220;appel aux conférenciers&#8221;</a> sur le site officiel.</p>
<p>La date et le lieux de la conférence sont maintenant officielles et se déroulera à l&#8217;Hôtel<br />
<a href="http://confoo.ca/fr/hotel">Hilton Bonaventure de Montreal</a> du 9 au 11 Mars 2011. Durant cette semaine il y aura aussi des journées de formation privés.</p>
<h3>Ma participation</h3>
<p>Pour moi ce sera ma première année dans l&#8217;équipe d&#8217;organisation de cet événement d&#8217;envergure. Je pense que ça tombe dans le sens de m&#8217;y impliquer car lorsque j&#8217;ai démissionné de l&#8217;animation des scouts j&#8217;ai décidé de pousser dans des loisirs qui sont plus près de ma carrière mais qui demanderont d&#8217;autres talents que ceux de faire de l&#8217;Intégration ou de la programmation.</p>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2010/09/lappel-aux-conferenciers-pour-confoo-2011-est-lance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bug trouvé et corrigé sur un thème WordPress rtTheme</title>
		<link>http://renoirboulanger.com/blog/2010/07/bug-trouve-et-corrige-sur-un-theme-wordpress-rttheme/</link>
		<comments>http://renoirboulanger.com/blog/2010/07/bug-trouve-et-corrige-sur-un-theme-wordpress-rttheme/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 20:21:19 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Debug]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=2217</guid>
		<description><![CDATA[Bug trouvé et corrigé sur un thème WordPress rtThemeDepuis que nous avons fondé EVOCATIO Solutions technologiques nous avons pris une position d&#8217;experts dans le domaine des acrobaties techniques. C&#8217;est ce qu&#8217;on faisait dans nos journées de tout les jours avant.
Ce que j&#8217;avait pas pensé c&#8217;est que je trouverait de la demande pour des tâches pointues [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2010/07/bug-trouve-et-corrige-sur-un-theme-wordpress-rttheme/' class='retweet '  style='display:block;margin:10px 0px;' >Bug trouvé et corrigé sur un thème WordPress rtTheme</a><p>Depuis que nous avons fondé <a href="http://evo.cat.io/">EVOCATIO Solutions technologiques</a> nous avons pris une position d&#8217;experts dans le domaine des acrobaties techniques. C&#8217;est ce qu&#8217;on faisait dans nos journées de tout les jours <em>avant</em>.</p>
<p>Ce que j&#8217;avait pas pensé c&#8217;est que je trouverait de la demande pour des tâches pointues et qu&#8217;on devait  «faire marcher». L&#8217;une d&#8217;elles a été fait, justement, pour un ami que je respecte beaucoup: <a href="http://geoffroigaron.com/">Geoffroi Garon</a>.</p>
<p>Avec sa permission je publie ici comment j&#8217;ai réglé un petit bug Javascript. Rien d&#8217;extraordinaire mais quand même bête lorsqu&#8217;on s&#8217;attend a ce que de quoi fonctionne qu&#8217;on a acheté et qu&#8217;il ne fonctionne pas. <ins>Finalement, tout juste avant de publier ce billet, j&#8217;ai réalisé que, l&#8217;auteur (<a href="http://twitter.com/ftolgacan">@ftolgacan</a>) a réparé le code. Comme quoi j&#8217;ai pris trop de temps avant de le publier.</ins></p>
<p>Il s&#8217;agit d&#8217;un thème adapté qui a été acheté sur <a href="http://themeforest.net/">ThemeForest</a> pour un site fait en <a href="http://www.wordpress.org">WordPress</a>. Étant donné que le thème fourni n&#8217;a pas vraiment d&#8217;endroit ou proposer les correctifs j&#8217;ai décidé de publier sur mon blogue.</p>
<p>Je contribue en français mais ferai une courte explication de ma correction en anglais sur l&#8217;<a href="http://themeforest.net/item/rttheme-6-bussiness-theme-5-in-1-for-wordpress/83648">item précis sur le site officiel</a>.</p>
<div>Pour voir le démo du thème, allez dans la section &#8220;Preview&#8221; puis dans la section &#8220;products&#8221; du site qui est illustré.</div>
</p>
<p><span id="more-2217"></span></p>
<h3>Explication du problème</h3>
<p>Lorsqu&#8217;on achète un thème on s&#8217;attend a ce que tout fonctionne&#8230; même avec les choses qu&#8217;on peut configurer dans le paneau d&#8217;administration. D&#8217;un point de vue fonctionnel&#8230; ça fait du sens.</p>
<p>Dans le cas ici ce n&#8217;était PAS le cas.</p>
<p><img class="alignright size-medium wp-image-2268" title="Les «Tabs» illustrant un produit provenant d'une liste" src="http://renoirboulanger.com/wp-content/uploads/2010/07/mathetmots_tabs-300x141.png" alt="Les «Tabs» illustrant un produit provenant d'une liste" width="300" height="141" /> Le problème était le suivant. Une fois avoir modifié une liste d&#8217;items dans le catalogue utilisant le panneau de contrôle de WordPress. Un mini javascript permettant d&#8217;avoir une liste avec Tabs (a droite).</p>
<p>Mais les autres «tab» ne fonctionnaient pas et on ne comprenait pas pourquoi.</p>
<p>C&#8217;est là que j&#8217;ai intervenu.</p>
<h3>Explication de la problématique</h3>
<p>Le problème consistait a la génération des attributs id=&#8221;" une liste UL avec un thème et où le thème allait chercher ses valeurs du <em>id</em>. Ci-bas on voit comment Firebug voit le code généré.</p>
<p><center><div id="attachment_2267" class="wp-caption aligncenter" style="width: 490px"><img class="size-full wp-image-2267 " title="Markup HTML débug avec Firebug" src="http://renoirboulanger.com/wp-content/uploads/2010/07/mathetmots_bug_markup.png" alt="Les deux listes avec les ID générés" width="480" height="211" /><p class="wp-caption-text">Les elements de la liste (LI) avec l&#39;attribut id (exemple: id=&quot;technical_details&quot;) est générée à partir d&#39;une variable qui utilise le input d&#39;un usager (dans le panneau de contrôle WordPress) qui n&#39;a aucune idée de l&#39;incidence possible de son entrée (espaces, accents, etc).</p></div></center></p>
<p>Cet exemple de code (ci-haut) est fonctionnel. Mais dans le cas du client, les <tt>&lt;div id="" /&gt;</tt>  de la liste <tt>&lt;div id="content" /&gt;</tt> avaient des noms qui provenaient du <strong>nom</strong> de l&#8217;item (je ne peut illustrer où ils prenaient la valeur&#8230; je n&#8217;ai plus accès pour faire une capture d&#8217;écran).</p>
<h3>La solution au problème</h3>
<p>Au lieu d&#8217;utiliser un input de l&#8217;usager comme id d&#8217;une liste. Utiliser le fait qu&#8217;on sait que le <tt>&lt;div <strong>id="tabs"</strong> /&gt;</tt> a deux <em>enfants</em>&#8230; <tt>&lt;div <strong>class="product_tabs" /&gt;</strong></tt> (avec une liste ordonnée&#8230; pour les boutons qui seront transformés en «tab») et <tt>&lt;div <strong>id="content" /&gt;</strong></tt> (qui a une liste dans le même ordre que &#8220;product_tabs&#8221;). J&#8217;ai donc utilisé ce concept.</p>
<h3>Le code</h3>
<p>Comme c&#8217;est étrange. J&#8217;ai écrit ce billet que j&#8217;ai commencé en Mai lorsque j&#8217;ai eu a faire le petit travail. Depuis le temps, le développeur a réglé le problème. Ce que vous voyez de commenté (précédé par <tt>//</tt> et en vert) dans &#8220;Le code original&#8221; est ce qui était utilisé en <a href="http://jquery.com">jQuery</a>.</p>
<p>J&#8217;ai donc trop pris de temps avant de publier ma solution <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>Le code original</h4>
<p>Près de la <strong>ligne 107</strong> dans <a href="http://www.mathetmots.com/wp-content/themes/rttheme6/js/script.js">ce fichier</a>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//product tabs</span>
	$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> tabs<span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs ul li&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs #content&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003366; font-weight: bold;">var</span> kids <span style="color: #339933;">=</span> content.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			kids.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;style&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;display:none;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs #content div:first&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;style&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;display:block;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			tabs.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span>
				<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">//					var show=$(this).attr(&quot;title&quot;);</span>
					<span style="color: #003366; font-weight: bold;">var</span> show<span style="color: #339933;">=</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs ul li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">index</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
					<span style="color: #006600; font-style: italic;">//change clicked tab class</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs ul li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;active&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;active&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #006600; font-style: italic;">//view clicked tab content</span>
					kids.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;style&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;display:none;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					content.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
						content.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//						$(&quot;#&quot;+show+&quot;&quot;).attr(&quot;style&quot;,&quot;display:block;&quot;);</span>
						$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs #content div:eq(&quot;</span><span style="color: #339933;">+</span>show<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;style&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;display:block;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						content.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Le code tel qu&#8217;il est aujourd&#8217;hui a la <strong>ligne 10</strong> et <strong>ligne 21</strong> (qui est commenté mais qui n&#8217;était pas comme ça avant) illustre qu&#8217;il utilisait l&#8217;attribut <strong>title</strong>.</p>
<h4>Le code remplacé par</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//product tabs</span>
	$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> tabs<span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs ul li&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs #content&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003366; font-weight: bold;">var</span> kids <span style="color: #339933;">=</span> content.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			kids.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;style&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;display:none;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs #content div:first&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;style&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;display:block;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			tabs.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span>
				<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
					<span style="color: #003366; font-weight: bold;">var</span> show<span style="color: #339933;">=</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs ul li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">index</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
					<span style="color: #006600; font-style: italic;">//change clicked tab class</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs ul li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;active&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;active&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #006600; font-style: italic;">//view clicked tab content</span>
					kids.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;style&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;display:none;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					content.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
						content.<span style="color: #660066;">slideUp</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tabs #content div:eq(&quot;</span><span style="color: #339933;">+</span>show<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;style&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;display:block;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						content.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Ici c&#8217;est le code que j&#8217;avait donné a <a href="http://www.geoffroigaron.com">Geoffroi</a> le 31 mai dernier. </p>
<h3>Finalement</h3>
<p>J&#8217;ai pris trop de temps pour publier mon billet de solution et il a été corrigé. Tant mieux!</p>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2010/07/bug-trouve-et-corrige-sur-un-theme-wordpress-rttheme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugin MODx pour générer automatiquement les balises ABBR et autres pour chaque page</title>
		<link>http://renoirboulanger.com/blog/2010/02/plugin-modx-pour-generer-automatiquement-les-balises-abbr-et-autres-pour-chaque-page/</link>
		<comments>http://renoirboulanger.com/blog/2010/02/plugin-modx-pour-generer-automatiquement-les-balises-abbr-et-autres-pour-chaque-page/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 14:49:14 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Accessibilité]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[modx]]></category>
		<category><![CDATA[p52]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=1850</guid>
		<description><![CDATA[Plugin MODx pour générer automatiquement les balises ABBR et autres pour chaque page
Il s&#8217;agit d&#8217;un plugin que j&#8217;ai fait, en PHP 4 il y a deux ans pour MODx 0.9.6.3, pour un site web et je pense qu&#8217;il vaut la peine que je partage le code avec la communauté.
Le plugin sert a entourer des mots [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2010/02/plugin-modx-pour-generer-automatiquement-les-balises-abbr-et-autres-pour-chaque-page/' class='retweet '  style='display:block;margin:10px 0px;' >Plugin MODx pour générer automatiquement les balises ABBR et autres pour chaque page</a><div style="width:230px;float:right;"><img src="http://renoirboulanger.com/wp-content/uploads/2010/01/modx_logo.png" alt="" title="MODx" width="230" height="64" style="border:none;float:right;margin-top:10px;margin-right:10px;" /></div>
<p>Il s&#8217;agit d&#8217;un plugin que j&#8217;ai fait, en <abbr title="PHP Hypertext Pre-Processor Languagte version 4." lang="en">PHP 4</abbr> il y a deux ans pour <a href="http://modxcms.com/download/">MODx 0.9.6.3</a>, pour un site web et je pense qu&#8217;il vaut la peine que je partage le code avec la communauté.</p>
<p>Le plugin sert a entourer des mots définis dans un fichier <abbr title="Coma Separated Values." lang="en">CSV</abbr> (séparé par des virgules) dans le contenu qui est retourné par le CMS. </p>
<p>&nbsp;</p>
<h3>LA SITUATION</h3>
<p>Lorsque je travaillait sur ce site web, mon employeur et mon collègue nous étions donné comme objectif de paufiner l&#8217;<a href="http://www.google.ca/search?hl=fr&#038;safe=off&#038;client=firefox-a&#038;rls=org.mozilla:en-US:official&#038;hs=8Lp&#038;defl=fr&#038;q=define:Ergonomie&#038;ei=6PF0S7SiDcH08QbV2tnzCQ&#038;sa=X&#038;oi=glossary_definition&#038;ct=title&#038;ved=0CAcQkAE">Ergonomie</a> et l&#8217;<a href="http://www.google.ca/search?hl=fr&#038;safe=off&#038;client=firefox-a&#038;rls=org.mozilla:en-US:official&#038;hs=GhU&#038;defl=fr&#038;q=define:Accessibilit%C3%A9&#038;ei=A_J0S6LQBNDj8QaLp6z0CQ&#038;sa=X&#038;oi=glossary_definition&#038;ct=title&#038;ved=0CAcQkAE">Accessibilité</a> du contenu. Ce qui est dommage c&#8217;est qu&#8217;il n&#8217;a jamais été évalué par <a href="http://www.accessibiliteweb.com/">AccessibilitéWeb</a>. J&#8217;ai pourtant reçu la formation pour évaluer les sites&#8230; mais je préfère, personnellement, programmer des applications.</p>
<p>&nbsp;</p>
<p><span id="more-1850"></span></p>
<h3>LES CRITÈRES QUE CE PLUGIN REMPLIT</h3>
<p>Lors de la réalisation du site je n&#8217;ai pas noté les points d&#8217;évaluation du <abbr title="Web Content Accessibility Guidelines version 1." lang="en">WCAG 1.0</abbr> que cet utilitaire remplit, mais en gros, d&#8217;un point de vue <em>utilisabilité</em> :</p>
<ul>
<li>L&#8217;édimestre n&#8217;a pas a écrire à la main les balises ABBR, DFN, et ACRONYM, le plugin le fait tout seul;</li>
<li>La liste est dans un fichier statique, ce qui rend facile, pour l&#8217;édimestre, d&#8217;ajouter de nouvelles définitions;</li>
<li>Pouvoir automatiser le remplacement des abréviations dans des balises valides;</li>
</ul>
<p>Cette liste ne parle pas des critères d&#8217;évaluations mais si vous voulez en savoir plus au sujet de l&#8217;Accessibilité; je vous recommande chaudement de visiter la «<a href="http://accessibiliteweb.org/bdc/directives/documents-reference/">Base de conaissances</a>» de la fondation <a href="http://accessibiliteweb.org/">AccessibilitéWeb.org</a> qui a fait un IMMENSE EFFORT de vulgariation et de collaboration a l&#8217;élaboration du <abbr title="Web Content Accessibility Guidelines version 2." lang="en">WCAG 2.0</abbr> et de sa version française.</p>
<p>&nbsp;</p>
<h3>EXEMPLE</h3>
<p>Plutôt que d&#8217;écrire des paragraphes pour expliquer comment fonctionne le plugin, je vous propose de voir par un exemple</p>
<p>Le document <tt><abbr title="Coma Separated Values." lang="en">CSV</abbr></tt> a plusieurs lignes similaires à&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">fr;dfn;FAQ;Foire Aux Questions</pre></td></tr></table></div>

<p>Avec le contenu de la page il remplacera les occurences dans le document HTML généré (même après la cache):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">(...) venez lire &lt;strong&gt;la FAQ&lt;/strong&gt; (...)</pre></td></tr></table></div>

<p>En le transformant ainsi&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">(...) venez lire &lt;strong&gt;la &lt;dfn title=&quot;Foire Aux Questions&quot;&gt;FAQ&lt;/dfn&gt;&lt;/strong&gt; (...)</pre></td></tr></table></div>

<p>Le plugin est configuré pour faire cette transformation pour tout les mots définis dans le CSV au moment du rendu de la page chez le client (trigger MODx &#8220;<tt>OnWebPagePrerender</tt>&#8220;) ce qui évite d&#8217;avoir des définitions empilés.</p>
<p>&nbsp;</p>
<h3>UTILISER LE PLUGIN</h3>
<div style="background-color:#FFEEEE;border:1px solid #666600;color:#660000;margin:20px;padding:20px 30px;text-align:center;">
<h4>Avertissement!<br />
</h4>
<p>Le plugin a été fait à l&#8217;époque de <a href="http://modxcms.com/download/">MODx 0.9.6.x</a> (regardez tout au bas). Il risque de bien fonctionner dans cette version mais n&#8217;est pas assuré de fonctionner dans la version stable présente. Vous aurez été avertis!</p>
<p>Si vous voulez que j&#8217;en fasse une adaptation, <a href="http://renoirboulanger.com/2010/02/plugin-modx-pour-generer-automatiquement-les-balises-abbr-et-autres-pour-chaque-page/#vote"><strong>laissez une note a ce billet</strong></a>!.</p>
</div>
<p>On ne peut s&#8217;attendre à simplement installer le plugin et que tout fonctionne. Voici les prérequis pour pouvoir utiliser le plugin</p>
<ul>
<li>Au niveau 0 (enfant de la racine dans MODx) il y ait un répertoire servant à spécifier la langue de ses enfants.</li>
<li><a href="http://renoirboulanger.com/wp-content/uploads/2010/02/ContentAbbrGenerator/ContentAbbrGenerator.txt"><strong>ContentAbbrGenerator</strong></a> (le plugin en question)<br />
Un plugin de base qui était fourni avec la version 0.9.6.x qui fournit le numéro ID de la page parent absolu</li>
<li>Il faut 2 Snippet de code (fonctions PHP spécifique a MODx) pour utiliser mon plugin
<ul>
<li><a href="http://renoirboulanger.com/wp-content/uploads/2010/02/ContentAbbrGenerator/Lang.txt">Lang</a><br />
Sert, justement a aller chercher le ID de la page ci-haut mentionnée.</li>
<li><a href="http://renoirboulanger.com/wp-content/uploads/2010/02/ContentAbbrGenerator/UltimateParent.txt">UltimateParent</a><br />
Un plugin de base qui était fourni avec la version 0.9.6.x qui fournit le numéro ID de la page parent absolu</li>
</ul>
</li>
<li><a href="http://renoirboulanger.com/wp-content/uploads/2010/02/ContentAbbrGenerator/abbreviations.txt">abbreviations.txt</a><br />
Le fichier CSV qui contient les valeurs pour le remplacement des balises. Le contenu de ce fichier peut être une page dans MODx (si <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html">mod_rewrite</a> est activé) mais il doit être définitivement être disponible à l&#8217;adresse fournie dans le Snippet <a href="http://renoirboulanger.com/wp-content/uploads/2010/02/ContentAbbrGenerator/ContentAbbrGenerator.txt">ContentAbbrGenerator</a> définie par la variable de plugin &#8220;<tt>cagPluginAttrOverrideFileLoc</tt>&#8220;</li>
</ul>
<p>&nbsp;</p>
<h3>TÉLÉCHARGER ET INSTALLER</h3>
<p>Suivre les instructions dans chaque fichier de l&#8217;<strong><a href="http://renoirboulanger.com/wp-content/uploads/2010/02/ContentAbbrGenerator.tar.gz">Archive</a></strong></p>
<p>&nbsp;</p>
<h3>SOURCES ET  <em>CRÉDITS</em></h3>
<p>J&#8217;ai pris soin dans le code de laisser les notes des auteurs qui m&#8217;ont inspiré avec les pages qui parlent de ce que j&#8217;ai utilisé pour produire le plugin. Je n&#8217;ai rien inventé en soi, j&#8217;ai simplement produit un plugin pour remplir le besoin que j&#8217;avait</p>
<p>&nbsp;</p>
<h3>NOTE</h3>
<p>Vous avez le droit et la liberté d&#8217;utiliser le code que je rend disponible pour téléchargement car je n&#8217;ai pas mise sous licence. Considérez-le comme un don</p>
<p>&nbsp;</p>
<h3><a name="vote"></a>A VOS COMMENTAIRES&#8230;</h3>
<p>J&#8217;ai déjà considéré commencer a modifier ce plugin pour le rendre fonctionnel dans WordPress mais j&#8217;ai d&#8217;autres priorités. Alors, si vous avez un intérêt à ce que je produise un plugin pour WordPress ou MODx (pour la version courrante) laissez moi un commentaire!</p>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2010/02/plugin-modx-pour-generer-automatiquement-les-balises-abbr-et-autres-pour-chaque-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script bash pour transférer une base de donnée MySQL d&#8217;un serveur à l&#8217;autre</title>
		<link>http://renoirboulanger.com/blog/2010/02/script-bash-pour-transferer-une-base-de-donnee-mysql-dun-serveur-a-lautre/</link>
		<comments>http://renoirboulanger.com/blog/2010/02/script-bash-pour-transferer-une-base-de-donnee-mysql-dun-serveur-a-lautre/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 21:39:42 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[GeekNight]]></category>
		<category><![CDATA[Open-Source]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Tranche de vie]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=1764</guid>
		<description><![CDATA[Script bash pour transférer une base de donnée MySQL d&#8217;un serveur à l&#8217;autreJe travaillait sur un mandat récemment pour transférer plusieurs dizaines de sites web vers une nouvelle infrastructure. Dans ce billet j&#8217;expliquerai le processus que j&#8217;ai utilisé pour en finir par produire un script bash qui pourrait vous être utile.
&#160;
A propos du projet
Considérant que [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2010/02/script-bash-pour-transferer-une-base-de-donnee-mysql-dun-serveur-a-lautre/' class='retweet '  style='display:block;margin:10px 0px;' >Script bash pour transférer une base de donnée MySQL d&#8217;un serveur à l&#8217;autre</a><p>Je travaillait sur un mandat récemment pour transférer plusieurs dizaines de sites web vers une nouvelle infrastructure. Dans ce billet j&#8217;expliquerai le processus que j&#8217;ai utilisé pour en finir par produire un script bash qui pourrait vous être utile.</p>
<p>&nbsp;</p>
<h3>A propos du projet</h3>
<p>Considérant que certains sites avaient plus d&#8217;une base de donnée il était hors de question de faire a bras les lignes <em>mysqldump</em>, <em>ssh</em> (en fait le transfert se fait en compressant le fichier et le copiant via une redirection gzip avec cat), <em>mysql</em> pour, en ordre, dumper la base de donnée, la transférer, et la restaurer&#8230;. sans oublier les <em>create users</em> pour chaque.</p>
<p>Je me suis dit: <em>faisons-en un script</em>!</p>
<p>&nbsp;</p>
<p><span id="more-1764"></span></p>
<h3>Les prérequis</h3>
<p>Nous voulions&#8230;</p>
<ul>
<li>Faciliter le travail car on savait qu&#8217;il faudrait souvent r<em>e-re-transférer</em> chacune des bases de données;<br />
         Car nous devions faire fonctionner le site sur le nouveau serveur <em>avant</em> de transférer les DNS.</li>
<li>Entrer une commande <em>minimale</em> et en conserver les configurations;</li>
<li>Que le <em>nouveau</em> serveur réalise la tâche a lui-seul, sans prérequis sur le serveur distant;</li>
<li>Utiliser les commandes minimales et pouvoir réutiliser le scripts dans ma propre librairie de script bash;</li>
<li>Éviter de répéter, parceque c&#8217;est «<em>con</em>» <img src='http://renoirboulanger.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
</ul>
<p>&nbsp;</p>
<h3>Ce que le script fait</h3>
<h4>1. <em>Transférer</em> la base de donnée</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ migratemysql transfer</pre></td></tr></table></div>

<ol>
<li>Lire le fichier de configuration <em>migratemysql.conf </em> dans le dossier courrant (ou en créer un)</li>
<li>Se connecter en SSH</li>
<li>Lancer <tt>mysqldump</tt> en conservant le <tt>tmp</tt> paramétrable (éviter de remplir le disque)</li>
<li>Compresser le <tt>.sql</tt> en <em>gzip</em> (<tt>.sql.gz</tt>)</li>
<li>Transférer via <tt>scp</tt></li>
</ol>
<p>&nbsp;</p>
<h4>2. <em>Import</em>er dans le serveur local</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ migratemysql import</pre></td></tr></table></div>

<ol>
<li>Lire le fichier de configuration<em> migratemysql.conf </em>dans le dossier courrant</li>
<li>Véfirier si le <tt>.sql.gz</tt> existe&#8230;<br />
<!--   -----  --></p>
<ol>
<li>oui: le décompresser
<ol>
<li>si le <tt>.sql</tt><em> existe déja</em>, écrire par dessus?  (<strong>attente d&#8217;une réponse a l&#8217;usager</strong>)
<ol>
<li>oui: overwrite, continuer&#8230;</li>
<li>non: DIE!</li>
</ol>
<ol>
            </ol>
</li>
</ol>
</li>
<li>non: continuer</li>
</ol>
</li>
<li>Véfirier si le <tt>.sql</tt> existe&#8230;
<ol>
<li>oui: continuer</li>
<li>non: DIE!</li>
</ol>
</li>
<p><!--   -----  --></p>
<li>Se connecter au serveur précisé, si erreur&#8230; DIE!</li>
<li>Véfirier si la <em>database</em> existe sur le serveur
<ol>
<li>oui&#8230;
<ol>
<li><em>Retenir</em> de ne pas <em>effacer</em> le compte de base de donnée (PRIVILEGES) (variable &#8220;<tt>OVERRIDEUSERCREATION</tt>&#8220;)</li>
<li>Effacer pour ré-insérer? (<strong>attente d&#8217;une réponse a l&#8217;usager</strong>)</li>
<li>Créer les drop statements? (oui ou non&#8230; une switch &#8220;<tt>ALT_PURGE</tt>&#8221; dans le fichier de config)
<ol>
<li>oui: générer le script, puis <em>continuer</em></li>
<li>non: <em>continuer</em> (utile si le fichier SQL a les <tt>DROP</tt> statements)</li>
</ol>
</li>
</ol>
</li>
<li>non: <em>continuer</em>&#8230;</li>
</ol>
</li>
<li>(si &#8220;<tt>OVERRIDEUSERCREATION</tt>&#8221; existe, ne pas faire) Créer les PRIVILEGES spécifique pour la table a créer</li>
<li>Exécuter le <tt>.sql</tt></li>
<li>Afficher a l&#8217;écran un snippet de code PHP pour le fichier de config (format WordPress)</li>
</ol>
<p>&nbsp;</p>
<h3>Le script</h3>
<p>Pour <a href="http://renoirboulanger.com/wp-content/uploads/scripts/migratemysql.gz">le télécharger</a></p>
<h4>Installer</h4>
<ol>
<li>Télécharger

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">renoirb<span style="color: #000000; font-weight: bold;">@</span>ubuntu:~$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>renoirboulanger.com<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>uploads<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>migratemysql.gz</pre></td></tr></table></div>

</li>
<li>Extraire

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">renoirb<span style="color: #000000; font-weight: bold;">@</span>ubuntu:~$ <span style="color: #c20cb9; font-weight: bold;">gunzip</span> migratemysql.gz</pre></td></tr></table></div>

</li>
<li>Déplacer dans un dossier du <tt>PATH</tt>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">renoirb<span style="color: #000000; font-weight: bold;">@</span>ubuntu:~$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$PATH</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>games:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>renoirb<span style="color: #000000; font-weight: bold;">/</span>scripts:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>renoirb<span style="color: #000000; font-weight: bold;">/</span>scripts</pre></td></tr></table></div>

<p>      <strong>Note</strong> Personnellement, j&#8217;ai mon propre dossier scripts dans mon home, mais c&#8217;est à vous de voir
  </li>
</ol>
<p>&nbsp;</p>
<h3>Sources</h3>
<p>Le script a été fait en collaboration avec <a href="http://etiennelachance.com">Etienne Lachance</a> qui est nettement plus rapide que moi dans le scripting BASH</p>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2010/02/script-bash-pour-transferer-une-base-de-donnee-mysql-dun-serveur-a-lautre/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Réalisation d&#8217;une application d&#8217;échange de cadeau avec RED L&#8217;agence le «club échangiste» [2009]</title>
		<link>http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/</link>
		<comments>http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 18:11:24 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Outils]]></category>
		<category><![CDATA[p52]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=1772</guid>
		<description><![CDATA[Réalisation d&#8217;une application d&#8217;échange de cadeau avec RED L&#8217;agence le «club échangiste» [2009]

Il s&#8217;agit d&#8217;une réalisation que j&#8217;ai effectuée en deux semaines pour RED  L&#8217;agence. L&#8217;idée vient de François Sauvé lors d&#8217;une  rencontre pour un autre projet. Il m&#8217;a dit: «J&#8217;ai une idée de fou. Je ne  sais pas si on pourrait [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/' class='retweet '  style='display:block;margin:10px 0px;' >Réalisation d&#8217;une application d&#8217;échange de cadeau avec RED L&#8217;agence le «club échangiste» [2009]</a><p>
<div style="float:right"><img src="http://renoirboulanger.com/wp-content/uploads/2010/02/echangistes_mini.png" alt="" title="RED propose de finir l'année dans un Club échangiste" width="413" height="343" class="aligncenter size-full wp-image-1777" /></div>
<p>Il s&#8217;agit d&#8217;une réalisation que j&#8217;ai effectuée en deux semaines pour <a href="http://www.agencered.ca/">RED  L&#8217;agence</a>. L&#8217;idée vient de François Sauvé lors d&#8217;une  rencontre pour un autre projet. Il m&#8217;a dit: «J&#8217;ai une idée de fou. Je ne  sais pas si on pourrait faire ça rapidement mais&#8230;».</p>
<p>C&#8217;est le  genre de situation que j&#8217;aime!  Une question, la possibilité de me laisser aller, et hop!</p>
<p><a href="http://www.agencered.ca/">RED</a> voulait faire offrir un cadeau à chacun de ses clients privilégiés d&#8217;une façon hors de l&#8217;ordinaire. Les participants étaient invités a visionner leur cadeau par une petite carte de noël reçue par la poste (<a rel="lightbox[1772]" title="Carte postale invitation devant" href="http://renoirboulanger.com/wp-content/uploads/2010/02/carte_postale_1_front.jpg" rel="lightbox[1772]">devant</a>, <a rel="lightbox[1772]" title="Carte postale invitation, dos" href="http://renoirboulanger.com/wp-content/uploads/2010/02/carte_postale_1_back.jpg" rel="lightbox[1772]">dos</a>) avec une <a href="http://echangiste.agencered.ca/">adresse web</a> et un code.</p>
<p>Le concept graphique était, selon moi, bien rendu. Un club échangiste avec les lumières tamisés, rien d&#8217;offensant mais tellement bien choisi pour le jeu.</p>
<p>Le site web devait permettre aux participants de voir leur cadeau et de pouvoir «Participer au club échangiste» en volant le cadeau d&#8217;un autre participant. Chaque participant qui se faisait voler son cadeau reçevait un courriel qui lui annonçait qu&#8217;il s&#8217;était fait voler et qu&#8217;il pouvait aller le récupérer.</p>
<p><span id="more-1772"></span></p>
<p>Les échanges pouvaient avoir lieu jusqu&#8217;au 16 décembre 2009 à 23:59:59. Ensuite une page affichait pour dire que l&#8217;échange était terminé.</p>
<p>Le lendemain même, <a href="http://www.agencered.ca/">RED</a> a préparé tout les cadeaux et les a envoyés avec une petite carte postale (<a rel="lightbox[1772]" title="Carte postale avec cadeau, devant" href="http://renoirboulanger.com/wp-content/uploads/2010/02/carte_postale_2_front.jpg" rel="lightbox[1772]">devant, </a><a rel="lightbox[1772]" title="Carte postale avec cadeau, dos" href="http://renoirboulanger.com/wp-content/uploads/2010/02/carte_postale_2_back.jpg" rel="lightbox[1772]">dos</a>) et partait les cadeaux de chaque récipiendaire vers leur résidence.</p>
<p>&nbsp;</p>
<h3>PARTAGE DES TÂCHES</h3>
<p>Je n&#8217;ai, évidemment, pas tout fait ça tout seul. En gros, je me suis occupé de l&#8217;application tandis que RED a fait tout le reste.</p>
<h4><a href="http://www.agencered.ca/">RED L&#8217;agence</a></h4>
<p><a href="http://www.agencered.ca/">RED</a> à fait une grosse partie du travail dans ce projet: Le graphisme et le concept de tout le projet, l&#8217;intégration HTML, le Javascript, les deux cartes, les photos de chaque cadeaux, chaque description</p>
<h4>Ma participation</h4>
<p>J&#8217;ai planifié, rédigé les besoins techniques, les cas d&#8217;utilisations et programmé en utilisant <em>symfony framework (v1.2 en PHP)</em>. <a href="http://stephanchampagne.com/">Stéphan Champagne</a> m&#8217;a accompagné pour ce qui concerne la normalisation de la base de donnée et les controleurs. Grâce à lui j&#8217;ai pu produire dans les temps une grande charge de travail a moi seul.</p>
<p>Ce projet arrivait dans un bon timing car j&#8217;était dans une passe où je ne voulait que coder pour passer ma <a href="http://renoirboulanger.com/blog/2009/09/devenir-zend-certified-engineer-avec-php5/">certification ZCE</a> (que je n&#8217;ai toujours pas). Je cherchait des petits projets pour jouer avec des frameworks PHP. Je crois que ce projet fut une réussite.</p>
<p>&nbsp;</p>
<h3>AU FINAL</h3>
<p>Il y a eu <strong>plus d&#8217;une centaine d&#8217;échanges</strong> et beaucoup de plaisir pour les participants. J&#8217;ai su, ce week-end, que le projet <strong>club échangiste</strong> est en nomination au 17<sup>e</sup> <a href="http://www.grenier.qc.ca/grenier-or/">concours annuel «<strong>Le Grenier d&#8217;Or</strong>»</a> pour le monde des communications.</p>
<p><strong>Mise à jour du lendemain des <em>Grenier d&#8217;Or</em></strong>: Durant la soirée, le projet a été mentionné lauréat plusieurs fois. Le projet a remporté un <strong>Certificat d&#8217;Excellence</strong> dans la catégorie <strong>JEU ET INTERACTIVITÉ</strong>.</p>
<p>&nbsp;</p>
<h3>PHOTOS</h3>

<a href='http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/echangistes_mini/' title='RED propose de finir l&#039;Année dans un Club échangiste'><img width="150" height="150" src="http://renoirboulanger.com/wp-content/uploads/2010/02/echangistes_mini-150x150.png" class="attachment-thumbnail" alt="" title="RED propose de finir l&#039;Année dans un Club échangiste" /></a>
<a href='http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/scr_echange2009_accueil/' title='La page d&#039;accueil'><img width="150" height="150" src="http://renoirboulanger.com/wp-content/uploads/2010/02/scr_echange2009_Accueil-150x150.png" class="attachment-thumbnail" alt="CLUB ÉCHANGISTE, entrez votre code." title="La page d&#039;accueil" /></a>
<a href='http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/scr_echange2009_gifts/' title='La page principale, la liste des cadeaux'><img width="150" height="150" src="http://renoirboulanger.com/wp-content/uploads/2010/02/scr_echange2009_Gifts-150x150.png" class="attachment-thumbnail" alt="" title="La page principale, la liste des cadeaux" /></a>
<a href='http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/scr_echange2009_confirm/' title='Confirmation d&#039;un échange'><img width="150" height="150" src="http://renoirboulanger.com/wp-content/uploads/2010/02/scr_echange2009_Confirm-150x150.png" class="attachment-thumbnail" alt="Voulez-vous vraiment échanger votre cadeau avec celui de Francois S. Ensuite, il vous restera 9 echanges. voulez-vous continuer? OUI NON" title="Confirmation d&#039;un échange" /></a>
<a href='http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/scr_echange2009_ferme/' title='Page de fermeture de l&#039;échange'><img width="150" height="150" src="http://renoirboulanger.com/wp-content/uploads/2010/02/scr_echange2009_Ferme-150x150.png" class="attachment-thumbnail" alt="" title="Page de fermeture de l&#039;échange" /></a>
<a href='http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/carte_postale_1_front/' title='Carte postale invitation devant'><img width="150" height="150" src="http://renoirboulanger.com/wp-content/uploads/2010/02/carte_postale_1_front-150x150.jpg" class="attachment-thumbnail" alt="" title="Carte postale invitation devant" /></a>
<a href='http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/carte_postale_1_back/' title='Carte postale invitation, dos'><img width="150" height="150" src="http://renoirboulanger.com/wp-content/uploads/2010/02/carte_postale_1_back-150x150.jpg" class="attachment-thumbnail" alt="" title="Carte postale invitation, dos" /></a>
<a href='http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/carte_postale_2_front/' title='Carte postale avec cadeau, devant'><img width="150" height="150" src="http://renoirboulanger.com/wp-content/uploads/2010/02/carte_postale_2_front-150x150.jpg" class="attachment-thumbnail" alt="" title="Carte postale avec cadeau, devant" /></a>
<a href='http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/carte_postale_2_back/' title='Carte postale avec cadeau, dos'><img width="150" height="150" src="http://renoirboulanger.com/wp-content/uploads/2010/02/carte_postale_2_back-150x150.jpg" class="attachment-thumbnail" alt="" title="Carte postale avec cadeau, dos" /></a>

]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2010/02/realisation-dune-application-dechange-de-cadeau-avec-red-lagence-le-%c2%abclub-echangiste%c2%bb-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manipulation des liens extérieurs et les popup pour améliorer l&#8217;Accessibilité</title>
		<link>http://renoirboulanger.com/blog/2009/08/manipulation-des-liens-exterieurs-et-les-popup-pour-ameliorer-laccessibilite/</link>
		<comments>http://renoirboulanger.com/blog/2009/08/manipulation-des-liens-exterieurs-et-les-popup-pour-ameliorer-laccessibilite/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 21:36:29 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Accessibilité]]></category>
		<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=766</guid>
		<description><![CDATA[Manipulation des liens extérieurs et les popup pour améliorer l&#8217;AccessibilitéEn rédigeant Accessibilité et les liens externes j&#8217;ai réalisé qu&#8217;il y aurait trop de matière pour être lue dans un simple billet. Alors j&#8217;ai décidé d&#8217;aller plus en profondeur et de le documenter.
Cet article explique une méthode simple pour transformer tout les liens d&#8217;une page qui [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2009/08/manipulation-des-liens-exterieurs-et-les-popup-pour-ameliorer-laccessibilite/' class='retweet '  style='display:block;margin:10px 0px;' >Manipulation des liens extérieurs et les popup pour améliorer l&#8217;Accessibilité</a><p>En rédigeant <a href="http://renoirboulanger.com/blog/2009/08/accessibilite-et-les-liens-externes/"><em>Accessibilité et les liens externes</em></a> j&#8217;ai réalisé qu&#8217;il y aurait trop de matière pour être lue dans un simple billet. Alors j&#8217;ai décidé d&#8217;aller plus en profondeur et de le documenter.</p>
<p>Cet article explique une méthode simple pour transformer tout les liens d&#8217;une page qui vont à l&#8217;extérieur du site courrant en ajoutant un icône approprié et la note disant qu&#8217;une fenêtre s&#8217;ouvrira</p>
<p><span id="more-766"></span></p>
<p>&nbsp;</p>
<h3>Les méthodes généralement utilisés</h3>
<p>Actuellement, il existe plusieurs manières de faire. Sauf qu&#8217;elles demandent souvent de le faire à la main pour <em>chaque lien</em> et ca peut être lourd.</p>
<p>Surtout pour la rédaction qui se fout un peu de faire du <em>html propre</em></p>
<p>&nbsp;</p>
<h3>Comment faire un pop-up</h3>
<p>Voici quelques manières&#8230; rien d&#8217;extravagant.</p>
<div>
<ul>
<li><strong>Méthode target</strong>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;somelink.php&quot; target=&quot;_blank&quot;&gt;Link text&lt;/a&gt;</pre></td></tr></table></div>

<p>Mais le problème c&#8217;est que l&#8217;attribut <tt>target=""</tt> est maintenant obselete. Donc <strong>on ne devrait pas l&#8217;utiliser</strong></p>
</li>
<li><strong>Méthode href javascript window.open</strong>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;javascript:window.open('http://renoirboulanger.com/','mywindow','width=400,height=200')&quot;&gt;Link text&lt;/a&gt;</pre></td></tr></table></div>

<p> Fonctionnerait bien. Mais du point de vue SEO et Crawling&#8230; on complique la tâche et ne devrait pas etre utilisé car l&#8217;attribut <tt>href=""</tt> est fait pour avoir le URL.<br />Elle n&#8217;est pas recommandée parceque la balise est altérée de son usage natuel: faire un lien et que l&#8217;attribut <tt>href</tt> dise QUOI lier.</p>
</li>
<li><strong>Méthode onClick</strong>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;somelink.php&quot; onclick=&quot;window.open('http://renoirboulanger.com/','mywindow','width=400,height=200')&quot;&gt;Link text&lt;/a&gt;</pre></td></tr></table></div>

<p>Est une bonne méthode mais <strong>pas facile a expliquer pour l&#8217;équipe de rédaction.</strong></p>
</li>
</ul>
</div>
<p>Ces méthodes font bel et bien le travail mais certaines d&#8217;entre elles (je ne les ai pas toutes listés) sont sémantiquement invalides&#8230; et donne un <a rel="nofollow" href="http://en.wikipedia.org/wiki/Tag_soup">du tagsoup</a></p>
<p>&nbsp;</p>
<h3>Règles pour les liens extérieurs</h3>
<ul>
<li>Une balise html doit être utilisée pour son usage</li>
<li>Le <em>markup</em> doit être le plus simple possible pour éviter les erreurs d&#8217;entrée de l&#8217;édimestre.</li>
<li>On ne peut pas utiliser le <tt>CSS</tt> pour ajouter les icones<br />
<strong>Note</strong>: Parceque les <em>Lecteurs d&#8217;écran</em> (aveugles) &#8220;lisent&#8221; le texte et non pas ce qui a été modifié via <tt>CSS</tt>.</li>
<li>On ne peut pas utiliser de Javascript invalide<br />
<strong>Note</strong>: Si on y va via le DOM, avec les manipulations valide, ca passe bien: bref on évite <tt>innerHTML</tt> et on se fie aux <a href="http://www.w3.org/DOM/">Spécifications du DOM</a></li>
</ul>
<p>D&#8217;autres règles pourraient être mentionnées. Mais le message peut bien se résumer ainsi.</p>
<blockquote><p><strong>En <tt>HTML</tt>, on doit utiliser les balises pour l&#8217;usage qu&#8217;elles sont destinés à faire.</strong></p></blockquote>
<p>&#8230; il ne reste pas tant d&#8217;options. La <a href="#mamethode">méthode que j&#8217;ai élaboré répond a toutes ces conditions</a>.</p>
<p>&nbsp;</p>
<h3>Les <em>autres</em> choses que le lien doit faire</h3>
<p>Dans les lignes guides de l&#8217;accessibilité du web (et en ergonomie/utilisabilité) on mentionne</p>
<blockquote><p>Qu&#8217;on doit avoir un indice qu&#8217;un lien est destiné à ouvrir <em>une page extérieure</em> et/ou <em>un popup</em></p></blockquote>
<p>Source: ma mémoire&#8230; j&#8217;ai pas trouvé de lien référence. Si vous en trouvez, faites <a href="/me-joindre/">moi signe</a></p>
<p>ça veut donc dire qu&#8217;en plus de faire le lien en tant que tel, il faut ajouter une <em>image</em> dans le lien qui va annoncer le popup&#8230; Ouf!</p>
<p>&nbsp;</p>
<h3>Ce qu&#8217;il faudrait&#8230;</h3>
<p>En gros, il faudrait, que pour chaque lien&#8230;</p>
<ul>
<li>Avertir qu&#8217;il y a un lien externe dans un icône image ajouté automatiquement</li>
<li>Placer l&#8217;icone avec la bonne balise et ne pas utiliser le <tt>CSS</tt>.</li>
<li>Avoir un <tt>alt=""</tt> pour l&#8217;image (icône) car sinon c&#8217;est du <em>html invalide</em> en plus qu&#8217;il servirait a avertir</li>
<li>Que le <tt>alt=""</tt> soit dans la langue utilisée dans le site</li>
<li>Que le lien soit utilisable <em>SANS JAVASCRIPT</em> donc, on oublie le <tt>href="javascript..."</tt><br />
<strong>Note</strong>: C&#8217;est une approche qui veut que l&#8217;on puise &#8220;<em>dégrader élégamment</em>&#8221; le code dans la &#8220;<em>pire des situations</em>&#8220;</li>
</ul>
<p>&nbsp;</p>
<h3><a name="mamethode"></a>la Manière idéale</h3>
<p>Il s&#8217;agit d&#8217;une méthode que j&#8217;ai élaborée avec un ancien collègue que l&#8217;on surnomme (alias) <em>Reynold Kirby</em> pour être valide avec toutes les règles ci-haut mentionnés.</p>
<ul>
<li>Lister tout les liens externes qui commencent par <tt>http://</tt>;</li>
<li>Éliminer de la liste les domaines qu&#8217;on ne veut pas qui se fassent transformer;</li>
<li>Créer, via le <tt>DOM</tt>, une image AVEC le bon <tt>alt=""</tt>;</li>
<li>Ajouter un attribut <tt>rel="popup"</tt> pour le handler de popup;</li>
<li>Ajouter, finalement, le handler <tt>onclick=""</tt>.</li>
</ul>
<h4>La &#8220;pogne&#8221;</h4>
<p>On va utiliser le <tt>onclick=""</tt>, mais généré automatiquement via Javascript. Car de toute façon il est ridicule de s&#8217;interdire d&#8217;utiliser javascipt. Dans ce contexte, ce serait donc acceptable. Et toujours mieux que de faire <tt>target="_blank"</tt> et/ou de demander aux édimestres de <em>faire chaque lien à bras</em> (!!)
</p>
<h4>Le code</h4>
<p>Simplement ajouter ce bout de code Javascript aux autres scripts du site.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> strPopUpWarning <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Lien sur un site externe qui va ouvrir dans une nouvelle fenetre.'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> addImageAtExternalLinks<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> anchorList <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> anchorList.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">/**
    * Remarquez les indexOf()... remplacez renoirboulanger 
    * par votre propre nom de domaine... addthis a été ajouté 
    * au cas ou vous avez un service du genre
    **/</span> 
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">href</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">''</span> <span style="color: #339933;">&amp;&amp;</span>
    anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'renoirboulanger'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">&amp;&amp;</span>
    anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'javascript'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">&amp;&amp;</span>
    anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'addthis'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003366; font-weight: bold;">var</span> elContainer <span style="color: #339933;">=</span> anchorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> createdEl <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      createdEl.<span style="color: #660066;">alt</span> <span style="color: #339933;">=</span> strPopUpWarning<span style="color: #339933;">;</span>
      createdEl.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'/icones/extlink.gif'</span><span style="color: #339933;">;</span>
      elContainer.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rel'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'popup'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      elContainer.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>createdEl<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      elContainer.<span style="color: #660066;">onclick</span> <span style="color: #339933;">=</span> dopopup<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009966; font-style: italic;">/* Ensuite... l'appel */</span>
addImageAtExternalLinks<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/**
 * Fonctions pour les popup
 *
 * Permet de crere un popup en faisant un lien
 * &lt;a href=&quot;http://www.othersite.com/url/&quot; /&gt;text (usage normal)
 * Mais creer des liens popup au besoin selon des specifites que l'on veut. Donc, un
 *  lien comme ceux ci  genereront...)
 *   &lt;a href=&quot;http://www.othersite.com/url/&quot; rel=&quot;popup&quot; /&gt;text et aussi
 *   &lt;a href=&quot;http://www.othersite.com/url/&quot; rel=&quot;popup standard 800 600&quot; /&gt;text
 *     (un popup de 800x600 avec toolbars)
 *   &lt;a href=&quot;http://www.othersite.com/url/&quot; rel=&quot;popup console 800 600&quot; /&gt;text
 *     (un popup de 800x600 mais sans toolbars)
 *   &lt;a href=&quot;http://www.othersite.com/url/&quot; rel=&quot;popup fullscreen&quot; /&gt;text (un popup plein ecran)
 *
 * En plus, ce qui a ete ajoute est la possibilite (avec addImageAtExternalLinks();) de scanner toutes les
 * href de la page courrante qui ne sont pas interieurs (ou acceptes) et d'y ajouter une image qui dit que c'est
 * un popup (via le DOM) et qui annonce que ca va ouvrir un site exterieur... bref qui prendrait
 *
 * @author Renoir Boulanger &lt;lunique @renoirboulanger.com&gt;
 * @author Reynold Kirby (alias) &lt;reynold .kirby@gmail.com&gt;
 **/</span>
<span style="color: #003366; font-weight: bold;">function</span> dopopup<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// Source: http://www.accessify.com/features/tutorials/the-perfect-popup/</span>
  <span style="color: #006600; font-style: italic;">//set defaults - if nothing in rel attrib, these will be used</span>
  <span style="color: #003366; font-weight: bold;">var</span> t <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;standard&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> w <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> h <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">//look for parameters</span>
  attribs <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">rel</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot; &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">!=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>t <span style="color: #339933;">=</span> attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">!=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>w <span style="color: #339933;">=</span> attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">!=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>h <span style="color: #339933;">=</span> attribs<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">//call the popup script</span>
  popUpWin<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">href</span><span style="color: #339933;">,</span>t<span style="color: #339933;">,</span>w<span style="color: #339933;">,</span>h<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">//cancel the default link action if pop-up activated</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">event</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    window.<span style="color: #660066;">event</span>.<span style="color: #660066;">returnValue</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    window.<span style="color: #660066;">event</span>.<span style="color: #660066;">cancelBubble</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    e.<span style="color: #660066;">stopPropagation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> popUpWin<span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> type<span style="color: #339933;">,</span> strWidth<span style="color: #339933;">,</span> strHeight<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  closeWin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #006600; font-style: italic;">//calls function to close pop-up if already open,</span>
  <span style="color: #006600; font-style: italic;">//to ensure it's re-opened every time, retainining focus</span>
  type <span style="color: #339933;">=</span> type.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>type <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;fullscreen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    strWidth <span style="color: #339933;">=</span> screen.<span style="color: #660066;">availWidth</span><span style="color: #339933;">;</span>
    strHeight <span style="color: #339933;">=</span> screen.<span style="color: #660066;">availHeight</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #003366; font-weight: bold;">var</span> tools<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>type <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;standard&quot;</span><span style="color: #009900;">&#41;</span>
  tools <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width=&quot;</span><span style="color: #339933;">+</span>strWidth<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,height=&quot;</span><span style="color: #339933;">+</span>strHeight<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,top=0,left=0&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>type <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;console&quot;</span> <span style="color: #339933;">||</span> type <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;fullscreen&quot;</span><span style="color: #009900;">&#41;</span>
    tools <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;resizable,toolbar=no,location=no,scrollbars=no,width=&quot;</span><span style="color: #339933;">+</span>strWidth<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,height=&quot;</span><span style="color: #339933;">+</span>strHeight<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;,left=0,top=0&quot;</span><span style="color: #339933;">;</span>
  newWindow <span style="color: #339933;">=</span> window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> <span style="color: #3366CC;">'newWin'</span><span style="color: #339933;">,</span> tools<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  newWindow.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">var</span> newWindow <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> closeWin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>newWindow <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>newWindow.<span style="color: #660066;">closed</span><span style="color: #009900;">&#41;</span>
      newWindow.<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>reynold<span style="color: #339933;">&gt;&lt;/</span>lunique<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>
</p>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2009/08/manipulation-des-liens-exterieurs-et-les-popup-pour-ameliorer-laccessibilite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Accessibilité et les liens externes</title>
		<link>http://renoirboulanger.com/blog/2009/08/accessibilite-et-les-liens-externes/</link>
		<comments>http://renoirboulanger.com/blog/2009/08/accessibilite-et-les-liens-externes/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 22:28:01 +0000</pubDate>
		<dc:creator>Renoir Boulanger</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Accessibilité]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://renoirboulanger.com/?p=778</guid>
		<description><![CDATA[Accessibilité et les liens externesIl existe plusieurs normes en accessibilité du web qui demande des choses qu&#8217;on ne prend pas nécessairement le temps de faire.
Soit que c&#8217;est pas manque de temps, trop de choses à penser, ou on n&#8217;y pense simplement pas.
Dans cet article j&#8217;exprime mon opinion sur l&#8217;importance (du point de vue utilisabilité) des [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2009/08/accessibilite-et-les-liens-externes/' class='retweet '  style='display:block;margin:10px 0px;' >Accessibilité et les liens externes</a><p>Il existe plusieurs normes en accessibilité du web qui demande des choses qu&#8217;on ne prend pas nécessairement le temps de faire.</p>
<p>Soit que c&#8217;est pas manque de temps, trop de choses à penser, ou on n&#8217;y pense simplement pas.</p>
<p>Dans cet article j&#8217;exprime mon opinion sur l&#8217;importance (du point de vue utilisabilité) des icones de liens extérieurs. <del>Plus tard je montrerai une méthode pour automatiser</del> <ins>[EDIT 2009-08-23] J&#8217;ai documenté comment faire dans <a href="http://renoirboulanger.com/blog/2009/08/manipulation-des-liens-exterieurs-et-les-popup-pour-ameliorer-laccessibilite">Manipulation des liens extérieurs et les popup pour améliorer l&#8217;Accessibilité</a>.</ins></p>
<p><span id="more-778"></span></p>
<p>Le problème que j&#8217;ai voulu me pencher consiste avec la <a href="http://www.accessibiliteweb.org/bdc/directives/theme/comprehension#pc13_1">règle qui suit</a> :</p>
<blockquote><p><strong>2.4.4 (niveau A)</strong><br />
Destination d&#8217;un lien :<br />
La destination d&#8217;un lien peut Être déterminée à partir du libellé (label=&#8221;") du lien ou du libellé et du contexte de ce lien déterminable par programmation, sauf pour un lien dont la destination serait ambigüe pour l&#8217;ensemble des utilisateur.</p></blockquote>
<p>Ce qui implique qu&#8217;on doit ajouter à la main une icône qui annonce le «popup» et si c&#8217;est un lien extérieur.</p>
<p>&nbsp;</p>
<h2>Pourquoi ne pas automatiser ce qui est automatisable?</h2>
<p>Lorsqu&#8217;on doit manuellement, faire l&#8217;option popup quand on édite un site et le faire à bras pour chacun.</p>
<p>Parfois, en programmant on finit par se demander&#8230;  &#8220;<em><strong>L&#8217;informatique au service de l&#8217;homme</strong></em>&#8221; (ou le contraire?)</p>
<p>&nbsp;</p>
<h2>L&#8217;objectif</h2>
<p>Alors, j&#8217;ai décidé de trouver une manière d&#8217;automatiser?</p>
<ul>
<li>de prendre une balise standard

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;http://www.somesite.com/action/handler&quot;&gt;Link&lt;/a&gt;</pre></td></tr></table></div>

</li>
<li>d&#8217;ajouter de l&#8217;image icône qui annonce que c&#8217;est un (lien externe + popup)</li>
<li>d&#8217;instaurer le <tt>alt=""</tt> de l&#8217;image</li>
<li>de transformer le lien en popup&#8230;

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;http://www.somesite.com/action/handler&quot;&gt;Link&lt;img src=&quot;/icons/external_link.png&quot; alt=&quot;Avertissement: Ce lien ouvre dans une fenêtre externe car il ne fait pas partie du présent site&quot; width=&quot;10&quot; height=&quot;10&quot; class=&quot;popuphreficon&quot; /&gt;&lt;/a&gt;</pre></td></tr></table></div>

</li>
</ul>
<p>&#8230; tout ça en Javascript qui manipule le <tt>DOM</tt> d&#8217;une manière valide&#8230; et qui suit les normes d&#8217;<strong>Accessibilité du web</strong> !!</p>
]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2009/08/accessibilite-et-les-liens-externes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detection de langue</title>
		<link>http://renoirboulanger.com/blog/2005/12/detection-langue/</link>
		<comments>http://renoirboulanger.com/blog/2005/12/detection-langue/#comments</comments>
		<pubDate>Thu, 22 Dec 2005 14:26:01 +0000</pubDate>
		<dc:creator>Renoir</dc:creator>
				<category><![CDATA[Programmation]]></category>

		<guid isPermaLink="false">http://www.renoirboulanger.com/2005/12/22/detection-langue/</guid>
		<description><![CDATA[Detection de langueLorsqu&#8217;on travaille sur un site qui doit avoir plusieurs langues&#8230; il m&#8217;arrive souvent de devoir détecter la langue du visiteur. Ce bout de code permet de détecter la langue selon les données fournies dans HTTP_ACCEPT_LANGUAGE et HTTP_USER_AGENT. Il faut comprendre que ce n&#8217;est pas une solution absolue, mais un bout de code qui [...]]]></description>
			<content:encoded><![CDATA[<a href='http://renoirboulanger.com/blog/2005/12/detection-langue/' class='retweet '  style='display:block;margin:10px 0px;' >Detection de langue</a><p>Lorsqu&#8217;on travaille sur un site qui doit avoir plusieurs langues&#8230; il m&#8217;arrive souvent de devoir détecter la langue du visiteur. Ce bout de code permet de détecter la langue selon les données fournies dans <strong>HTTP_ACCEPT_LANGUAGE</strong> <em>et</em> <strong>HTTP_USER_AGENT</strong>. Il faut comprendre que ce n&#8217;est pas une solution absolue, mais un bout de code qui peut s&#8217;avérer utile!<br />
<span id="more-13"></span><br />
Toujours utile pour configurer la langue. Ce bout de code permet de savoir la préférence du language du visiteur&#8230; il est utile lorsqu&#8217;on place ensuite des images ou des bouts de texte avec des conditions. Voici le code&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// --- DEBUT DU BOUT DE CODE --- </span>
<span style="color: #009933; font-style: italic;">/**
  * Les langues disponibles
  **/</span>
  <span style="color: #000088;">$langues</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'fra'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># AUSSI LA LANGUE PAR DEFAUT
</span>  <span style="color: #000088;">$langues</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'eng'</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009933; font-style: italic;">/**
  * Avoir la liste des details HTTP_USER_AGENT et HTTP_ACCEPT_LANGUAGE dans $ua  
  **/</span>
 <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">';'</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$agent_details</span><span style="color: #009900;">&#41;</span>
   <span style="color: #000088;">$ua</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$agent_details</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
 <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">';'</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_ACCEPT_LANGUAGE'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$agent_details</span><span style="color: #009900;">&#41;</span>
   <span style="color: #000088;">$ua</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$agent_details</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #009933; font-style: italic;">/**
  * Avoir la liste des traductions possibles... puis setter la langue
  **/</span>
 <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'langues'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$trx</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$trx</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ua</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
     <span style="color: #000088;">$langue</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$trx</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">else</span>
     <span style="color: #000088;">$langue</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'langues'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// --- FIN DU BOUT DE CODE --- @@</span></pre></td></tr></table></div>

<p>Ensuite, on appelle la reponse avec <tt>$GLOBALS['langue']</tt> (a l&#8217;intérieur d&#8217;une fonction), ou encore <tt>$langue</tt>&#8230; vous pouvez utiliser évidemment la structure de noms que vous voulez. Un exemple intéressant d&#8217;usage pourrait etre lorsqu&#8217;on veut charger une image en fonction de la langue actuelle&#8230; on pourrait le faire ainsi:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span>/path/to/image/?=<span style="color: #006699; font-weight: bold;">{$langue}</span>/design_slice_12.jpg<span style="color: #000099; font-weight: bold;">\&quot;</span> alt=<span style="color: #000099; font-weight: bold;">\&quot;</span>Welcome<span style="color: #000099; font-weight: bold;">\&quot;</span> border=<span style="color: #000099; font-weight: bold;">\&quot;</span>0<span style="color: #000099; font-weight: bold;">\&quot;</span> /&gt;&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://renoirboulanger.com/blog/2005/12/detection-langue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

