3 * @copyright Copyright (C) 2010-2023, 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;
27 * This script can be included even when the app is in maintenance mode which requires us to avoid any config call
30 function duepuntozero_init(App $a) {
32 Renderer::setActiveTemplateEngine('smarty3');
36 if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
37 $colorset = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset');
39 $colorset = DI::config()->get('duepuntozero', 'colorset'); // user setting have priority, then node settings
43 if ($colorset == 'greenzero')
44 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />' . "\n";
45 if ($colorset == 'purplezero')
46 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />' . "\n";
47 if ($colorset == 'easterbunny')
48 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />' . "\n";
49 if ($colorset == 'darkzero')
50 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />' . "\n";
51 if ($colorset == 'comix')
52 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />' . "\n";
53 if ($colorset == 'slackr')
54 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />' . "\n";
56 DI::page()['htmlhead'] .= <<< EOT
58 function cmtBbOpen(comment, id) {
59 if ($(comment).hasClass('comment-edit-text-full')) {
60 $(".comment-edit-bb-" + id).show();
65 function cmtBbClose(comment, id) {
68 $(document).ready(function() {
70 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
72 $('.circle-edit-icon').hover(
74 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
76 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
79 $('.sidebar-circle-element').hover(
81 id = $(this).attr('id');
82 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
85 id = $(this).attr('id');
86 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
90 $('.savedsearchdrop').hover(
92 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
94 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
97 $('.savedsearchterm').hover(
99 id = $(this).attr('id');
100 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
103 id = $(this).attr('id');
104 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
112 * @param int|null $uid
114 * @see \Friendica\Core\Theme::getBackgroundColor()
115 * @TODO Implement this function
117 function duepuntozero_get_background_color(int $uid = null)
123 * @param int|null $uid
125 * @see \Friendica\Core\Theme::getThemeColor()
126 * @TODO Implement this function
128 function duepuntozero_get_theme_color(int $uid = null)