Changeset 10109


Ignore:
Timestamp:
04/06/11 16:53:34 (9 years ago)
Author:
flop25
Message:

Regex changed : use [\s]* instead of [\r\t\n]*
the div autre_content is displayed with prefiltrers

Location:
extensions/floPure/Pure_default
Files:
5 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/floPure/Pure_default/theme.css

    r10106 r10109  
    1717        margin: 0px; 
    1818        padding: 0px; 
    19 } 
    20 #content, .content { 
    21 margin-right:0; 
    2219} 
    2320.stuffs_block { 
  • extensions/floPure/Pure_default/themeconf.inc.php

    r10106 r10109  
    1616  'activable' => false, 
    1717); 
     18add_event_handler('loc_after_page_header', 'Pure_default_after_page_header'); 
     19function Pure_default_after_page_header() 
     20{ 
     21        global $template, $page; 
     22        if (isset($page['body_id']) and $page['body_id'] == 'theIdentificationPage') 
     23        { 
     24    $template->set_prefilter('identification', 'Pure_default_prefilter_identification'); 
     25        } 
     26        if (isset($page['body_id']) and $page['body_id'] == 'theNBMPage') 
     27        { 
     28    $template->set_prefilter('nbm', 'Pure_default_prefilter_nbm'); 
     29        } 
     30        if (isset($page['body_id']) and $page['body_id'] == 'theNotificationPage') 
     31        { 
     32                $template->set_prefilter('notification', 'Pure_default_prefilter_notification'); 
     33        } 
     34        if (isset($page['body_id']) and $page['body_id'] == 'thePasswordPage') 
     35        { 
     36                $template->set_prefilter('password', 'Pure_default_prefilter_password'); 
     37        } 
     38        if (isset($page['body_id']) and $page['body_id'] == 'theTagsPage') 
     39        { 
     40                $template->set_prefilter('tags', 'Pure_default_prefilter_tags'); 
     41        } 
     42        if (isset($page['body_id']) and $page['body_id'] == 'theAboutPage') 
     43        { 
     44                $template->set_prefilter('about', 'Pure_default_prefilter_about'); 
     45        } 
     46} 
    1847/** index.tpl **/ 
    1948add_event_handler('loc_end_index', 'Pure_default_index'); 
     
    105134} 
    106135 
     136/**************************** identification.tpl *****************************************************************/ 
     137function Pure_default_prefilter_identification($content, &$smarty) 
     138{ 
     139  $search = '#<form action="\{\$F_LOGIN_ACTION\}" method="post" name="login_form" class="properties">#';   
     140  $replacement = '<div id="autre_content"> 
     141<form action="{$F_LOGIN_ACTION}" method="post" name="login_form" class="properties"> 
     142'; 
     143  $content = preg_replace($search, $replacement, $content); 
     144  $search = '#</div>[\s]*<\!-- content -->#';   
     145  $replacement = '</div> 
     146        </div> <!-- content -->'; 
     147  return preg_replace($search, $replacement, $content); 
     148} 
     149/**************************** nbm.tpl *****************************************************************/ 
     150function Pure_default_prefilter_nbm($content, &$smarty) 
     151{ 
     152        $search = '#\{if not empty(\$errors)\}#';   
     153        $replacement = '<div id="autre_content"> 
     154{if not empty($errors)} 
     155'; 
     156        $content = preg_replace($search, $replacement, $content); 
     157        $search = '#\{/if\}[\s]*</div>#';   
     158        $replacement = '{/if} 
     159        </div> 
     160        </div> <!-- content -->'; 
     161        return preg_replace($search, $replacement, $content); 
     162} 
     163/**************************** notification.tpl *****************************************************************/ 
     164function Pure_default_prefilter_notification($content, &$smarty) 
     165{ 
     166        $search = '#<p>\{\'#';   
     167        $replacement = '<div id="autre_content"> 
     168<p>{\''; 
     169        $content = preg_replace($search, $replacement, $content); 
     170        $search = '#</dt>[\s]*</dl>#';   
     171        $replacement = '</dt> 
     172        </dl> 
     173</div>'; 
     174        return preg_replace($search, $replacement, $content); 
     175} 
     176/**************************** password.tpl *****************************************************************/ 
     177function Pure_default_prefilter_password($content, &$smarty) 
     178{ 
     179        $search = '#<form action=#';   
     180        $replacement = '<div id="autre_content"> 
     181<form action='; 
     182        $content = preg_replace($search, $replacement, $content); 
     183        $search = '#</div>[\s]*<!-- content -->#';   
     184        $replacement = '</div> 
     185        </div> <!-- content -->'; 
     186        return preg_replace($search, $replacement, $content); 
     187} 
     188/**************************** tags.tpl *****************************************************************/ 
     189function Pure_default_prefilter_tags($content, &$smarty) 
     190{ 
     191                $search = '#</h2>[\s]*</div>#';   
     192                $replacement = '</h2> 
     193  </div> 
     194<div id="autre_content">'; 
     195                $content = preg_replace($search, $replacement, $content); 
     196                $search = '#</div>[\s]*<!-- content -->#';   
     197                $replacement = '</div> 
     198                </div> <!-- content -->'; 
     199                return preg_replace($search, $replacement, $content); 
     200} 
     201/**************************** about.tpl *****************************************************************/ 
     202function Pure_default_prefilter_about($content, &$smarty) 
     203{ 
     204                $search = '#</h2>[\s]*</div>#';   
     205                $replacement = '</h2> 
     206  </div> 
     207<div id="autre_content">'; 
     208                $content = preg_replace($search, $replacement, $content); 
     209                $search = '#\{/if\}[\s]*</div>#';   
     210                $replacement = '{/if} 
     211  </div> 
     212  </div>'; 
     213                return preg_replace($search, $replacement, $content); 
     214} 
    107215?> 
Note: See TracChangeset for help on using the changeset viewer.