]> git.mxchange.org Git - friendica.git/blob - view/theme/duepuntozero/theme.php
Move PConfig::get() to DI::pConfig()->get()
[friendica.git] / view / theme / duepuntozero / theme.php
1 <?php
2
3 use Friendica\App;
4 use Friendica\Core\Config;
5 use Friendica\Core\PConfig;
6 use Friendica\Core\Renderer;
7 use Friendica\DI;
8
9 function duepuntozero_init(App $a) {
10
11 Renderer::setActiveTemplateEngine('smarty3');
12
13     $colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset');
14     if (!$colorset)
15        $colorset = Config::get('duepuntozero', 'colorset');          // user setting have priority, then node settings
16     if ($colorset) {
17         if ($colorset == 'greenzero')
18             DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
19         if ($colorset == 'purplezero')
20                 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
21         if ($colorset == 'easterbunny')
22                 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
23         if ($colorset == 'darkzero')
24                 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n";
25         if ($colorset == 'comix')
26                 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
27         if ($colorset == 'slackr')
28                 DI::page()['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
29     }
30 DI::page()['htmlhead'] .= <<< EOT
31 <script>
32 function cmtBbOpen(comment, id) {
33         if ($(comment).hasClass('comment-edit-text-full')) {
34                 $(".comment-edit-bb-" + id).show();
35                 return true;
36         }
37         return false;
38 }
39 function cmtBbClose(comment, id) {
40         return false;
41 }
42 $(document).ready(function() {
43
44         $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
45
46         $('.group-edit-icon').hover(
47                 function() {
48                         $(this).addClass('icon'); $(this).removeClass('iconspacer');},
49                 function() {
50                         $(this).removeClass('icon'); $(this).addClass('iconspacer');}
51         );
52
53         $('.sidebar-group-element').hover(
54                 function() {
55                         id = $(this).attr('id');
56                         $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
57
58                 function() {
59                         id = $(this).attr('id');
60                         $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
61         );
62
63
64         $('.savedsearchdrop').hover(
65                 function() {
66                         $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
67                 function() {
68                         $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
69         );
70
71         $('.savedsearchterm').hover(
72                 function() {
73                         id = $(this).attr('id');
74                         $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
75
76                 function() {
77                         id = $(this).attr('id');
78                         $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
79         );
80 });
81 </script>
82 EOT;
83 }