1 | <?php |
---|
2 | /* |
---|
3 | Theme Name: Pure_default |
---|
4 | Version: auto |
---|
5 | Description: |
---|
6 | Theme URI: http://piwigo.org/ext/extension_view.php?eid=384 |
---|
7 | Author: flop25 |
---|
8 | Author URI: http://www.planete-flop.fr |
---|
9 | */ |
---|
10 | $themeconf = array( |
---|
11 | 'name' => 'Pure_default', |
---|
12 | 'parent' => 'default', |
---|
13 | 'icon_dir' => 'themes/Pure_default/icon', |
---|
14 | 'mime_icon_dir' => 'themes/Pure_default/icon/mimetypes/', |
---|
15 | 'local_head' => 'local_head.tpl', |
---|
16 | 'activable' => false, |
---|
17 | ); |
---|
18 | add_event_handler('loc_after_page_header', 'Pure_default_after_page_header'); |
---|
19 | function 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 | if (isset($page['body_id']) and $page['body_id'] == 'thePopuphelpPage') |
---|
47 | { |
---|
48 | $template->set_prefilter('popuphelp', 'Pure_default_prefilter_popuphelp'); |
---|
49 | } |
---|
50 | } |
---|
51 | /************************************ index.tpl ************************************/ |
---|
52 | add_event_handler('loc_end_index', 'Pure_default_index'); |
---|
53 | function Pure_default_index() |
---|
54 | { |
---|
55 | global $template; |
---|
56 | $template->set_prefilter('index', 'Pure_default_prefilter_index'); |
---|
57 | } |
---|
58 | function Pure_default_prefilter_index($content, &$smarty) |
---|
59 | { |
---|
60 | $search = '#<div id="content" class="content">#'; |
---|
61 | $replacement = '<div id="content" class="content"> |
---|
62 | <table id="table_content" border="0" cellspacing="0" cellpadding="0"> |
---|
63 | <tr> |
---|
64 | <td id="section_up_left"> </td> |
---|
65 | <td id="section_up"> </td> |
---|
66 | <td id="section_up_right"> </td> |
---|
67 | </tr> |
---|
68 | <tr> |
---|
69 | <td id="section_left"> </td> |
---|
70 | <td id="section_in"> |
---|
71 | '; |
---|
72 | $content = preg_replace($search, $replacement, $content); |
---|
73 | |
---|
74 | $search = '#\{if \!empty\(\$PLUGIN_INDEX_CONTENT_END\)\}\{\$PLUGIN_INDEX_CONTENT_END\}\{/if\}#'; |
---|
75 | $replacement = '{if !empty($PLUGIN_INDEX_CONTENT_END)}{$PLUGIN_INDEX_CONTENT_END}{/if} |
---|
76 | </td> |
---|
77 | <td id="section_right"> </td> |
---|
78 | </tr> |
---|
79 | <tr> |
---|
80 | <td id="section_bottom_left"> </td> |
---|
81 | <td id="section_bottom" > </td> |
---|
82 | <td id="section_bottom_right" > </td> |
---|
83 | </tr> |
---|
84 | </table> |
---|
85 | '; |
---|
86 | return preg_replace($search, $replacement, $content); |
---|
87 | } |
---|
88 | /************************************ picture.tpl ************************************/ |
---|
89 | add_event_handler('loc_begin_picture', 'Pure_default_picture'); |
---|
90 | function Pure_default_picture() |
---|
91 | { |
---|
92 | global $template; |
---|
93 | $template->set_prefilter('picture', 'Pure_default_prefilter_picture'); |
---|
94 | } |
---|
95 | function Pure_default_prefilter_picture($content, &$smarty) |
---|
96 | { |
---|
97 | $search = '#<div id="content" class="pictureContent">#'; |
---|
98 | $replacement = '<div id="content" class="pictureContent"> |
---|
99 | <table id="table_content" border="0" cellspacing="0" cellpadding="0"> |
---|
100 | <tr> |
---|
101 | <td id="section_up_left"> </td> |
---|
102 | <td id="section_up"> </td> |
---|
103 | <td id="section_up_right"> </td> |
---|
104 | </tr> |
---|
105 | <tr> |
---|
106 | <td id="section_left"> </td> |
---|
107 | <td id="section_in"> |
---|
108 | '; |
---|
109 | $content = preg_replace($search, $replacement, $content); |
---|
110 | |
---|
111 | $search = '#\{if \!empty\(\$PLUGIN_PICTURE_AFTER\)\}\{\$PLUGIN_PICTURE_AFTER\}\{/if\}#'; |
---|
112 | $replacement = '{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if} |
---|
113 | </td> |
---|
114 | <td id="section_right"> </td> |
---|
115 | </tr> |
---|
116 | <tr> |
---|
117 | <td id="section_bottom_left"> </td> |
---|
118 | <td id="section_bottom" > </td> |
---|
119 | <td id="section_bottom_right" > </td> |
---|
120 | </tr> |
---|
121 | </table> |
---|
122 | '; |
---|
123 | return preg_replace($search, $replacement, $content); |
---|
124 | } |
---|
125 | |
---|
126 | /**************************** identification.tpl *****************************************************************/ |
---|
127 | function Pure_default_prefilter_identification($content, &$smarty) |
---|
128 | { |
---|
129 | $search = '#<form action="\{\$F_LOGIN_ACTION\}" method="post" name="login_form" class="properties">#'; |
---|
130 | $replacement = '<div id="autre_content"> |
---|
131 | <form action="{$F_LOGIN_ACTION}" method="post" name="login_form" class="properties"> |
---|
132 | '; |
---|
133 | $content = preg_replace($search, $replacement, $content); |
---|
134 | $search = '#</div>[\s]*<\!-- content -->#'; |
---|
135 | $replacement = '</div> |
---|
136 | </div> <!-- content -->'; |
---|
137 | return preg_replace($search, $replacement, $content); |
---|
138 | } |
---|
139 | /**************************** nbm.tpl *****************************************************************/ |
---|
140 | function Pure_default_prefilter_nbm($content, &$smarty) |
---|
141 | { |
---|
142 | $search = '#\{if not empty(\$errors)\}#'; |
---|
143 | $replacement = '<div id="autre_content"> |
---|
144 | {if not empty($errors)} |
---|
145 | '; |
---|
146 | $content = preg_replace($search, $replacement, $content); |
---|
147 | $search = '#\{/if\}[\s]*</div>#'; |
---|
148 | $replacement = '{/if} |
---|
149 | </div> |
---|
150 | </div> <!-- content -->'; |
---|
151 | return preg_replace($search, $replacement, $content); |
---|
152 | } |
---|
153 | /**************************** notification.tpl *****************************************************************/ |
---|
154 | function Pure_default_prefilter_notification($content, &$smarty) |
---|
155 | { |
---|
156 | $search = '#<p>\{\'#'; |
---|
157 | $replacement = '<div id="autre_content"> |
---|
158 | <p>{\''; |
---|
159 | $content = preg_replace($search, $replacement, $content); |
---|
160 | $search = '#</dt>[\s]*</dl>#'; |
---|
161 | $replacement = '</dt> |
---|
162 | </dl> |
---|
163 | </div>'; |
---|
164 | return preg_replace($search, $replacement, $content); |
---|
165 | } |
---|
166 | /**************************** password.tpl *****************************************************************/ |
---|
167 | function Pure_default_prefilter_password($content, &$smarty) |
---|
168 | { |
---|
169 | $search = '#<form action=#'; |
---|
170 | $replacement = '<div id="autre_content"> |
---|
171 | <form action='; |
---|
172 | $content = preg_replace($search, $replacement, $content); |
---|
173 | $search = '#</div>[\s]*<!-- content -->#'; |
---|
174 | $replacement = '</div> |
---|
175 | </div> <!-- content -->'; |
---|
176 | return preg_replace($search, $replacement, $content); |
---|
177 | } |
---|
178 | /**************************** tags.tpl *****************************************************************/ |
---|
179 | function Pure_default_prefilter_tags($content, &$smarty) |
---|
180 | { |
---|
181 | $search = '#</h2>[\s]*</div>#'; |
---|
182 | $replacement = '</h2> |
---|
183 | </div> |
---|
184 | <div id="autre_content">'; |
---|
185 | $content = preg_replace($search, $replacement, $content); |
---|
186 | $search = '#</div>[\s]*<!-- content -->#'; |
---|
187 | $replacement = '</div> |
---|
188 | </div> <!-- content -->'; |
---|
189 | return preg_replace($search, $replacement, $content); |
---|
190 | } |
---|
191 | /**************************** about.tpl *****************************************************************/ |
---|
192 | function Pure_default_prefilter_about($content, &$smarty) |
---|
193 | { |
---|
194 | $search = '#</h2>[\s]*</div>#'; |
---|
195 | $replacement = '</h2> |
---|
196 | </div> |
---|
197 | <div id="autre_content">'; |
---|
198 | $content = preg_replace($search, $replacement, $content); |
---|
199 | $search = '#\{/if\}[\s]*</div>#'; |
---|
200 | $replacement = '{/if} |
---|
201 | </div> |
---|
202 | </div>'; |
---|
203 | return preg_replace($search, $replacement, $content); |
---|
204 | } |
---|
205 | /**************************** popuphelp.tpl *****************************************************************/ |
---|
206 | function Pure_default_prefilter_popuphelp($content, &$smarty) |
---|
207 | { |
---|
208 | $search = '#</h2>[\s]*</div>#'; |
---|
209 | $replacement = '</h2> |
---|
210 | </div> |
---|
211 | <div id="autre_content">'; |
---|
212 | $content = preg_replace($search, $replacement, $content); |
---|
213 | $search = '#</div>[\s]*<!-- content -->#'; |
---|
214 | $replacement = '</div> |
---|
215 | </div> <!-- content -->'; |
---|
216 | return preg_replace($search, $replacement, $content); |
---|
217 | } |
---|
218 | |
---|
219 | ?> |
---|