source: extensions/stripped_black_bloc/themeconf.inc.php @ 15595

Last change on this file since 15595 was 13920, checked in by flop25, 13 years ago

feature :
-ajax loading : js+loading.gif
bug correction :
-max width for Gmap

File size: 3.2 KB
Line 
1<?php
2/*
3Theme Name: Stripped & Columns
4Version: auto
5Description: stripped_black_bloc
6Theme URI: http://piwigo.org/ext/extension_view.php?eid=568
7Author: flop25
8Author URI: http://www.planete-flop.fr
9*/
10
11
12 
13$themeconf = array(
14  'parent' => 'stripped',
15  'name' => 'stripped_black_bloc',
16  'theme_dir' => 'stripped_black_bloc',
17  'icon_dir' => 'themes/stripped/icon',
18  'img_dir' => 'themes/stripped_black_bloc/img',
19  'admin_icon_dir' => 'themes/default/icon/admin',
20  'mime_icon_dir' => 'themes/default/icon/mimetypes/',
21  'local_head' => 'local_head.tpl',
22  'load_parent_local_head' => true,
23);
24global $stripped;
25$stripped['themeStyle']='original';
26
27load_language('theme.lang', PHPWG_THEMES_PATH.'stripped_black_bloc/');
28
29// Need upgrade?
30
31include(PHPWG_THEMES_PATH.'stripped_black_bloc/admin/upgrade.inc.php');
32
33add_event_handler('loc_begin_page_header', 'set_config_values_stripped_black_bloc');
34
35function set_config_values_stripped_black_bloc()
36{
37  global $conf, $template;
38  $config = unserialize( $conf['stripped_black_bloc'] );
39  $template->assign( 'stripped_black_bloc', $config );
40}
41
42/// EVENT
43
44/************************************ thumbnails and category_thumbnails ************************************/
45add_event_handler('loc_end_index_category_thumbnails', 'stripped_black_bloc');
46add_event_handler('loc_end_index_thumbnails', 'stripped_black_bloc');
47function stripped_black_bloc($tpl_thumbnails_var)
48{
49  global $template, $conf;
50  $config = unserialize( $conf['stripped_black_bloc'] );
51  $template->assign( 'stripped_black_bloc', $config );
52  $new_tplvar=array();
53  $i=1;
54  foreach ($tpl_thumbnails_var as $tplvar)
55  {
56    $tplvar['TN_CLASS']=($i==$config['starting_to']) ? "bloc_big" : "bloc";
57    $new_tplvar[]=$tplvar;
58    $i= ($i==$config['every_x']) ? 1 : $i+1 ;
59  }
60  return $new_tplvar;
61}
62add_event_handler('init', 'stripped_black_bloc_init');
63function stripped_black_bloc_init()
64{
65  remove_event_handler('loc_begin_index', 'modify_nb_thumbnail_page');
66}
67
68/************************************ index.tpl ************************************/
69add_event_handler('loc_end_index', 'stripped_black_bloc_index');
70function stripped_black_bloc_index()
71{
72    global $template;
73    $template->set_prefilter('index', 'stripped_black_bloc_prefilter_index');
74}
75function stripped_black_bloc_prefilter_index($content, &$smarty)
76{
77  $search = "#\{\'Menu\'\|@translate\}#"; 
78  $replacement = "{'Show/hide menu'|@translate}</span>";
79  $content = preg_replace($search, $replacement, $content);
80  $search = '#<div id="subcontent">#'; 
81  $replacement = "";
82  $content = preg_replace($search, $replacement, $content);
83  $search = '#\{if \!empty\(\$CONTENT_DESCRIPTION\) \}#'; 
84  $replacement = ' <div id="subcontent">
85
86  {if !empty($CONTENT_DESCRIPTION) }';
87  $content = preg_replace($search, $replacement, $content);
88  $search = '#\{if \!empty\(\$navbar\) \}[\s]*\{include file=\'navigation_bar\.tpl\'\|@get_extent:\'navbar\'\}[\s]*\{/if\}#'; 
89  $replacement = '';
90  $content = preg_replace($search, $replacement, $content);
91
92  $search = '#{\$PLUGIN_INDEX_CONTENT_AFTER}</div>{/if}.*</div>#s'; 
93  $replacement = '{$PLUGIN_INDEX_CONTENT_AFTER}</div>{/if}
94        </div>
95 {if !empty($navbar) }
96  {include file=\'navigation_bar.tpl\'|@get_extent:\'navbar\'}
97 {/if}';
98  return preg_replace($search, $replacement, $content);
99}
100
101?>
Note: See TracBrowser for help on using the repository browser.