]> git.mxchange.org Git - friendica.git/blob - view/theme/duepuntozero/theme.php
70190eb02cfdf4824484ffd4beeb1977f511e9b1
[friendica.git] / view / theme / duepuntozero / theme.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2022, the Friendica project
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Affero General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  *
20  */
21
22 use Friendica\App;
23 use Friendica\Core\Renderer;
24 use Friendica\Core\Session;
25 use Friendica\DI;
26
27 /*
28  * This script can be included even when the app is in maintenance mode which requires us to avoid any config call
29  */
30
31 function duepuntozero_init(App $a) {
32
33         Renderer::setActiveTemplateEngine('smarty3');
34
35         $colorset = null;
36
37         if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
38                 $colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset');
39                 if (!$colorset)
40                         $colorset = DI::config()->get('duepuntozero', 'colorset');          // user setting have priority, then node settings
41         }
42
43         if ($colorset) {
44                 if ($colorset == 'greenzero')
45                         DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />' . "\n";
46                 if ($colorset == 'purplezero')
47                         DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />' . "\n";
48                 if ($colorset == 'easterbunny')
49                         DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />' . "\n";
50                 if ($colorset == 'darkzero')
51                         DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />' . "\n";
52                 if ($colorset == 'comix')
53                         DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />' . "\n";
54                 if ($colorset == 'slackr')
55                         DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />' . "\n";
56         }
57 DI::page()['htmlhead'] .= <<< EOT
58 <script>
59 function cmtBbOpen(comment, id) {
60         if ($(comment).hasClass('comment-edit-text-full')) {
61                 $(".comment-edit-bb-" + id).show();
62                 return true;
63         }
64         return false;
65 }
66 function cmtBbClose(comment, id) {
67         return false;
68 }
69 $(document).ready(function() {
70
71         $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
72
73         $('.group-edit-icon').hover(
74                 function() {
75                         $(this).addClass('icon'); $(this).removeClass('iconspacer');},
76                 function() {
77                         $(this).removeClass('icon'); $(this).addClass('iconspacer');}
78         );
79
80         $('.sidebar-group-element').hover(
81                 function() {
82                         id = $(this).attr('id');
83                         $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
84
85                 function() {
86                         id = $(this).attr('id');
87                         $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
88         );
89
90
91         $('.savedsearchdrop').hover(
92                 function() {
93                         $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
94                 function() {
95                         $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
96         );
97
98         $('.savedsearchterm').hover(
99                 function() {
100                         id = $(this).attr('id');
101                         $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
102
103                 function() {
104                         id = $(this).attr('id');
105                         $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
106         );
107 });
108 </script>
109 EOT;
110 }
111
112 /**
113  * @param int|null $uid
114  * @return null
115  * @see \Friendica\Core\Theme::getBackgroundColor()
116  * @TODO Implement this function
117  */
118 function duepuntozero_get_background_color(int $uid = null)
119 {
120         return null;
121 }
122
123 /**
124  * @param int|null $uid
125  * @return null
126  * @see \Friendica\Core\Theme::getThemeColor()
127  * @TODO Implement this function
128  */
129 function duepuntozero_get_theme_color(int $uid = null)
130 {
131         return null;
132 }