Changeset 14390 for extensions/floOS


Ignore:
Timestamp:
04/25/12 11:45:21 (8 years ago)
Author:
flop25
Message:

feature :
-new system of prefilter : using *.pattern.php files

bug :
-sprite updated for 2.4 and css too
-patterns added for 2.4.x

Location:
extensions/floOS/OS_default
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/floOS/OS_default/iconset.css

    r10053 r14390  
    55        border:none; 
    66} 
    7 .pwg-state-disabled .pwg-icon-arrow-e{ background-position: 0 -144px; width: 22px; height: 22px; }  
    8 .pwg-state-disabled .pwg-icon-arrow-w{ background-position: 0 -360px; width: 22px; height: 22px; }  
    9 .pwg-state-disabled .pwg-icon-arrowstop-e{ background-position: 0 -504px; width: 22px; height: 22px; }  
    10 .pwg-state-disabled .pwg-icon-arrowstop-w{ background-position: 0 -648px; width: 22px; height: 22px; }  
     7.pwg-icon-apropos{ background-position: 0 0; width: 22px; height: 22px; }  
     8.pwg-icon-arrow-e{ background-position: 0 -37px; width: 22px; height: 22px; }  
     9.pwg-state-disabled .pwg-icon-arrow-e{ background-position: 0 -74px; width: 22px; height: 22px; }  
     10.pwg-icon-arrow-n{ background-position: 0 -111px; width: 22px; height: 22px; }  
     11.pwg-icon-arrow-w{ background-position: 0 -148px; width: 22px; height: 22px; }  
     12.pwg-state-disabled .pwg-icon-arrow-w{ background-position: 0 -185px; width: 22px; height: 22px; }  
     13.pwg-icon-arrowstop-e{ background-position: 0 -222px; width: 22px; height: 22px; }  
     14.pwg-state-disabled .pwg-icon-arrowstop-e{ background-position: 0 -259px; width: 22px; height: 22px; }  
     15.pwg-icon-arrowstop-w{ background-position: 0 -296px; width: 22px; height: 22px; }  
     16.pwg-state-disabled .pwg-icon-arrowstop-w{ background-position: 0 -333px; width: 22px; height: 22px; }  
     17.pwg-icon-caddie-add{ background-position: 0 -370px; width: 24px; height: 24px; }  
     18.pwg-icon-calendar{ background-position: 0 -409px; width: 22px; height: 22px; }  
     19.pwg-icon-camera-calendar{ background-position: 0 -446px; width: 24px; height: 24px; }  
     20.pwg-icon-camera-info{ background-position: 0 -485px; width: 22px; height: 22px; }  
     21.pwg-icon-category-edit{ background-position: 0 -522px; width: 22px; height: 22px; }  
     22.pwg-icon-category-view-flat{ background-position: 0 -559px; width: 22px; height: 22px; }  
     23.pwg-icon-category-view-normal{ background-position: 0 -596px; width: 22px; height: 22px; }  
     24.pwg-icon-chat{ background-position: 0 -633px; width: 22px; height: 22px; }  
     25.pwg-icon-clock-minus{ background-position: 0 -670px; width: 22px; height: 22px; }  
     26.pwg-icon-clock-plus{ background-position: 0 -707px; width: 22px; height: 22px; }  
     27.pwg-icon-close{ background-position: 0 -744px; width: 24px; height: 24px; }  
     28.pwg-icon-cloud{ background-position: 0 -783px; width: 22px; height: 22px; }  
     29.pwg-icon-edit{ background-position: 0 -820px; width: 22px; height: 22px; }  
     30.pwg-icon-favorite-add{ background-position: 0 -857px; width: 22px; height: 22px; }  
     31.pwg-icon-favorite-del{ background-position: 0 -894px; width: 22px; height: 22px; }  
     32.pwg-icon-filter-del{ background-position: 0 -931px; width: 24px; height: 24px; }  
     33.pwg-icon-filter{ background-position: 0 -970px; width: 24px; height: 24px; }  
     34.pwg-icon-help{ background-position: 0 -1009px; width: 22px; height: 22px; }  
     35.pwg-icon-home{ background-position: 0 -1046px; width: 22px; height: 22px; }  
     36.pwg-icon-letters{ background-position: 0 -1083px; width: 22px; height: 22px; }  
     37.pwg-icon-lost-password{ background-position: 0 -1120px; width: 24px; height: 24px; }  
     38.pwg-icon-pause{ background-position: 0 -1159px; width: 22px; height: 22px; }  
     39.pwg-icon-play{ background-position: 0 -1196px; width: 22px; height: 22px; }  
     40.pwg-icon-register{ background-position: 0 -1233px; width: 24px; height: 24px; }  
     41.pwg-icon-repeat-play{ background-position: 0 -1272px; width: 22px; height: 22px; }  
     42.pwg-icon-repeat-stop{ background-position: 0 -1309px; width: 22px; height: 22px; }  
     43.pwg-icon-representative{ background-position: 0 -1346px; width: 22px; height: 22px; }  
     44.pwg-icon-map, .pwg-icon-globe , .pwg-icon-rss{ background-position: 0 -1383px; width: 22px; height: 22px; }  
     45.pwg-icon-save{ background-position: 0 -1420px; width: 24px; height: 24px; }  
     46.pwg-icon-search{ background-position: 0 -1459px; width: 22px; height: 22px; }  
     47#derivativeSwitchLink{width: 48px !important; height: 24px; } 
     48.pwg-icon-sizes{ background-position: 0 -1496px; width: 48px; height: 24px; }  
     49.pwg-icon-slideshow{ background-position: 0 -1535px; width: 22px; height: 22px; }  
     50.pwg-icon-small_resizable{ background-position: 0 -1572px; width: 16px; height: 16px; }  
     51.pwg-icon-sort{ background-position: 0 -1603px; width: 24px; height: 24px; }  
     52.pwg-icon-stop{ background-position: 0 -1642px; width: 22px; height: 22px; }  
     53.pwg-icon-tag{ background-position: 0 -1679px; width: 22px; height: 22px; }  
     54.pwg-icon-upload{ background-position: 0 -1716px; width: 22px; height: 22px; }  
    1155 
    12 .pwg-icon-apropos{ background-position: 0 0; width: 22px; height: 22px; }  
    13 .pwg-icon-arrow-e{ background-position: 0 -72px; width: 22px; height: 22px; }  
    14 .pwg-icon-arrow-n{ background-position: 0 -216px; width: 22px; height: 22px; }  
    15 .pwg-icon-arrow-w{ background-position: 0 -288px; width: 22px; height: 22px; }  
    16 .pwg-icon-arrowstop-e{ background-position: 0 -432px; width: 22px; height: 22px; }  
    17 .pwg-icon-arrowstop-w{ background-position: 0 -576px; width: 22px; height: 22px; }  
    18  
    19 .pwg-icon-caddie-add{ background-position: 0 -720px; width: 24px; height: 24px; }  
    20 .pwg-icon-calendar{ background-position: 0 -794px; width: 22px; height: 22px; }  
    21 .pwg-icon-camera-calendar{ background-position: 0 -866px; width: 24px; height: 24px; }  
    22 .pwg-icon-camera-info{ background-position: 0 -940px; width: 22px; height: 22px; }  
    23 .pwg-icon-category-edit{ background-position: 0 -1012px; width: 22px; height: 22px; }  
    24 .pwg-icon-category-view-flat{ background-position: 0 -1084px; width: 22px; height: 22px; }  
    25 .pwg-icon-category-view-normal{ background-position: 0 -1156px; width: 22px; height: 22px; }  
    26 .pwg-icon-chat{ background-position: 0 -1228px; width: 22px; height: 22px; }  
    27 .pwg-icon-clock-minus{ background-position: 0 -1300px; width: 22px; height: 22px; }  
    28 .pwg-icon-clock-plus{ background-position: 0 -1372px; width: 22px; height: 22px; }  
    29 .pwg-icon-close{ background-position: 0 -1444px; width: 24px; height: 24px; }  
    30 .pwg-icon-cloud{ background-position: 0 -1518px; width: 22px; height: 22px; }  
    31 .pwg-icon-edit{ background-position: 0 -1590px; width: 22px; height: 22px; }  
    32 .pwg-icon-favorite-add{ background-position: 0 -1662px; width: 22px; height: 22px; }  
    33 .pwg-icon-favorite-del{ background-position: 0 -1734px; width: 22px; height: 22px; }  
    34 .pwg-icon-help{ background-position: 0 -1806px; width: 22px; height: 22px; }  
    35 .pwg-icon-home{ background-position: 0 -1878px; width: 22px; height: 22px; }  
    36 .pwg-icon-letters{ background-position: -74px 0; width: 22px; height: 22px; }  
    37 .pwg-icon-lost-password{ background-position: -74px -72px; width: 24px; height: 24px; }  
    38 .pwg-icon-pause{ background-position: -74px -146px; width: 22px; height: 22px; }  
    39 .pwg-icon-play{ background-position: -74px -218px; width: 22px; height: 22px; }  
    40 .pwg-icon-register{ background-position: -74px -290px; width: 24px; height: 24px; }  
    41 .pwg-icon-repeat-play{ background-position: -74px -364px; width: 22px; height: 22px; }  
    42 .pwg-icon-repeat-stop{ background-position: -74px -436px; width: 22px; height: 22px; }  
    43 .pwg-icon-representative{ background-position: -74px -508px; width: 22px; height: 22px; }  
    44 .pwg-icon-rss{ background-position: -74px -580px; width: 22px; height: 22px; }  
    45 .pwg-icon-save{ background-position: -74px -652px; width: 24px; height: 24px; }  
    46 .pwg-icon-search{ background-position: -74px -726px; width: 22px; height: 22px; }  
    47 .pwg-icon-slideshow{ background-position: -74px -798px; width: 22px; height: 22px; }  
    48 .pwg-icon-small_resizable{ background-position: -74px -870px; width: 16px; height: 16px; }  
    49 .pwg-icon-stop{ background-position: -74px -936px; width: 22px; height: 22px; }  
    50 .pwg-icon-tag{ background-position: -74px -1008px; width: 22px; height: 22px; }  
    51 .pwg-icon-upload{ background-position: -74px -1080px; width: 22px; height: 22px; }  
  • extensions/floOS/OS_default/themeconf.inc.php

    r11929 r14390  
    4747        } 
    4848} 
     49 
     50 
     51// function load_pattern 
     52// include the right ***.pattern.php 
     53// not compatible 2.2and<2.2 
     54 
     55function load_pattern() 
     56{ 
     57  global $pattern; 
     58  $pwgversion=str_replace('.','',PHPWG_VERSION); 
     59  $pwgversion_array=explode('.', PHPWG_VERSION); 
     60  if (file_exists($pwgversion.'pattern.php')) 
     61  { 
     62    include($pwgversion.'.pattern.php'); 
     63    return true; 
     64  } 
     65  elseif (file_exists(PHPWG_ROOT_PATH.'themes/OS_default/'.$pwgversion_array[0].$pwgversion_array[1].'x.pattern.php')) 
     66  { 
     67    include(PHPWG_ROOT_PATH.'themes/OS_default/'.$pwgversion_array[0].$pwgversion_array[1].'x.pattern.php'); 
     68    return true; 
     69  } 
     70  else 
     71  { 
     72    $list_pattern_path=array(); 
     73    $dir=PHPWG_ROOT_PATH.'themes/OS_default'; 
     74    $dh = opendir($dir); 
     75    while (($file = readdir ($dh)) !== false ) { 
     76      if ($file !== '.' && $file !== '..') { 
     77        $path =$dir.'/'.$file; 
     78        if (!is_dir ($path)) {  
     79          if(strpos($file,'pattern.php')!==false) { //On ne prend que les .pattern.php 
     80            $list_pattern_path[]=$file; 
     81          } 
     82        } 
     83      } 
     84    } 
     85    closedir($dh); 
     86    $f=0; 
     87    for($i = 10; $i >=0; $i--) 
     88    { 
     89      if (in_array($pwgversion_array[0].$i.'.pattern.php',$list_pattern_path)) 
     90      { 
     91        include($pwgversion_array[0].$i.'.pattern.php'); 
     92        return true; 
     93        $f=1; 
     94        break; 
     95      } 
     96    } 
     97    if ($f=0) 
     98    { 
     99      return false; 
     100    } 
     101  } 
     102   
     103} 
     104if(!load_pattern()) 
     105{ 
     106  global $page; 
     107  $page['errors'][]='Theme not compatible'; 
     108} 
     109 
     110 
    49111/************************************ index.tpl ************************************/ 
    50112add_event_handler('loc_end_index', 'OS_default_index'); 
     
    56118function OS_default_prefilter_index($content, &$smarty) 
    57119{ 
    58   $search = '#<div id="content" class="content">#';   
    59   $replacement = '<div id="content" class="content"> 
    60   <table id="table_content" border="0" cellspacing="0" cellpadding="0"> 
    61     <tr> 
    62       <td id="section_up_left">&nbsp;</td> 
    63       <td id="section_up"> 
    64 '; 
    65   $content = preg_replace($search, $replacement, $content); 
    66  
    67   $search = '#</div>\{\* <\!-- titrePage --> \*\}#';   
    68   $replacement = ''; 
    69   $content = preg_replace($search, $replacement, $content); 
    70          
    71   $search = '#<h2>\{\$TITLE\}</h2>#';   
    72   $replacement = '<h2>{$TITLE}</h2> 
    73         </div>{* <!-- titrePage --> *}   
    74           </td> 
    75       <td id="section_up_right">&nbsp;</td> 
    76     </tr> 
    77     <tr> 
    78       <td id="section_left">&nbsp;</td> 
    79       <td id="section_in">'; 
    80   $content = preg_replace($search, $replacement, $content); 
    81          
    82   $search = '#\{if \!empty\(\$PLUGIN_INDEX_CONTENT_END\)\}\{\$PLUGIN_INDEX_CONTENT_END\}\{/if\}#';   
    83   $replacement = '{if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if} 
    84       </td> 
    85           <td id="section_right">&nbsp;</td> 
    86     </tr> 
    87     <tr> 
    88       <td id="section_bottom_left">&nbsp;</td> 
    89       <td id="section_bottom" >&nbsp;</td> 
    90       <td id="section_bottom_right" >&nbsp;</td> 
    91     </tr> 
    92   </table> 
    93 '; 
    94   return preg_replace($search, $replacement, $content); 
     120  global $pattern; 
     121  $r=$pattern['OS_default_prefilter_index']['R']; 
     122  $ps=$pattern['OS_default_prefilter_index']['S']; 
     123  foreach($r as $i => $pr) 
     124  { 
     125    $content = str_replace($ps[$i], $pr, $content); 
     126  } 
     127  return $content; 
    95128} 
    96129 
     
    104137function OS_default_prefilter_picture($content, &$smarty) 
    105138{ 
    106   $search = '#<div id="imageInfos">.*<table id="standard" class="infoTable">#s';   
    107   $replacement = '<table id="standard" class="infoTable">'; 
    108   return preg_replace($search, $replacement, $content); 
     139  global $pattern; 
     140  $r=$pattern['OS_default_prefilter_picture']['R']; 
     141  $ps=$pattern['OS_default_prefilter_picture']['S']; 
     142  foreach($r as $i => $pr) 
     143  { 
     144    $content = preg_replace($ps[$i], $pr, $content); 
     145  } 
     146  return $content; 
    109147} 
    110148 
    111  
    112  
    113149?> 
Note: See TracChangeset for help on using the changeset viewer.