source: extensions/sobre/trunk/themeconf.inc.php @ 10482

Last change on this file since 10482 was 10482, checked in by Gotcha, 13 years ago

Ne gère plus LLBGO

File size: 3.5 KB
Line 
1<?php
2
3/*
4Theme Name: Sobre
5Version: auto
6Description: Black and white theme, based on Yoga/dark.
7Theme URI: http://fr.piwigo.org/ext/extension_view.php?eid=375
8Author: Gotcha
9Author URI: http://www.julien-moreau.fr
10*/
11
12$themeconf = array(
13  'parent'              => 'default',
14  'name'                => 'Sobre',
15  'local_head'  => 'local_head.tpl',
16);
17
18/* Exemple pour les $conf sérialisés */
19/*
20$conf['picture_informations'] = unserialize($conf['picture_informations']);
21$conf['picture_informations']['author'] = false;
22$conf['picture_informations'] = serialize($conf['picture_informations']);
23*/
24
25/* Language */
26load_language('theme.lang', PHPWG_THEMES_PATH.'sobre/');
27
28add_event_handler('loc_begin_page_header', 'set_sbre_header');
29function set_sbre_header()
30{
31  global $page, $conf, $template;
32  $config = unserialize($conf['Sobre']);
33  if (isset($page['body_id']) and $page['body_id'] == 'theCategoryPage')
34  {
35    $header = isset($page['category']) ? $config['categories'] : $config['home'];
36  }
37  elseif (isset($page['body_id']) and $page['body_id'] == 'thePicturePage')
38  {
39    $header = $config['picture'];
40  }
41  else
42  {
43    $header = $config['other'];
44  }
45  $template->assign('display_sbre_banner', $header);
46}
47
48/* Ajout d'une icône RSS à la suite du champs "Notifications" dans le menu "Menu" (menubar) */
49add_event_handler('blockmanager_prepare_display', 'add_rss_icon');
50function add_rss_icon()
51{
52global $lang;
53  if (isset($lang['Notification'])) {
54    $lang['Notification'] .= '<img src="./themes/sobre/images/rss.png" style="float:right; margin-right:10px; position:inherit;" class="button_rss" alt="flux-rss"/>';
55  }
56  if (isset($lang['Notification RSS'])) {
57    $lang['Notification RSS'] .= '<img src="./themes/sobre/images/rss.png" style="float:right; margin-right:10px; position:inherit;" class="button_rss" alt="flux-rss"/>';
58  }
59}
60
61/* coa_albums.tpl */
62
63/* Mise en tableau des commentaires (ajout) */
64$this->set_prefilter('comments_on_albums', 'Addon_picture_Pendings_05');
65function Addon_picture_Pendings_05($content, &$smarty)
66{
67$pattern = '#<form method="post"(.*){/if}{\*comments\*}#ms';
68$replacement = '
69<form method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
70        <fieldset>
71                <label><textarea name="content" id="contentid" rows="5" cols="62" onFocus="if(this.value==\'Votre commentaire ici. Merci\')this.value=\'\'">Votre commentaire ici. Merci{$comment_add.CONTENT}</textarea></label>
72                <legend>{\'Add a comment\'|@translate}</legend>
73
74                  {if $comment_add.SHOW_AUTHOR}
75                    <span>
76                          <label id="commentateur">
77                            {\'upload author\'|@translate}
78                            <input type="text" name="author">
79                            <input type="submit" value="{\'Submit comment\'|@translate}">
80                      </label>
81                        <span>
82                  {else}
83                    <span>
84                          <label id="commentateur"><input type="submit" value="{\'Submit comment\'|@translate}"></label>
85                        </span>
86                  {/if}
87                <input type="hidden" name="key" value="{$comment_add.KEY}">
88        </fieldset>
89        </form>
90        {/if}
91</div>
92{/if}{*comments*}
93';
94return preg_replace($pattern, $replacement, $content);
95}
96
97
98/* comment_list.tpl & stuffs_comment_list.tpl */
99
100/* Petit formatage*/
101$this->set_prefilter('comments', 'Addon_comments_Pendings_text');
102$this->set_prefilter('stuffs', 'Addon_comments_Pendings_text');
103function Addon_comments_Pendings_text($content, &$smarty)
104{
105$pattern = '<span class="author">{$comment.AUTHOR}</span> - <span class="date">{$comment.DATE}</span>';
106$replacement = '<span class="author">{$comment.AUTHOR}</span><span class="date"> - {$comment.DATE}</span>';
107return str_replace($pattern, $replacement, $content);
108}
109
110?>
Note: See TracBrowser for help on using the repository browser.