<?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>vibby.fr</title>
	<atom:link href="http://vibby.beauvivre.fr/feed/" rel="self" type="application/rss+xml" />
	<link>http://vibby.beauvivre.fr</link>
	<description>Portfolio et Blog de Vincent Beauvivre</description>
	<lastBuildDate>Mon, 10 Oct 2011 09:57:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Symfony : pagination à partir de plusieurs requêtes doctrine</title>
		<link>http://vibby.beauvivre.fr/2011/08/symfony-pagination-a-partir-de-plusieurs-requetes-doctrine/</link>
		<comments>http://vibby.beauvivre.fr/2011/08/symfony-pagination-a-partir-de-plusieurs-requetes-doctrine/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 17:59:01 +0000</pubDate>
		<dc:creator>vibby</dc:creator>
				<category><![CDATA[Petits coups de pouce]]></category>
		<category><![CDATA[Réalisations]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[sfpager]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://vibby.beauvivre.fr/?p=168</guid>
		<description><![CDATA[Dans la continuité, voici comment gérer la pagination à partir de plusieurs requêtes DQL : A créer dans un fichier sfMultiDoctrinePager.class.php, et à placer qque part dans votre lib &#160; &#60;?php &#160; /** * dualTableDoctrinePager * a pager for combining the results of multiple tables * * @author vibby */ class sfMultiDoctrinePager extends sfDoctrinePager &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>Dans la continuité, voici comment gérer la pagination à partir de plusieurs requêtes DQL :<br />
<span id="more-168"></span><br />
A créer dans un fichier sfMultiDoctrinePager.class.php, et à placer qque part dans votre lib</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * dualTableDoctrinePager
 * a pager for combining the results of multiple tables
 *
 * @author vibby
 */</span>
<span style="color: #000000; font-weight: bold;">class</span> sfMultiDoctrinePager <span style="color: #000000; font-weight: bold;">extends</span> sfDoctrinePager
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$queries</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setQueries<span style="color: #009900;">&#40;</span><span style="color: #000088;">$queries</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$pagerQueries</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</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: #000088;">$queries</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$pagerQueries</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$query</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$pagerQueries</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'active'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">queries</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$pagerQueries</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getCountQueries<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$queries</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">queries</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$queries</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> clone <span style="color: #000088;">$query</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$queries</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span>
        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$queries</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">results</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$countQueries</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCountQueries</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$counts</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// remebering counts for each table</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$countQueries</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$countQuery</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$currentCount</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$countQuery</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$counts</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$currentCount</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$count</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$currentCount</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setNbResults</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// reseting queries</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">queries</span> <span style="color: #b1b100;">as</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$query</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span>
        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
      <span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPage</span><span style="color: #009900;">&#40;</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: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</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: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getNbResults</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLastPage</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$offset</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLastPage</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">ceil</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getNbResults</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      	<span style="color: #666666; font-style: italic;">//For every query</span>
      	<span style="color: #000088;">$iQuery</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
      	<span style="color: #000088;">$totalCount</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">queries</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
        	<span style="color: #000088;">$iQuery</span> <span style="color: #339933;">++;</span>
        	<span style="color: #666666; font-style: italic;">//Is this query a part of the wanted ?</span>
        	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$counts</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$iQuery</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' + '</span><span style="color: #339933;">.</span><span style="color: #000088;">$totalCount</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' &lt;= '</span><span style="color: #339933;">.</span><span style="color: #000088;">$offset</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">;</span>
        	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$totalCount</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' &gt; '</span><span style="color: #339933;">.</span><span style="color: #000088;">$offset</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' + '</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">;</span>
        	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>
        		<span style="color: #009900;">&#40;</span><span style="color: #000088;">$counts</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$iQuery</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$totalCount</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span>
        	<span style="color: #339933;">||</span>
        		<span style="color: #009900;">&#40;</span><span style="color: #000088;">$totalCount</span> <span style="color: #339933;">&gt;=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        	<span style="color: #009900;">&#41;</span>
        	<span style="color: #009900;">&#123;</span>
        		<span style="color: #000088;">$query</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'active'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        		<span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$totalCount</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' et limite : '</span><span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$totalCount</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        		<span style="color: #000088;">$query</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'active'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$query</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span>
              <span style="color: #339933;">-&gt;</span><span style="color: #004000;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">max</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$offset</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$totalCount</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
              <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$totalCount</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        	<span style="color: #009900;">&#125;</span>
        	<span style="color: #000088;">$totalCount</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$counts</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$iQuery</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getResults<span style="color: #009900;">&#40;</span><span style="color: #000088;">$hydrationMode</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">queries</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$query</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: #000088;">$query</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'active'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$results</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$query</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hydrationMode</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #b1b100;">else</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$results</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</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: #b1b100;">return</span> <span style="color: #000088;">$results</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Et cela s&#8217;appelle comme cela depuis le controller :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000088;">$queries</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">getTable</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'myTable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">anyQueryCreation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$queries</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">getTable</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'myOtherTable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">anyQueryCreation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$queries</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">getTable</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'myYetAnotherTable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">anyQueryCreation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfMultiDoctrinePager<span style="color: #009900;">&#40;</span>
	    <span style="color: #0000ff;">'consuleadsAccount'</span><span style="color: #339933;">,</span>
	    sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'app_directory_count_default'</span><span style="color: #009900;">&#41;</span>
	  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setQueries</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$queries</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #666666; font-style: italic;">// $this-&gt;pager-&gt;setQueries($queries2);</span>
&nbsp;
&nbsp;
&nbsp;
	  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setPage</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	 <span style="color: #666666; font-style: italic;">// $this-&gt;pager-&gt;setQueries($queries2);</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Enjoy <img src='http://vibby.beauvivre.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://vibby.beauvivre.fr/2011/08/symfony-pagination-a-partir-de-plusieurs-requetes-doctrine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony : Menu sélectionné et activé</title>
		<link>http://vibby.beauvivre.fr/2011/06/systeme-de-menu-selectionne/</link>
		<comments>http://vibby.beauvivre.fr/2011/06/systeme-de-menu-selectionne/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 07:36:24 +0000</pubDate>
		<dc:creator>vibby</dc:creator>
				<category><![CDATA[Réalisations]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://vibby.beauvivre.fr/?p=156</guid>
		<description><![CDATA[Voici un problème récurent quand on créé un site web : passer un élément de menu en &#171;&#160;activé&#160;&#187; quand le contenu de celui-ci est affiché. Dans Symfony, rien de mieux que le lib de l&#8217;application pour cela. Dans le fichier /root/apps/[app_name]/lib/NavigationHelper.php, j&#8217;ai mis en place la fonction suivante. &#60;?php /** * check if navigation element [...]]]></description>
			<content:encoded><![CDATA[<p>Voici un problème récurent quand on créé un site web : passer un élément de menu en &laquo;&nbsp;activé&nbsp;&raquo; quand le contenu de celui-ci est affiché. Dans Symfony, rien de mieux que le lib de l&#8217;application pour cela. Dans le fichier /root/apps/[app_name]/lib/NavigationHelper.php, j&#8217;ai mis en place la fonction suivante.<span id="more-156"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
 * check if navigation element is active by checking for a request
 * parameter element and return css class
 * @param $conditions
 * @param String $defaultParameterName
 * @param String $cssClass
 * 
 * Usage : test module AND action :
 * nav_active('module/action'); =&gt; return the css class if module AND the action names fit.
 * Usage : test many parameters (OR function) :
 * nav_active(array('param1' =&gt; 'default','param2' =&gt; 'new')); =&gt; return the css class if module OR the action names fit.
 * Usage : accept many values for a parameter :
 * nav_active(array('default','job'),'module');  =&gt; return the css class if module name fit 'default' OR 'job'.
 * Usage : accept value for many parameters :
 * nav_active('default',array('module','action')); =&gt; return the css class if module OR action name fit 'default'.
 * Usage : As a default, module, action and alias are tested :
 * nav_active('default')  =&gt; return the css class if module OR action name OR alias fit 'default'.
 */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> nav_active<span style="color: #009900;">&#40;</span><span style="color: #000088;">$conditions</span><span style="color: #339933;">,</span> <span style="color: #000088;">$defaultParametersName</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cssClass</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;here&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000088;">$requestParams</span> <span style="color: #339933;">=</span> sfContext<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getParameterHolder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$defaultParametersName</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$defaultParametersName</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'alias'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'module'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'action'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$conditions</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  	<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$conditions</span><span style="color: #339933;">;</span>
  	<span style="color: #000088;">$conditions</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$temp</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$defaultParametersName</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  	<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$defaultParametersName</span><span style="color: #339933;">;</span>
  	<span style="color: #000088;">$defaultParametersName</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$defaultParametersName</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$temp</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//  print_r ($conditions);</span>
&nbsp;
  <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$conditions</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$parameterName</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$values</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: #339933;">!</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		  	<span style="color: #000088;">$temp</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$values</span><span style="color: #339933;">;</span>
		  	<span style="color: #000088;">$values</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$temp</span><span style="color: #339933;">;</span>
		  <span style="color: #009900;">&#125;</span>
&nbsp;
  		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">is_numeric</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parameterName</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  			<span style="color: #000088;">$parametersName</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$defaultParametersName</span><span style="color: #339933;">;</span>
  		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  			<span style="color: #000088;">$parametersName</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$parameterName</span><span style="color: #339933;">;</span>
  		<span style="color: #009900;">&#125;</span>	
&nbsp;
	  	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$thisValue</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: #000088;">$pos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$thisValue</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/'</span><span style="color: #009900;">&#41;</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: #000088;">$requestParams</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'module'</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: #000088;">$thisValue</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$pos</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$requestParams</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'action'</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: #000088;">$thisValue</span><span style="color: #339933;">,</span><span style="color: #000088;">$pos</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'class=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$cssClass</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">;</span>
			  	<span style="color: #009900;">&#125;</span>
    		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	  			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$parametersName</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$parameterName</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;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parameterName</span><span style="color: #339933;">,</span><span style="color: #000088;">$requestParams</span><span style="color: #009900;">&#41;</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: #000088;">$requestParams</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$parameterName</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$thisValue</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
								<span style="color: #b1b100;">return</span> <span style="color: #000088;">$cssClass</span><span style="color: #339933;">;</span>
			  			<span style="color: #009900;">&#125;</span>
			  		<span style="color: #009900;">&#125;</span>
	  			<span style="color: #009900;">&#125;</span>
	  		<span style="color: #009900;">&#125;</span>
    	<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Ensuite, il suffit de faire appel à cette fonction dans le menu en question, dans la balise de votre choix, par exemple dans le LI :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  ...&lt;li class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> nav_active<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'job'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &quot;&gt;&lt;a href=&quot;ici.html&quot; &gt;Lien&lt;/a&gt;&lt;/li&gt;</pre></div></div>

<p>Cet exemple ajoutera la classe &laquo;&nbsp;here&nbsp;&raquo; si l&#8217;un paramètre &laquo;&nbsp;module&nbsp;&raquo;, &laquo;&nbsp;action&nbsp;&raquo; ou &laquo;&nbsp;alias&nbsp;&raquo; a la valeur &laquo;&nbsp;job&nbsp;&raquo;. D&#8217;autres exemples sont visible en début de fonction.</p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://vibby.beauvivre.fr/2011/06/systeme-de-menu-selectionne/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony/doctrine : Pagination complétée</title>
		<link>http://vibby.beauvivre.fr/2011/05/symfonydoctrine-pagination-completee/</link>
		<comments>http://vibby.beauvivre.fr/2011/05/symfonydoctrine-pagination-completee/#comments</comments>
		<pubDate>Wed, 11 May 2011 16:02:15 +0000</pubDate>
		<dc:creator>vibby</dc:creator>
				<category><![CDATA[Réalisations]]></category>
		<category><![CDATA[Dévelopement]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://vibby.beauvivre.fr/?p=121</guid>
		<description><![CDATA[Voila la demande : faire en sorte que toutes les pages de la pagination affichent toujours le même nombre de résultats. S&#8217;il manque des données, alors il faut allez chercher des données archivés, expirés, outdatés &#8230; Un exemple sera plus parlant : parmi vos données, vous avez 4 annonces en cours de validité et une [...]]]></description>
			<content:encoded><![CDATA[<p>Voila la demande : faire en sorte que toutes les pages de la pagination affichent toujours le même nombre de résultats. S&#8217;il manque des données, alors il faut allez chercher des données archivés, expirés, outdatés &#8230; Un exemple sera plus parlant : parmi vos données, vous avez 4 annonces en cours de validité et une dizaine expirés. Avec une pagination réglée à 3 vous aurez deux pages de pagination : 1 qui présente 3 annonces valides puis 1 autre qui offre 1 annonce valide et 2 expirés.<span id="more-121"></span></p>
<p>Pour traiter ce problème, j&#8217;ai surclassé <strong>sfDoctrinePager </strong>en <strong>sfDoctrineFulfilledPager</strong> pour prendre en compte un autre paramètre qui est la requête complémentaire : celle qu&#8217;il faudra exécuter pour compléter les résultat.</p>
<p>Et pour la faire luxe, je l&#8217;ai rendu compatible avec sa parente. De sorte que si l&#8217;on n&#8217;entre pas ce paramètre supplémentaire, le résultat sera le même qu&#8217;avec <strong>sfDoctrinePager</strong>. Un point d&#8217;amélioration : éviter les cas où la même données pourrait être ressortir dans les deux requêtes.</p>
<p>C&#8217;est une demande client que j&#8217;ai bien aimé.</p>
<p>Voici ce que cela donne dans sfDoctrineFulfilledPager.class.php :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * sfDoctrine (completed with extra data) pager class.
 *
 * @author     vibby &lt;vincent.beauvivre@gmail.com--&gt;
 * @version    0
 */</span>
<span style="color: #000000; font-weight: bold;">class</span> sfDoctrineFulfilledPager <span style="color: #000000; font-weight: bold;">extends</span> sfDoctrinePager
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">protected</span>
	<span style="color: #000088;">$queryComplement</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">resetIterator</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$totalCount</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCountQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$totalCount</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$totalCount</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCountComplement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setNbResults</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$totalCount</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$query</span>
      <span style="color: #339933;">-&gt;</span><span style="color: #004000;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
      <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #000088;">$queryComplement</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #000088;">$queryComplement</span>
	      <span style="color: #339933;">-&gt;</span><span style="color: #004000;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
	      <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
	    <span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPage</span><span style="color: #009900;">&#40;</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: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</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: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getNbResults</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLastPage</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$offset</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLastPage</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">ceil</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getNbResults</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000088;">$query</span>
        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
      <span style="color: #339933;">;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLastPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	      <span style="color: #000088;">$queryComplement</span>
	        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplementLimit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</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: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> retrieveObject<span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</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: #000088;">$offset</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">countQuery</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #000088;">$queryForRetrieve</span> <span style="color: #339933;">=</span> clone <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQuery</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: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #000088;">$queryForRetrieve</span> <span style="color: #339933;">=</span> clone <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #000088;">$offset</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$offset</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">countQuery</span><span style="color: #339933;">;</span>
  	<span style="color: #009900;">&#125;</span>
    <span style="color: #000088;">$queryForRetrieve</span>
      <span style="color: #339933;">-&gt;</span><span style="color: #004000;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$offset</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
      <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$queryForRetrieve</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$results</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>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getQueryComplementLimit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
  	<span style="color: #000088;">$val</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCountQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMaxPerPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$val</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getCountComplement<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> clone <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$query</span>
      <span style="color: #339933;">-&gt;</span><span style="color: #004000;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
      <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplementLimit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
      <span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">min</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplementLimit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setQueryComplement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">queryComplement</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$query</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getQueryComplement<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">queryComplement</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplementLimit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getResults<span style="color: #009900;">&#40;</span><span style="color: #000088;">$hydrationMode</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
  	<span style="color: #000088;">$objects</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hydrationMode</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLastPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  		      <span style="color: #000088;">$objects</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">merge</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQueryComplement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hydrationMode</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
  	<span style="color: #b1b100;">return</span>  <span style="color: #000088;">$objects</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>&nbsp;</p>
<p>Et voici le code a ajouter dans le controlleur :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfDoctrineFulfilledPager<span style="color: #009900;">&#40;</span>
<span style="color: #0000ff;">'JobeetJob'</span><span style="color: #339933;">,</span>
sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'app_jobs_per_page'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setQuery</span><span style="color: #009900;">&#40;</span>Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">getTable</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'JobeetJob'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getActiveJobsQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setQueryComplement</span><span style="color: #009900;">&#40;</span>Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">getTable</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'JobeetJob'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUnactiveJobQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setPage</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Je vous laisse le soin de faire votre propre &laquo;&nbsp;getUnactiveJobQuery&nbsp;&raquo; <img src='http://vibby.beauvivre.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p>Attention : cette classe n&#8217;a pas été testée dans tous les sens, il n&#8217;est donc pas exclu que certains cas limites ne fonctionnent pas.</p>
]]></content:encoded>
			<wfw:commentRss>http://vibby.beauvivre.fr/2011/05/symfonydoctrine-pagination-completee/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Intégrer Prestashop à Joomla : un assemblage contre-nature ? en tout cas un boulot sympa !</title>
		<link>http://vibby.beauvivre.fr/2011/04/integrer-prestashop-a-joomla-un-assemblage-contre-nature-en-tout-cas-un-boulot-sympa/</link>
		<comments>http://vibby.beauvivre.fr/2011/04/integrer-prestashop-a-joomla-un-assemblage-contre-nature-en-tout-cas-un-boulot-sympa/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 11:34:27 +0000</pubDate>
		<dc:creator>vibby</dc:creator>
				<category><![CDATA[Réalisations]]></category>
		<category><![CDATA[Dévelopement]]></category>
		<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Prestashop]]></category>

		<guid isPermaLink="false">http://vibby.beauvivre.fr/?p=96</guid>
		<description><![CDATA[Une des étapes les plus cruciales de la création d&#8217;un site Internet, c&#8217;est le choix d&#8217;une solution technique. On est souvent frustré de devoir faire des sacrifies sur certaines fonctionnalités en faveurs d&#8217;autres. Pour Beillevaire, un projet à double contenu (Contenu riche et Vente en ligne), l&#8217;agence où je travaille a décider de cumuler les [...]]]></description>
			<content:encoded><![CDATA[<p>Une des étapes les plus cruciales de la création d&#8217;un site Internet, c&#8217;est le choix d&#8217;une solution technique. On est souvent frustré de devoir faire des sacrifies sur certaines fonctionnalités en faveurs d&#8217;autres. Pour <a href="http://www.beillevaire.com">Beillevaire</a>, un projet à double contenu (Contenu riche et Vente en ligne), l&#8217;agence où je travaille a décider de cumuler les deux solutions : <a href="http://www.joomla.org">Joomla </a>et <a href="http://www.prestashop.fr">Prestashop</a>.</p>
<p>/!\ Attention : Cet article n&#8217;est pas vraimenent un tutoriel, il s&#8217;agit plutôt de note personelles prises lors du dévelopement d&#8217;un projet particulier, afin de pouvoir refaire l&#8217;opération sur un autre projet.</p>
<p>Vous ne trouverez pas ici le composant à télécharger tel quel car la version que j&#8217;ai fait était basé sur d&#8217;anciennes versions de Joomla et Presatashop. Il vous appartient d&#8217;adapter ce qui suit à la version en cours.<span id="more-96"></span></p>
<h1>Aperçu</h1>
<p>Quand on connait ces deux solutions open-source, &laquo;&nbsp;l&#8217;assemblage&nbsp;&raquo; semble aboutir à un Frankstein : défiguré et maladroit&#8230; Mais en usant d&#8217;un bon de bon sens, on arrive à un résultat satisfaisant. La solution que j&#8217;ai choisi, c&#8217;est l&#8217;intégration de Prestashop à l’intérieur de Joomla, comme un simple composant (puis des modules associés). Cela me permet de gérer la mise en page par Joomla, ce qu&#8217;il fait bien. Dans ce cas, j&#8217;ai gardé indépendant les panneaux d&#8217;administration de Prestashop et de Joomla.</p>
<p>D&#8217;un manière très empirique j&#8217;ai simplement</p>
<ul>
<li>Installer un Joomla de base</li>
<li>Créer un composant vierge com_prestashop (par exemple, en s&#8217;aidant de <a href="http://www.notwebdesign.com/joomla-component-creator/">http://www.notwebdesign.com/joomla-component-creator/</a>)</li>
<li>Installer prestashop dans le dossier du composant, puis vérifier que les deux fonctionnent (indépendamment)</li>
<li>Créer les fichiers xml et bootstrap du composant dans le dossier components (<a title="Fichiers de base duc omposant prestashop pour Joomla" href="http://vibby.beauvivre.fr/wp-content/uploads/2011/04/com_prestashop.zip">A télécharger ici</a>)</li>
<li>Créer un élément de menu vers ce composant (en lien de type exterieur : URL du type index.php?option=com_prestashop)</li>
<li>Ensuite, tout consiste à essayer de faire fonctionner le composant !</li>
</ul>
<h1>En détails</h1>
<h2>Autoload</h2>
<p>Le premier problème auquel on se heurte, c&#8217;est l&#8217;autoload : Joomla et Prestashop on chacun le leur. On va donc modifier celui de Joomla (/libraries/loader.php) pour trouver les classes dans prestashop s&#8217;il ne les trouve pas ailleurs :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> __autoload<span style="color: #009900;">&#40;</span><span style="color: #000088;">$class</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>JLoader<span style="color: #339933;">::</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$class</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$class</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$cur_dir</span><span style="color: #339933;">=</span><span style="color: #990000;">getcwd</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$cur_dir</span><span style="color: #339933;">=</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>administrator&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$cur_dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$cur_dir</span><span style="color: #339933;">=</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/administrator&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$cur_dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cur_dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/components/com_prestashop/classes/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$class</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cur_dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/components/com_prestashop/classes/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$class</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Et coté Prestashop, on supprime l&#8217;autoload, ou mieux, on le conditionne à la pré-existence de la fonction</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'__autoload'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">function</span> __autoload<span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">...</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>A partir de ce moment, vous pouvez essayer de voir ce composant sur le frontend&#8230; et suprise ! Ca marche ! (enfin normalement) Mais c&#8217;est loin d&#8217;être utilisable.</p>
<h2>L&#8217;intégration visible</h2>
<p>Dans ce projet, j&#8217;ai tâcher, autant que possible de garder Joomla et Prestashop indépendant l&#8217;un de l&#8217;autre (avec l&#8217;url /joomla/components/com_prestashop pour le Prestashop). C&#8217;est pourquoi j&#8217;ai beaucoup uttilisé la fonction defined( &#8216;_JEXEC&#8217; ) qui permet de savoir si on est dans l’exécution de Joomla.</p>
<p>Prestashop utilise l&#8217;ingénieux système <a href="http://www.smarty.net/">Smarty</a> pour son moteur de template. Pour pouvoir l&#8217;appeller depuis le  composant Joomla, il faut le rendre accessible, modifier  [joomla]\components\com_prestashop\config\smarty.config.inc.php pour  ajouter cette ligne en début de fichier : &laquo;&nbsp;global $smarty;&nbsp;&raquo;.</p>
<p>Maintenant, on va tâcher de faire apparaitre le site correctement avec ce composant. Pour commencer, il faut détourner le header de Prestashop pour inclure ses appels aux css et js dans Joomla. Pour être pris en compte dans le composant et dans un module Joomla, modifier les deux fichiers \components\com_prestashop\header.php  (après la ligne if(isset($js_files) AND !empty($js_files)) $smarty-&gt;assign(&#8216;js_files&#8217;, $js_files);,) et \components\com_prestashop\classes\Module.php (au début de la fonction display()) :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'_JEXEC'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$document</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>JFactory<span style="color: #339933;">::</span><span style="color: #004000;">getDocument</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$document</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>addCustomTag<span style="color: #009900;">&#40;</span>Module<span style="color: #339933;">::</span><span style="color: #004000;">hookExec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'header'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$smarty</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_tpl_vars<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'css_files'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$cssFile</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$where</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$document</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>addStyleSheet<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cssFile</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$smarty</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_tpl_vars<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'js_files'</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$jsFile</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$document</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>addScript<span style="color: #009900;">&#40;</span><span style="color: #000088;">$jsFile</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Note : Dans le cas que j&#8217;ai réalisé, le mootools inclus dans Joomla a été désactivé au profit de JQuery.</p>
<p>On ne veut pas afficher le header et le footer de Prestashop, il faut conditionner dans \components\com_prestashop\header.php et footer.php les appels aux tpl : ajouter</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'_JEXEC'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>devant</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$smarty</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>display<span style="color: #009900;">&#40;</span>_PS_THEME_DIR_<span style="color: #339933;">.</span><span style="color: #0000ff;">'header.tpl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>et</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$smarty</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>display<span style="color: #009900;">&#40;</span>_PS_THEME_DIR_<span style="color: #339933;">.</span><span style="color: #0000ff;">'footer.tpl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>A présent, il est temps de faire un grand ménage dans le CSS de Prestashop car il entre en conflit avec celui de Joomla ! Je vous laisse le soin de cette tâche. Pensez surtout a virer les styles &laquo;&nbsp;globaux&nbsp;&raquo; sur html, body etc.</p>
<h2>Gérer URL, liens et rewriting</h2>
<p>Dans mon cas, j&#8217;ai choisi de fixer les URL de la façon suivante (psp = PrestaShop Page) :</p>
<p>http://[domaine]/[joomla]/index.php?option=com_prestashop&#038;psp=[page_prestashop]&#038;[parametres]</p>
<p>Comme vous le verrez, on utilise de nouvelles constantes lié au nouveau format d&#8217;URL. J&#8217;ai placé leurs déclarations dans le fichier  [joomla]\components\com_prestashop\config\config.inc.php :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'_JEXEC'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'__PS_BASE_URI_LINK_REWRITE__'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/[joomla]/boutique/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'__PS_BASE_URI_LINK__'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/[joomla]/index.php?option=com_prestashop&amp;amp;psp='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'__PS_BASE_URI_LINK_SEPARATOR__'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&amp;amp;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'__PS_COOKIES_BASE_URI__'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/[joomla]/components/com_prestashop/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'__PS_BASE_URI_LINK_REWRITE__'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/[joomla]/components/com_prestashop/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'__PS_BASE_URI_LINK__'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/[joomla]/components/com_prestashop/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'__PS_BASE_URI_LINK_SEPARATOR__'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&amp;amp;amp;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'__PS_COOKIES_BASE_URI__'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/[joomla]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Par leur nom, vous comprendrez à quoi elle servent. De plus, j&#8217;ai prévu les deux cas : hors et dans Joomla. A présent commence le gros boulot : modifier toutes les création de liens et d&#8217;URL dans Prestashop.</p>
<p>Il faut modifier &laquo;&nbsp;à la dur&nbsp;&raquo;, tous les liens qui se trouve dans Prestashop :</p>
<ul>
<li>Remplacer dans <strong> </strong>com_prestashop\classes\<strong>Link.php</strong> la chaîne <strong><em>.php?</em></strong> par <strong><em>&#8216;.__PS_BASE_URI_LINK_SEPARATOR__.&#8217;</em></strong></li>
<li>Remplacer dans <strong> </strong>com_prestashop\classes\<strong>Link.php</strong> la chaîne<strong> __PS_BASE_URI__</strong> par <strong><em></em>__PS_BASE_URI_LINK__<em></em></strong></li>
</ul>
<p>Puis modifier  [joomla]\components\com_prestashop\init.php pour remplacer ces lignes</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'base_dir'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> _PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">,</span>
<span style="color: #0000ff;">'base_dir_ssl'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$protocol_link</span><span style="color: #339933;">.</span><span style="color: #000088;">$server_host</span><span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">,</span></pre></div></div>

<p>par</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'base_dir'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> _PS_BASE_URL_<span style="color: #339933;">.</span>__PS_BASE_URI_LINK__<span style="color: #339933;">,</span>
<span style="color: #0000ff;">'base_dir_ssl'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$protocol_link</span><span style="color: #339933;">.</span><span style="color: #000088;">$server_host</span><span style="color: #339933;">.</span>__PS_BASE_URI_LINK__<span style="color: #339933;">,</span></pre></div></div>

<p>Puis ces lignes</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'base_dir'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> __PS_BASE_URI__<span style="color: #339933;">,</span>
<span style="color: #0000ff;">'base_dir_ssl'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> Tools<span style="color: #339933;">::</span><span style="color: #004000;">getHttpHost</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>__PS_BASE_URI__<span style="color: #339933;">,</span></pre></div></div>

<p>par</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'base_dir'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> __PS_BASE_URI_LINK__<span style="color: #339933;">,</span>
<span style="color: #0000ff;">'base_dir_ssl'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> Tools<span style="color: #339933;">::</span><span style="color: #004000;">getHttpHost</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>__PS_BASE_URI_LINK__<span style="color: #339933;">,</span></pre></div></div>

<p>Il faut aussi nettoyer toutes les URL écrites directement dans les fichiers TPL : modifier <strong>tous</strong> les fichiers TPL de prestashop pour remplacer <strong>.php?</strong> par <strong>&amp;amp;</strong> puis <strong>.php&nbsp;&raquo;</strong> par <strong>&laquo;&nbsp;</strong></p>
<p>Les cookies doivent être définis avec le même chemin que celui de Joomla, modifier le fichier [joomla]\components\com_prestashop\classes\Cookie.php en remplçant cette chaine</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_path <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span>__PS_BASE_URI__<span style="color: #339933;">.</span><span style="color: #000088;">$path</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/\\'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span></pre></div></div>

<p>par</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>_path <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span>__PS_COOKIES_BASE_URI__<span style="color: #339933;">.</span><span style="color: #000088;">$path</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/\\'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Un autre lien qui n&#8217;a pas été modifié, dans le fichier [joomla]\components\com_prestashop\classes\Cookie.php : remplacer cette chaine :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$base_dir_ssl}</span>order.php{if <span style="color: #006699; font-weight: bold;">$back</span>}?back=<span style="color: #006699; font-weight: bold;">{$back}</span>{/if}&quot;</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<p>par</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$base_dir_ssl}</span>order{if <span style="color: #006699; font-weight: bold;">$back</span>}&amp;amp;amp;back=<span style="color: #006699; font-weight: bold;">{$back}</span>{/if}&quot;</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

<h2>Rewriting</h2>
<p>Il faut ajouter les règles de redirection vers prestashop dans le htaccess de Joomla (aprèes la partie &laquo;&nbsp;<em>Rewrite rules to block out some common exploits</em>&laquo;&nbsp;):<br />
De cette manière, on aura des URL bien propres qui commencent par /boutique pour le liens qui pointent sur Prestashop</p>
<pre>
RewriteRule   ^modules/mod_(.*)$ modules/mod_$1 [L,E]
RewriteRule   ^modules/(.*)$ /components/com_prestashop/modules/$1
RewriteRule   ^themes/(.*)$ /components/com_prestashop/themes/$1

# URL rewriting rules
RewriteRule ^boutique/([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /components/com_prestashop/img/p/$1-$2$3.jpg [L,E]
RewriteRule ^boutique/([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /components/com_prestashop/img/p/$1-$2.jpg [L,E]
RewriteRule ^boutique/([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /components/com_prestashop/img/c/$1$2.jpg [L,E]

RewriteRule ^boutique/lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ index.php?Itemid=3&#038;option=com_prestashop&#038;psp=product&#038;id_product=$3&#038;isolang=$1$5 [L,E]
RewriteRule ^boutique/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ index.php?Itemid=3&#038;option=com_prestashop&#038;psp=product&#038;id_product=$2&#038;isolang=$1$4 [L,E]
RewriteRule ^boutique/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ index.php?Itemid=3&#038;option=com_prestashop&#038;psp=category&#038;id_category=$2&#038;isolang=$1 [QSA,L,E]

RewriteRule ^boutique/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ index.php?Itemid=3&#038;option=com_prestashop&#038;psp=product&#038;id_product=$2$4 [L,E]
RewriteRule ^boutique/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ index.php?Itemid=3&#038;option=com_prestashop&#038;psp=product&#038;id_product=$1$3 [L,E]
RewriteRule ^boutique/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ index.php?Itemid=3&#038;option=com_prestashop&#038;psp=category&#038;id_category=$1 [QSA,L,E]

RewriteRule ^boutique/content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ index.php?Itemid=3&#038;option=com_prestashop&#038;psp=cms&#038;id_cms=$1 [QSA,L,E]
RewriteRule ^boutique/([0-9]+)__([a-zA-Z0-9-]*)(.*)$ index.php?Itemid=3&#038;option=com_prestashop&#038;psp=supplier&#038;id_supplier=$1$3 [QSA,L,E]
RewriteRule ^boutique/([0-9]+)_([a-zA-Z0-9-]*)(.*)$ index.php?Itemid=3&#038;option=com_prestashop&#038;psp=manufacturer&#038;id_manufacturer=$1$3 [QSA,L,E]

RewriteRule ^boutique/lang-([a-z]{2})/(.*)$ index.php?Itemid=3&#038;option=com_prestashop&#038;psp=$2&#038;isolang=$1 [QSA,L,E]
RewriteRule ^boutique/$ index.php?Itemid=3&#038;option=com_prestashop&#038;Itemid=3 [L,E]
</pre>
<p>A partir de maintenant, Prestashop dans Joomla devrait fonctionner correctement. Par contre, les utilisateurs ne sont pas du tout &laquo;&nbsp;liés&nbsp;&raquo;. C&#8217;est à dire que si vous placez une zone de connexion Joomla, l&#8217;utilisateur ne sera pas connecté sur Prestashop, et vice-versa. Pour synchroniser ces compte (création, modification, changement de mot de passe, login, logout &#8230;), j&#8217;ai recopié (je sais que ce n&#8217;est pas bien <img src='http://vibby.beauvivre.fr/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ) le code de Joomla dans les fonctions de gestion des utilisateurs de Prestashop : </p>
<h2>En option : Gestion des utilisateurs</h2>
<p>Une chose à penser : Les comptes  utilisateurs sont squissés sous Joomla et le seul  login possible se fait  via Prestashop. Mais quand on se connecte à  Prestashop, le composant  nous logue simultanément sur Joomla. Cela  implique de synchroniser la  création et la modification de compte.  Autre chose : la durée de session  doit être la même dans le deux  solutions : dans  \components\com_prestashop\classes\Cookie.php pour  prestshop et dans  l&#8217;administration pour Joomla</p>
]]></content:encoded>
			<wfw:commentRss>http://vibby.beauvivre.fr/2011/04/integrer-prestashop-a-joomla-un-assemblage-contre-nature-en-tout-cas-un-boulot-sympa/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Ressources pour le web-dev</title>
		<link>http://vibby.beauvivre.fr/2011/03/ressources-creation-web/</link>
		<comments>http://vibby.beauvivre.fr/2011/03/ressources-creation-web/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 11:14:44 +0000</pubDate>
		<dc:creator>vibby</dc:creator>
				<category><![CDATA[Petits coups de pouce]]></category>
		<category><![CDATA[intégration]]></category>
		<category><![CDATA[projet]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://vibby.beauvivre.fr/?p=81</guid>
		<description><![CDATA[Dans toutes les étapes de la création d&#8217;un site Internet, on recherche souvent la bonne info au bon moment ! Voici un peu d&#8217;aide dans ce sens : Design Smashing magazine pour l&#8217;inspiration Font squirrel pour les polices de caractère Intégration CSS CSS reset pour bien partir CSS : les compatibilités avec les navigateurs Javascript [...]]]></description>
			<content:encoded><![CDATA[<p>Dans toutes les étapes de la création d&#8217;un site Internet, on recherche souvent la bonne info au bon moment ! Voici un peu d&#8217;aide dans ce sens :<span id="more-81"></span></p>
<h3>Design</h3>
<ul>
<li><a href="http://www.smashingmagazine.com">Smashing magazine</a> pour l&#8217;inspiration</li>
<li><a href="http://www.fontsquirrel.com">Font squirrel</a> pour les polices de caractère</li>
</ul>
<h3>Intégration CSS</h3>
<ul>
<li><a href="http://www.alsacreations.com/astuce/lire/654-feuille-de-styles-de-base.html">CSS reset</a> pour bien partir</li>
<li>CSS : les <a href="http://www.quirksmode.org/compatibility.html">compatibilités avec les navigateurs</a></li>
</ul>
<h3>Javascript</h3>
<ul>
<li><a href="http://matthiasschuetz.com/javascript-framework-matrix/en/">Syntaxe de base</a> dans les principaux framework JS</li>
<li><a href="http://cufon.shoqolate.com/generate/">Cufon</a> : toute les polices sur le site (maj + min + numerals + ÉÈÀÊÇéèàùâêîôûëïç,!.;:-&#8217;&nbsp;&raquo;?«»’&amp;)</li>
<li>Inclure les framework javascript correctement depuis l&#8217;<a href="http://code.google.com/intl/fr/apis/libraries/devguide.html#jquery">API Google</a></li>
</ul>
<h3>Optimisation et amincissement</h3>
<ul>
<li><a href="http://blog.ramenos.net/referencement/10-choses-a-faire-pour-reduire-le-poids-de-ses-pages/ ">Checklist intéressante</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://vibby.beauvivre.fr/2011/03/ressources-creation-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 conseils pour faire de belles photos</title>
		<link>http://vibby.beauvivre.fr/2011/03/10-conseils-pour-faire-de-belles-photos/</link>
		<comments>http://vibby.beauvivre.fr/2011/03/10-conseils-pour-faire-de-belles-photos/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 20:06:47 +0000</pubDate>
		<dc:creator>vibby</dc:creator>
				<category><![CDATA[Petits coups de pouce]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[photographe]]></category>

		<guid isPermaLink="false">http://vibby.beauvivre.fr/?p=68</guid>
		<description><![CDATA[La photo n&#8217;a jamais été aussi accessible que depuis l’avènement des appareils photo numériques. J&#8217;entends souvent dire qu&#8217;il faut un bon appareil pour prendre de bonnes photos. C&#8217;est assez vrai, mais cela ne signifie pas qu&#8217;on ne peut &#171;&#160;rien faire&#160;&#187; avec un simple appareil compact. Voici quelques pistes pour évoluer en prise de vue &#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>La photo n&#8217;a jamais été aussi accessible que depuis l’avènement des appareils photo numériques. J&#8217;entends souvent dire qu&#8217;il faut un bon appareil pour prendre de bonnes photos. C&#8217;est assez vrai, mais cela ne signifie pas qu&#8217;on ne peut &laquo;&nbsp;rien faire&nbsp;&raquo; avec un simple appareil compact. Voici quelques pistes pour évoluer en prise de vue &#8230;<span id="more-68"></span></p>
<h2><img class="alignleft" src="https://lh6.googleusercontent.com/_5rrBKQKQMHw/TAFzHkXyumI/AAAAAAAAAC0/W3YWVxfiWh0/s128/IMGP0360.JPG" alt="" width="85" height="128" />1 Choisissez votre sujet</h2>
<p>Une bonne soupe se bonifie à chaque ingrédient que l&#8217;on ajoute. Pour les photos, c&#8217;est l&#8217;inverse ! Choisissez clairement un seul sujet, vous centrez l&#8217;attention sur lui et donnez ainsi de la force à l&#8217;image.</p>
<h2><img class="alignleft" title="Bébé en très gros plan" src="https://lh5.googleusercontent.com/_5rrBKQKQMHw/TAF79DXnz1I/AAAAAAAAAE8/G6lgSDbXFM8/s128/IMGP1214.JPG" alt="" width="128" height="125" />2 Rapprochez-vous</h2>
<p>Partez du principe que, sur votre photo, l&#8217;importance de chaque élément est rendu par la surface de photo que vous lui dédiez. Si votre sujet occupe 1/4 ou moins de la surface, c&#8217;est que vous semblez préférer le second plan <img src='http://vibby.beauvivre.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2><img class="alignleft" src="https://lh5.googleusercontent.com/_FGXIJV316Zw/TMrxLquwQcI/AAAAAAAAFbc/n7JOsqy8dVw/s128/fotos%202008-1%20290.jpg" alt="" width="126" height="128" />3 Simplifier le fond</h2>
<p>Les fonds chargés alourdissent vos photos, en décentrant l&#8217;attention. Ils peuvent même dénaturer la perception de votre sujet. A l’extérieur, vous pouvez utiliser le ciel pour obtenir un fond uniforme.</p>
<h2><img class="alignleft" src="https://lh4.googleusercontent.com/_5rrBKQKQMHw/TAF94oagzMI/AAAAAAAAAFk/bOePqKPmQh0/s128/IMGP1103.JPG" alt="" width="85" height="128" />4 Essayez un autre point de vue</h2>
<p>On a envie de prendre en photo ce que l&#8217;on voit. Quand on est de taille normale, on fait des photos à hauteur normale. En photo comme dans les autres arts, c&#8217;est souvent bien de ne pas faire normal ! Alors asseyez-vous ! Allongez-vous ! Sautez ! Montez sur l&#8217;échelle ! Vous aurez souvent de bonnes surprises !</p>
<h2><img class="alignleft" src="https://lh4.googleusercontent.com/_5rrBKQKQMHw/TPaxNFGd1RI/AAAAAAAABE0/dmnXy7D9ZCA/s128/IMGP5130.JPG" alt="" width="128" height="85" />5 Décentrez le sujet</h2>
<p>Un élément centré peut facilement paraître statique et inerte. En choisissant de décaler l&#8217;image, vous pouvez ainsi profiter d&#8217;un fond avantageux et donner une dynamique nouvelle à votre image. Cela vous permettra souvent d&#8217;éviter un élément secondaire disgracieux <img src='http://vibby.beauvivre.fr/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<h2><img class="alignleft" src="https://lh3.googleusercontent.com/_5rrBKQKQMHw/TAF-Buk3ppI/AAAAAAAAAFs/tNraqDcYW2U/s128/IMGP1111.JPG" alt="" width="85" height="128" />6 Faites des expériences !</h2>
<p>Vous avez de l&#8217;imagination ? Il est temps de la faire parler ! Prenez le temps de sortir votre appareil spécialement pour &laquo;&nbsp;essayer des trucs&nbsp;&raquo;. Quelques pistes : Ne faites pas poser votre sujet-surprise, Profitez d&#8217;une situation cocasse, Pensez à l&#8217;image que personne n&#8217;a jamais prise, juste parce que personne n&#8217;y a pensé !</p>
<h2><img class="alignleft" src="https://lh3.googleusercontent.com/_5rrBKQKQMHw/TXzc0AS2kzI/AAAAAAAABXc/z1oPZtEDGiM/s128/IMGP5789.JPG" alt="" width="85" height="128" />7 Concentrez-vous</h2>
<p>Avec l’avènement de la photo numérique, tout le monde est ravi de prendre des dizaines de photos : &laquo;&nbsp;Comme ça, j&#8217;en aurais peut-être une de bonne !&nbsp;&raquo; Ah ! et si, au contraire, on arrêtait de faire n&#8217;importe quoi et qu&#8217;on se concentrait, rien qu&#8217;un moment sur ce qu&#8217;on peut voir dans le viseur ! Voila pourquoi j&#8217;aime utiliser le bon vieux viseur optique, quitte à avoir le nez collé à l&#8217;appareil. Ainsi, je peux me concentrer sur l&#8217;image, son cadrage, ces défauts, et comment je pourrais l&#8217;améliorer !</p>
<h2><img class="alignleft" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Train_planetaire.png/90px-Train_planetaire.png" alt="" width="90" height="120" />8 Variez les sujets</h2>
<p>Vous avez surement votre vie, vos enfants, votre jardin, votre petit coin de vie. C&#8217;est sympa. Mais les bonnes surprises en photo sont souvent loin de son propre monde. Peut-être parce qu&#8217;on porte alors un regard neuf ?</p>
<h2><img class="alignleft" src="https://lh6.googleusercontent.com/_5rrBKQKQMHw/TAF_Zmwi_fI/AAAAAAAAAF8/F-ev4fm5ZzY/s128/IMGP1349.JPG" alt="" width="85" height="128" />9 Observez la lumière et ses variations</h2>
<p>Au final, la photo se résume à cela : une certaine lumière, qui entre dans votre boitier ! Alors observez celle-ci, appréciez ses variations et les situations où elle est toute particulière. Autant que possible, garder votre appareil près de vous pour saisir la surprise qui vous attend au coin de la rue !</p>
<h2><img class="alignleft" src="https://lh5.googleusercontent.com/_cyoNY1B4nzI/Sarypb3x5fI/AAAAAAAAR3g/0gm8A6-UxRE/s128/Vue%20de%20ch%C3%A9z%20Th%C3%A9r%C3%A8se%20%2022-02-2009%2016-51-03.jpg" alt="" width="128" height="86" />10 Oubliez les règles !</h2>
<p>Comme souvent, les règles sont faites pour être apprises puis désapprises, mais pas complétement &#8230; Osez le fond chargé, la foule, le mouvement .. Quelque soit votre expérience, vous ne pourrez qu&#8217;en être enrichi, car observer le monde qui nous entoure, c&#8217;est un peu le comprendre.</p>
<h1>Pour aller plus loin</h1>
<ul>
<li><a href="http://www.virusphoto.com/">Virusphoto</a>, notamment <a href="http://www.virusphoto.com/15550-100-conseils-donnes-par-les-membres-pour-ameliorer-vos-photos.html">ce post sympa</a></li>
<li><a href="http://www.photo-evasion.com">Photo-evasion.com</a>, pour sa partie <a href="http://www.photo-evasion.com/articles/rubrique-infographie-retouche_photo_gimp-1.html">tuto de retouche d&#8217;images sous Gimp</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://vibby.beauvivre.fr/2011/03/10-conseils-pour-faire-de-belles-photos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla : C’est génial d&#8217;être libre de considérations commerciales !</title>
		<link>http://vibby.beauvivre.fr/2011/03/joomla/</link>
		<comments>http://vibby.beauvivre.fr/2011/03/joomla/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 16:45:05 +0000</pubDate>
		<dc:creator>vibby</dc:creator>
				<category><![CDATA[Avis et idées]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://vibby.beauvivre.fr/?p=61</guid>
		<description><![CDATA[Le 23 avril 2010 est paru une nouvelle version stable de Joomla : la 1.5.16, ou Wojmamni ama busani de son “petit” nom. Dans la foulée, deux failles (dont le niveau de sécurité est classé moyen) sont immédiatement repérées. On entend déjà les défenseur des solutions fermés qui clament “avec un logiciel sans accès aux [...]]]></description>
			<content:encoded><![CDATA[<p>Le 23 avril 2010 est paru une nouvelle version stable de Joomla : la 1.5.16, ou <em>Wojmamni ama busani</em> de son “petit” nom. Dans la foulée, deux failles (dont le niveau de sécurité est classé moyen) sont immédiatement repérées.<br />
<span id="more-61"></span> On entend déjà les défenseur des solutions fermés qui clament “avec un  logiciel sans accès aux sources, cette information ne serait pas repéré  ou beaucoup plus tard … “</p>
<div>Sauf que … la communauté étant ce qu’elle est, elle n’hésite pas, dès  demain (le 27 avril) a sortir une version 1.5.17 qui corrige quasi  exclusivement ces deux petits problèmes. Chose qui ne fait jamais chez  un grand éditeur de logiciels propriétaire. Vous vous rendez-compte ?  Admettre que la solution maison soit “trouée” le lendemain de sa sortie ?  L’image de la boite est en jeu ! On préfère laisser un logiciel avec un  trou peu connu et peu accessible (mais pas impossible à trouver), c’est  moins négatif en terme d’image. Cela me fait penser aux constructeurs  automobiles qui calculent si cela revient moins cher de faire un rappel  de ces véhicules ou de laisser aller et venir des pièces défectueuses et  des risques d’accident, tout en prenant en compte l’impact d’une telle  campagne sur ses clients.<br />
Alors que dans une communauté c’est tout l’inverse, c’est aussi l’image  de la solution qui est jeu, et c’est justement pour cela que l’on va  décider fixer ce problème immédiatement quitte à paraitre ridicule : la  qualité du produit est la priorité numéro 1.Bravo Joomla et bravo les contributeurs !&nbsp;</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vibby.beauvivre.fr/2011/03/joomla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Premier post</title>
		<link>http://vibby.beauvivre.fr/2011/03/bonjour-tout-le-monde/</link>
		<comments>http://vibby.beauvivre.fr/2011/03/bonjour-tout-le-monde/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 15:00:48 +0000</pubDate>
		<dc:creator>vibby</dc:creator>
				<category><![CDATA[Avis et idées]]></category>

		<guid isPermaLink="false">http://vibby.beauvivre.fr/?p=1</guid>
		<description><![CDATA[Ceci est le premier post du Blog ! J&#8217;aimerai en profiter pour vous présenter ce site que j&#8217;ai mis en place tout spécialement pour lui. J&#8217;ai envie de faire de cet endroit un terrain de jeu pour mettre en place de petites idées qui me trotte dans la tête Idées de post à développer : [...]]]></description>
			<content:encoded><![CDATA[<p>Ceci est le premier post du Blog ! J&#8217;aimerai en profiter pour vous présenter ce site que j&#8217;ai mis en place tout spécialement pour lui. J&#8217;ai envie de faire de cet endroit un terrain de jeu pour mettre en place de petites idées qui me trotte dans la tête <img src='http://vibby.beauvivre.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Idées de post à développer : JQuery forms : des petits trucs pour améliorer vos formulaires</p>
<ul></ul>
]]></content:encoded>
			<wfw:commentRss>http://vibby.beauvivre.fr/2011/03/bonjour-tout-le-monde/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

