3 * @copyright Copyright (C) 2010-2022, the Friendica project
5 * @license GNU AGPL version 3 or any later version
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.
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.
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/>.
23 use Friendica\Core\Renderer;
24 use Friendica\Core\Session;
28 * This script can be included even when the app is in maintenance mode which requires us to avoid any config call
31 function duepuntozero_init(App $a) {
33 Renderer::setActiveTemplateEngine('smarty3');
37 if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
38 $colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset');
40 $colorset = DI::config()->get('duepuntozero', 'colorset'); // user setting have priority, then node settings
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";
57 DI::page()['htmlhead'] .= <<< EOT
59 function cmtBbOpen(comment, id) {
60 if ($(comment).hasClass('comment-edit-text-full')) {
61 $(".comment-edit-bb-" + id).show();
66 function cmtBbClose(comment, id) {
69 $(document).ready(function() {
71 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
73 $('.group-edit-icon').hover(
75 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
77 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
80 $('.sidebar-group-element').hover(
82 id = $(this).attr('id');
83 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
86 id = $(this).attr('id');
87 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
91 $('.savedsearchdrop').hover(
93 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
95 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
98 $('.savedsearchterm').hover(
100 id = $(this).attr('id');
101 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
104 id = $(this).attr('id');
105 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
113 * @param int|null $uid
115 * @see \Friendica\Core\Theme::getBackgroundColor()
116 * @TODO Implement this function
118 function duepuntozero_get_background_color(int $uid = null)
124 * @param int|null $uid
126 * @see \Friendica\Core\Theme::getThemeColor()
127 * @TODO Implement this function
129 function duepuntozero_get_theme_color(int $uid = null)