]> git.mxchange.org Git - friendica.git/blob - view/theme/smoothly/theme.php
Adapt BaseURL calls to new UriInterface
[friendica.git] / view / theme / smoothly / theme.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2023, 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  * Name: Vier
21  * Version: 1.2
22  * Author: Fabio <http://kirgroup.com/profile/fabrixxm>
23  * Author: Ike <http://pirati.ca/profile/heluecht>
24  * Author: Beanow <https://fc.oscp.info/profile/beanow>
25  * Maintainer: Ike <http://pirati.ca/profile/heluecht>
26  * Description: "Vier" is a very compact and modern theme. It uses the font awesome font library: http://fortawesome.github.com/Font-Awesome/
27  */
28
29 /*
30  * Name: Smoothly
31  * Description: Theme based on Testbubble and optimized for Tablets.
32  * Version: Version 2013-05-08
33  * Author: Anne Walk, Devlon Duthied
34  * Author: Alex <https://red.pixelbits.de/channel/alex>
35  * Maintainer: Nomen Nominandum
36  * Screenshot: <a href="screenshot.png">Screenshot</a>
37  */
38
39 use Friendica\App;
40 use Friendica\Core\Renderer;
41 use Friendica\DI;
42
43 /*
44  * This script can be included even when the app is in maintenance mode which requires us to avoid any config call
45  */
46
47 function smoothly_init(App $a) {
48         Renderer::setActiveTemplateEngine('smarty3');
49
50         $cssFile = null;
51         $ssl_state = false;
52         $baseurl = DI::baseUrl();
53         DI::page()['htmlhead'] .= <<< EOT
54
55 <script>
56 function cmtBbOpen(id) {
57         $(".comment-edit-bb-" + id).show();
58 }
59 function cmtBbClose(comment, id) {
60         $(".comment-edit-bb-" + id).hide();
61 }
62 $(document).ready(function() {
63
64         $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
65
66         $('.group-edit-icon').hover(
67                 function() {
68                         $(this).addClass('icon'); $(this).removeClass('iconspacer');},
69                 function() {
70                         $(this).removeClass('icon'); $(this).addClass('iconspacer');}
71         );
72
73         $('.sidebar-group-element').hover(
74                 function() {
75                         id = $(this).attr('id');
76                         $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
77
78                 function() {
79                         id = $(this).attr('id');
80                         $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
81         );
82
83
84         $('.savedsearchdrop').hover(
85                 function() {
86                         $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
87                 function() {
88                         $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
89         );
90
91         $('.savedsearchterm').hover(
92                 function() {
93                         id = $(this).attr('id');
94                         $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
95
96                 function() {
97                         id = $(this).attr('id');
98                         $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
99         );
100
101 });
102
103 </script>
104 EOT;
105
106         /** custom css **/
107         if (!is_null($cssFile)) {
108                 DI::page()['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
109         }
110
111         _js_in_foot();
112 }
113
114 if (! function_exists('_js_in_foot')) {
115         function _js_in_foot() {
116                 /** @purpose insert stuff in bottom of page
117                 */
118                 $ssl_state = false;
119                 $baseurl = DI::baseUrl();
120                 $bottom['$baseurl'] = $baseurl;
121                 $tpl = Renderer::getMarkupTemplate('bottom.tpl');
122
123                 return DI::page()['bottom'] = Renderer::replaceMacros($tpl, $bottom);
124         }
125 }
126
127 /**
128  * @param int|null $uid
129  * @return null
130  * @see \Friendica\Core\Theme::getBackgroundColor()
131  * @TODO Implement this function
132  */
133 function smoothly_get_background_color(int $uid = null)
134 {
135         return null;
136 }
137
138 /**
139  * @param int|null $uid
140  * @return null
141  * @see \Friendica\Core\Theme::getThemeColor()
142  * @TODO Implement this function
143  */
144 function smoothly_get_theme_color(int $uid = null)
145 {
146         return null;
147 }