]> git.mxchange.org Git - friendica.git/blob - view/theme/smoothly/theme.php
Add Theme::getBackgroundColor and Theme::getThemeColor methods
[friendica.git] / view / theme / smoothly / theme.php
1 <?php
2
3 /*
4  * Name: Smoothly
5  * Description: Theme based on Testbubble and optimized for Tablets.
6  * Version: Version 2013-05-08
7  * Author: Anne Walk, Devlon Duthied
8  * Author: Alex <https://red.pixelbits.de/channel/alex>
9  * Maintainer: Nomen Nominandum
10  * Screenshot: <a href="screenshot.png">Screenshot</a>
11  */
12
13 use Friendica\App;
14 use Friendica\Core\Renderer;
15 use Friendica\DI;
16
17 function smoothly_init(App $a) {
18         Renderer::setActiveTemplateEngine('smarty3');
19
20         $cssFile = null;
21         $ssl_state = null;
22         $baseurl = DI::baseUrl()->get($ssl_state);
23         DI::page()['htmlhead'] .= <<< EOT
24
25 <script>
26 function cmtBbOpen(id) {
27         $(".comment-edit-bb-" + id).show();
28 }
29 function cmtBbClose(comment, id) {
30         $(".comment-edit-bb-" + id).hide();
31 }
32 $(document).ready(function() {
33
34         $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
35
36         $('.group-edit-icon').hover(
37                 function() {
38                         $(this).addClass('icon'); $(this).removeClass('iconspacer');},
39                 function() {
40                         $(this).removeClass('icon'); $(this).addClass('iconspacer');}
41         );
42
43         $('.sidebar-group-element').hover(
44                 function() {
45                         id = $(this).attr('id');
46                         $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
47
48                 function() {
49                         id = $(this).attr('id');
50                         $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
51         );
52
53
54         $('.savedsearchdrop').hover(
55                 function() {
56                         $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
57                 function() {
58                         $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
59         );
60
61         $('.savedsearchterm').hover(
62                 function() {
63                         id = $(this).attr('id');
64                         $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
65
66                 function() {
67                         id = $(this).attr('id');
68                         $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
69         );
70
71 });
72
73 </script>
74 EOT;
75
76         /** custom css **/
77         if (!is_null($cssFile)) {
78                 DI::page()['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
79         }
80
81         _js_in_foot();
82 }
83
84 if (! function_exists('_js_in_foot')) {
85         function _js_in_foot() {
86                 /** @purpose insert stuff in bottom of page
87                 */
88                 $ssl_state = null;
89                 $baseurl = DI::baseUrl()->get($ssl_state);
90                 $bottom['$baseurl'] = $baseurl;
91                 $tpl = Renderer::getMarkupTemplate('bottom.tpl');
92
93                 return DI::page()['bottom'] = Renderer::replaceMacros($tpl, $bottom);
94         }
95 }
96
97 /**
98  * @param int|null $uid
99  * @return null
100  * @see \Friendica\Core\Theme::getBackgroundColor()
101  * @TODO Implement this function
102  */
103 function smoothly_get_background_color(int $uid = null)
104 {
105         return null;
106 }
107
108 /**
109  * @param int|null $uid
110  * @return null
111  * @see \Friendica\Core\Theme::getThemeColor()
112  * @TODO Implement this function
113  */
114 function smoothly_get_theme_color(int $uid = null)
115 {
116         return null;
117 }