Add license info at Friendica PHP files
[friendica.git/.git] / view / theme / duepuntozero / theme.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2020, Friendica
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\DI;
25
26 function duepuntozero_init(App $a) {
27
28 Renderer::setActiveTemplateEngine('smarty3');
29
30     $colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset');
31     if (!$colorset)
32        $colorset = DI::config()->get('duepuntozero', 'colorset');          // user setting have priority, then node settings
33     if ($colorset) {
34         if ($colorset == 'greenzero')
35             DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
36         if ($colorset == 'purplezero')
37                 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
38         if ($colorset == 'easterbunny')
39                 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
40         if ($colorset == 'darkzero')
41                 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n";
42         if ($colorset == 'comix')
43                 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
44         if ($colorset == 'slackr')
45                 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
46     }
47 DI::page()['htmlhead'] .= <<< EOT
48 <script>
49 function cmtBbOpen(comment, id) {
50         if ($(comment).hasClass('comment-edit-text-full')) {
51                 $(".comment-edit-bb-" + id).show();
52                 return true;
53         }
54         return false;
55 }
56 function cmtBbClose(comment, id) {
57         return false;
58 }
59 $(document).ready(function() {
60
61         $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
62
63         $('.group-edit-icon').hover(
64                 function() {
65                         $(this).addClass('icon'); $(this).removeClass('iconspacer');},
66                 function() {
67                         $(this).removeClass('icon'); $(this).addClass('iconspacer');}
68         );
69
70         $('.sidebar-group-element').hover(
71                 function() {
72                         id = $(this).attr('id');
73                         $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
74
75                 function() {
76                         id = $(this).attr('id');
77                         $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
78         );
79
80
81         $('.savedsearchdrop').hover(
82                 function() {
83                         $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
84                 function() {
85                         $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
86         );
87
88         $('.savedsearchterm').hover(
89                 function() {
90                         id = $(this).attr('id');
91                         $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
92
93                 function() {
94                         id = $(this).attr('id');
95                         $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
96         );
97 });
98 </script>
99 EOT;
100 }