Index: /extensions/floOS/OS_default/23x.pattern.php
===================================================================
--- /extensions/floOS/OS_default/23x.pattern.php	(revision 14390)
+++ /extensions/floOS/OS_default/23x.pattern.php	(revision 14390)
@@ -0,0 +1,34 @@
+<?php
+$pattern['OS_default_prefilter_index']['S']['table_content_begin']='<div id="content" class="content">';
+$pattern['OS_default_prefilter_index']['R']['table_content_begin']='<div id="content" class="content">
+  <table id="table_content" border="0" cellspacing="0" cellpadding="0">
+    <tr>
+      <td id="section_up_left">&nbsp;</td>
+      <td id="section_up">
+';
+$pattern['OS_default_prefilter_index']['S']['div_titrePage_deletion']='</div>{* <!-- titrePage --> *}';
+$pattern['OS_default_prefilter_index']['R']['div_titrePage_deletion']='';
+$pattern['OS_default_prefilter_index']['S']['div_titrePage_embed']='<h2>{$TITLE}</h2>';
+$pattern['OS_default_prefilter_index']['R']['div_titrePage_embed']='<h2>{$TITLE}</h2>
+	</div>{* <!-- titrePage --> *}  
+	  </td>
+      <td id="section_up_right">&nbsp;</td>
+    </tr>
+    <tr>
+      <td id="section_left">&nbsp;</td>
+      <td id="section_in">';
+$pattern['OS_default_prefilter_index']['S']['table_content_end']='{if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if}';
+$pattern['OS_default_prefilter_index']['R']['table_content_end']='{if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if}
+      </td>
+	  <td id="section_right">&nbsp;</td>
+    </tr>
+    <tr>
+      <td id="section_bottom_left">&nbsp;</td>
+      <td id="section_bottom" >&nbsp;</td>
+      <td id="section_bottom_right" >&nbsp;</td>
+    </tr>
+  </table>
+';
+$pattern['OS_default_prefilter_picture']['S']['div_imageInfos_deletion']='#<div id="imageInfos">.*<table id="standard" class="infoTable">#s';
+$pattern['OS_default_prefilter_picture']['R']['div_imageInfos_deletion']='<table id="standard" class="infoTable">';
+?>
Index: /extensions/floOS/OS_default/24x.pattern.php
===================================================================
--- /extensions/floOS/OS_default/24x.pattern.php	(revision 14390)
+++ /extensions/floOS/OS_default/24x.pattern.php	(revision 14390)
@@ -0,0 +1,34 @@
+<?php
+$pattern['OS_default_prefilter_index']['S']['table_content_begin']='<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">';
+$pattern['OS_default_prefilter_index']['R']['table_content_begin']='<div id="content" class="content{if isset($MENUBAR)} contentWithMenu{/if}">
+  <table id="table_content" border="0" cellspacing="0" cellpadding="0">
+    <tr>
+      <td id="section_up_left">&nbsp;</td>
+      <td id="section_up">
+';
+$pattern['OS_default_prefilter_index']['S']['div_titrePage_deletion']='</div>{* <!-- titrePage --> *}';
+$pattern['OS_default_prefilter_index']['R']['div_titrePage_deletion']='';
+$pattern['OS_default_prefilter_index']['S']['div_titrePage_embed']='<h2>{$TITLE}</h2>';
+$pattern['OS_default_prefilter_index']['R']['div_titrePage_embed']='<h2>{$TITLE}</h2>
+	</div>{* <!-- titrePage --> *}  
+	  </td>
+      <td id="section_up_right">&nbsp;</td>
+    </tr>
+    <tr>
+      <td id="section_left">&nbsp;</td>
+      <td id="section_in">';
+$pattern['OS_default_prefilter_index']['S']['table_content_end']='{if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if}';
+$pattern['OS_default_prefilter_index']['R']['table_content_end']='{if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if}
+      </td>
+	  <td id="section_right">&nbsp;</td>
+    </tr>
+    <tr>
+      <td id="section_bottom_left">&nbsp;</td>
+      <td id="section_bottom" >&nbsp;</td>
+      <td id="section_bottom_right" >&nbsp;</td>
+    </tr>
+  </table>
+';
+$pattern['OS_default_prefilter_picture']['S']['div_imageInfos_deletion']='#<div id="imageInfos">.*<dl id="standard" class="imageInfoTable">#s';
+$pattern['OS_default_prefilter_picture']['R']['div_imageInfos_deletion']='<dl id="standard" class="imageInfoTable">';
+?>
Index: /extensions/floOS/OS_default/iconset.css
===================================================================
--- /extensions/floOS/OS_default/iconset.css	(revision 14389)
+++ /extensions/floOS/OS_default/iconset.css	(revision 14390)
@@ -5,47 +5,51 @@
 	border:none;
 }
-.pwg-state-disabled .pwg-icon-arrow-e{ background-position: 0 -144px; width: 22px; height: 22px; } 
-.pwg-state-disabled .pwg-icon-arrow-w{ background-position: 0 -360px; width: 22px; height: 22px; } 
-.pwg-state-disabled .pwg-icon-arrowstop-e{ background-position: 0 -504px; width: 22px; height: 22px; } 
-.pwg-state-disabled .pwg-icon-arrowstop-w{ background-position: 0 -648px; width: 22px; height: 22px; } 
+.pwg-icon-apropos{ background-position: 0 0; width: 22px; height: 22px; } 
+.pwg-icon-arrow-e{ background-position: 0 -37px; width: 22px; height: 22px; } 
+.pwg-state-disabled .pwg-icon-arrow-e{ background-position: 0 -74px; width: 22px; height: 22px; } 
+.pwg-icon-arrow-n{ background-position: 0 -111px; width: 22px; height: 22px; } 
+.pwg-icon-arrow-w{ background-position: 0 -148px; width: 22px; height: 22px; } 
+.pwg-state-disabled .pwg-icon-arrow-w{ background-position: 0 -185px; width: 22px; height: 22px; } 
+.pwg-icon-arrowstop-e{ background-position: 0 -222px; width: 22px; height: 22px; } 
+.pwg-state-disabled .pwg-icon-arrowstop-e{ background-position: 0 -259px; width: 22px; height: 22px; } 
+.pwg-icon-arrowstop-w{ background-position: 0 -296px; width: 22px; height: 22px; } 
+.pwg-state-disabled .pwg-icon-arrowstop-w{ background-position: 0 -333px; width: 22px; height: 22px; } 
+.pwg-icon-caddie-add{ background-position: 0 -370px; width: 24px; height: 24px; } 
+.pwg-icon-calendar{ background-position: 0 -409px; width: 22px; height: 22px; } 
+.pwg-icon-camera-calendar{ background-position: 0 -446px; width: 24px; height: 24px; } 
+.pwg-icon-camera-info{ background-position: 0 -485px; width: 22px; height: 22px; } 
+.pwg-icon-category-edit{ background-position: 0 -522px; width: 22px; height: 22px; } 
+.pwg-icon-category-view-flat{ background-position: 0 -559px; width: 22px; height: 22px; } 
+.pwg-icon-category-view-normal{ background-position: 0 -596px; width: 22px; height: 22px; } 
+.pwg-icon-chat{ background-position: 0 -633px; width: 22px; height: 22px; } 
+.pwg-icon-clock-minus{ background-position: 0 -670px; width: 22px; height: 22px; } 
+.pwg-icon-clock-plus{ background-position: 0 -707px; width: 22px; height: 22px; } 
+.pwg-icon-close{ background-position: 0 -744px; width: 24px; height: 24px; } 
+.pwg-icon-cloud{ background-position: 0 -783px; width: 22px; height: 22px; } 
+.pwg-icon-edit{ background-position: 0 -820px; width: 22px; height: 22px; } 
+.pwg-icon-favorite-add{ background-position: 0 -857px; width: 22px; height: 22px; } 
+.pwg-icon-favorite-del{ background-position: 0 -894px; width: 22px; height: 22px; } 
+.pwg-icon-filter-del{ background-position: 0 -931px; width: 24px; height: 24px; } 
+.pwg-icon-filter{ background-position: 0 -970px; width: 24px; height: 24px; } 
+.pwg-icon-help{ background-position: 0 -1009px; width: 22px; height: 22px; } 
+.pwg-icon-home{ background-position: 0 -1046px; width: 22px; height: 22px; } 
+.pwg-icon-letters{ background-position: 0 -1083px; width: 22px; height: 22px; } 
+.pwg-icon-lost-password{ background-position: 0 -1120px; width: 24px; height: 24px; } 
+.pwg-icon-pause{ background-position: 0 -1159px; width: 22px; height: 22px; } 
+.pwg-icon-play{ background-position: 0 -1196px; width: 22px; height: 22px; } 
+.pwg-icon-register{ background-position: 0 -1233px; width: 24px; height: 24px; } 
+.pwg-icon-repeat-play{ background-position: 0 -1272px; width: 22px; height: 22px; } 
+.pwg-icon-repeat-stop{ background-position: 0 -1309px; width: 22px; height: 22px; } 
+.pwg-icon-representative{ background-position: 0 -1346px; width: 22px; height: 22px; } 
+.pwg-icon-map, .pwg-icon-globe , .pwg-icon-rss{ background-position: 0 -1383px; width: 22px; height: 22px; } 
+.pwg-icon-save{ background-position: 0 -1420px; width: 24px; height: 24px; } 
+.pwg-icon-search{ background-position: 0 -1459px; width: 22px; height: 22px; } 
+#derivativeSwitchLink{width: 48px !important; height: 24px; }
+.pwg-icon-sizes{ background-position: 0 -1496px; width: 48px; height: 24px; } 
+.pwg-icon-slideshow{ background-position: 0 -1535px; width: 22px; height: 22px; } 
+.pwg-icon-small_resizable{ background-position: 0 -1572px; width: 16px; height: 16px; } 
+.pwg-icon-sort{ background-position: 0 -1603px; width: 24px; height: 24px; } 
+.pwg-icon-stop{ background-position: 0 -1642px; width: 22px; height: 22px; } 
+.pwg-icon-tag{ background-position: 0 -1679px; width: 22px; height: 22px; } 
+.pwg-icon-upload{ background-position: 0 -1716px; width: 22px; height: 22px; } 
 
-.pwg-icon-apropos{ background-position: 0 0; width: 22px; height: 22px; } 
-.pwg-icon-arrow-e{ background-position: 0 -72px; width: 22px; height: 22px; } 
-.pwg-icon-arrow-n{ background-position: 0 -216px; width: 22px; height: 22px; } 
-.pwg-icon-arrow-w{ background-position: 0 -288px; width: 22px; height: 22px; } 
-.pwg-icon-arrowstop-e{ background-position: 0 -432px; width: 22px; height: 22px; } 
-.pwg-icon-arrowstop-w{ background-position: 0 -576px; width: 22px; height: 22px; } 
-
-.pwg-icon-caddie-add{ background-position: 0 -720px; width: 24px; height: 24px; } 
-.pwg-icon-calendar{ background-position: 0 -794px; width: 22px; height: 22px; } 
-.pwg-icon-camera-calendar{ background-position: 0 -866px; width: 24px; height: 24px; } 
-.pwg-icon-camera-info{ background-position: 0 -940px; width: 22px; height: 22px; } 
-.pwg-icon-category-edit{ background-position: 0 -1012px; width: 22px; height: 22px; } 
-.pwg-icon-category-view-flat{ background-position: 0 -1084px; width: 22px; height: 22px; } 
-.pwg-icon-category-view-normal{ background-position: 0 -1156px; width: 22px; height: 22px; } 
-.pwg-icon-chat{ background-position: 0 -1228px; width: 22px; height: 22px; } 
-.pwg-icon-clock-minus{ background-position: 0 -1300px; width: 22px; height: 22px; } 
-.pwg-icon-clock-plus{ background-position: 0 -1372px; width: 22px; height: 22px; } 
-.pwg-icon-close{ background-position: 0 -1444px; width: 24px; height: 24px; } 
-.pwg-icon-cloud{ background-position: 0 -1518px; width: 22px; height: 22px; } 
-.pwg-icon-edit{ background-position: 0 -1590px; width: 22px; height: 22px; } 
-.pwg-icon-favorite-add{ background-position: 0 -1662px; width: 22px; height: 22px; } 
-.pwg-icon-favorite-del{ background-position: 0 -1734px; width: 22px; height: 22px; } 
-.pwg-icon-help{ background-position: 0 -1806px; width: 22px; height: 22px; } 
-.pwg-icon-home{ background-position: 0 -1878px; width: 22px; height: 22px; } 
-.pwg-icon-letters{ background-position: -74px 0; width: 22px; height: 22px; } 
-.pwg-icon-lost-password{ background-position: -74px -72px; width: 24px; height: 24px; } 
-.pwg-icon-pause{ background-position: -74px -146px; width: 22px; height: 22px; } 
-.pwg-icon-play{ background-position: -74px -218px; width: 22px; height: 22px; } 
-.pwg-icon-register{ background-position: -74px -290px; width: 24px; height: 24px; } 
-.pwg-icon-repeat-play{ background-position: -74px -364px; width: 22px; height: 22px; } 
-.pwg-icon-repeat-stop{ background-position: -74px -436px; width: 22px; height: 22px; } 
-.pwg-icon-representative{ background-position: -74px -508px; width: 22px; height: 22px; } 
-.pwg-icon-rss{ background-position: -74px -580px; width: 22px; height: 22px; } 
-.pwg-icon-save{ background-position: -74px -652px; width: 24px; height: 24px; } 
-.pwg-icon-search{ background-position: -74px -726px; width: 22px; height: 22px; } 
-.pwg-icon-slideshow{ background-position: -74px -798px; width: 22px; height: 22px; } 
-.pwg-icon-small_resizable{ background-position: -74px -870px; width: 16px; height: 16px; } 
-.pwg-icon-stop{ background-position: -74px -936px; width: 22px; height: 22px; } 
-.pwg-icon-tag{ background-position: -74px -1008px; width: 22px; height: 22px; } 
-.pwg-icon-upload{ background-position: -74px -1080px; width: 22px; height: 22px; } 
Index: /extensions/floOS/OS_default/themeconf.inc.php
===================================================================
--- /extensions/floOS/OS_default/themeconf.inc.php	(revision 14389)
+++ /extensions/floOS/OS_default/themeconf.inc.php	(revision 14390)
@@ -47,4 +47,66 @@
 	}
 }
+
+
+// function load_pattern
+// include the right ***.pattern.php
+// not compatible 2.2and<2.2
+
+function load_pattern()
+{
+  global $pattern;
+  $pwgversion=str_replace('.','',PHPWG_VERSION);
+  $pwgversion_array=explode('.', PHPWG_VERSION);
+  if (file_exists($pwgversion.'pattern.php'))
+  {
+    include($pwgversion.'.pattern.php');
+    return true;
+  }
+  elseif (file_exists(PHPWG_ROOT_PATH.'themes/OS_default/'.$pwgversion_array[0].$pwgversion_array[1].'x.pattern.php'))
+  {
+    include(PHPWG_ROOT_PATH.'themes/OS_default/'.$pwgversion_array[0].$pwgversion_array[1].'x.pattern.php');
+    return true;
+  }
+  else
+  {
+    $list_pattern_path=array();
+    $dir=PHPWG_ROOT_PATH.'themes/OS_default';
+    $dh = opendir($dir);
+    while (($file = readdir ($dh)) !== false ) {
+      if ($file !== '.' && $file !== '..') {
+        $path =$dir.'/'.$file;
+        if (!is_dir ($path)) { 
+          if(strpos($file,'pattern.php')!==false) { //On ne prend que les .pattern.php
+            $list_pattern_path[]=$file;
+          }
+        }
+      }
+    }
+    closedir($dh);
+    $f=0;
+    for($i = 10; $i >=0; $i--)
+    {
+      if (in_array($pwgversion_array[0].$i.'.pattern.php',$list_pattern_path))
+      {
+        include($pwgversion_array[0].$i.'.pattern.php');
+        return true;
+        $f=1;
+        break;
+      }
+    }
+    if ($f=0)
+    {
+      return false;
+    }
+  }
+  
+}
+if(!load_pattern())
+{
+  global $page;
+  $page['errors'][]='Theme not compatible';
+}
+
+
 /************************************ index.tpl ************************************/
 add_event_handler('loc_end_index', 'OS_default_index');
@@ -56,41 +118,12 @@
 function OS_default_prefilter_index($content, &$smarty)
 {
-  $search = '#<div id="content" class="content">#';  
-  $replacement = '<div id="content" class="content">
-  <table id="table_content" border="0" cellspacing="0" cellpadding="0">
-    <tr>
-      <td id="section_up_left">&nbsp;</td>
-      <td id="section_up">
-';
-  $content = preg_replace($search, $replacement, $content);
-
-  $search = '#</div>\{\* <\!-- titrePage --> \*\}#';  
-  $replacement = '';
-  $content = preg_replace($search, $replacement, $content);
-	
-  $search = '#<h2>\{\$TITLE\}</h2>#';  
-  $replacement = '<h2>{$TITLE}</h2>
-	</div>{* <!-- titrePage --> *}  
-	  </td>
-      <td id="section_up_right">&nbsp;</td>
-    </tr>
-    <tr>
-      <td id="section_left">&nbsp;</td>
-      <td id="section_in">';
-  $content = preg_replace($search, $replacement, $content);
-	
-  $search = '#\{if \!empty\(\$PLUGIN_INDEX_CONTENT_END\)\}\{\$PLUGIN_INDEX_CONTENT_END\}\{/if\}#';  
-  $replacement = '{if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if}
-      </td>
-	  <td id="section_right">&nbsp;</td>
-    </tr>
-    <tr>
-      <td id="section_bottom_left">&nbsp;</td>
-      <td id="section_bottom" >&nbsp;</td>
-      <td id="section_bottom_right" >&nbsp;</td>
-    </tr>
-  </table>
-';
-  return preg_replace($search, $replacement, $content);
+  global $pattern;
+  $r=$pattern['OS_default_prefilter_index']['R'];
+  $ps=$pattern['OS_default_prefilter_index']['S'];
+  foreach($r as $i => $pr)
+  {
+    $content = str_replace($ps[$i], $pr, $content);
+  }
+  return $content;
 }
 
@@ -104,10 +137,13 @@
 function OS_default_prefilter_picture($content, &$smarty)
 {
-  $search = '#<div id="imageInfos">.*<table id="standard" class="infoTable">#s';  
-  $replacement = '<table id="standard" class="infoTable">';
-  return preg_replace($search, $replacement, $content);
+  global $pattern;
+  $r=$pattern['OS_default_prefilter_picture']['R'];
+  $ps=$pattern['OS_default_prefilter_picture']['S'];
+  foreach($r as $i => $pr)
+  {
+    $content = preg_replace($ps[$i], $pr, $content);
+  }
+  return $content;
 }
 
-
-
 ?>
