]> git.mxchange.org Git - friendica.git/blob - view/theme/diabook/theme.php
add links to home, profile, photos, events, notes to aside in network-stream
[friendica.git] / view / theme / diabook / theme.php
1 <?php
2
3 /*
4  * Name: Diabook
5  * Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu
6  * Version: 
7  * Author: 
8  */
9
10 $a->theme_info = array(
11   'extends' => 'diabook',
12 );
13
14 //profile_side
15
16
17
18 $nav['usermenu']=array();
19 $userinfo = null;
20
21 if(local_user()) {
22         
23
24
25 $r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid']));
26                 
27 $userinfo = array(
28                         'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl()."/images/default-profile-mm.jpg"),
29                         'name' => $a->user['username'],
30                 );      
31         
32 $ps['usermenu'][status] = Array('profile/' . $a->user['nickname'], t('Home'), "", t('Your posts and conversations'));
33 $ps['usermenu'][profile] = Array('profile/' . $a->user['nickname']. '?tab=profile', t('Profile'), "", t('Your profile page'));
34 $ps['usermenu'][photos] = Array('photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos'));
35 $ps['usermenu'][events] = Array('events/', t('Events'), "", t('Your events'));
36 $ps['usermenu'][notes] = Array('notes/', t('Personal notes'), "", t('Your personal photos'));
37
38
39 if($is_url = preg_match ("/\bnetwork\b/i", $_SERVER['REQUEST_URI'])) {
40 $tpl = get_markup_template('profile_side.tpl');
41
42 $a->page['aside'] .= replace_macros($tpl, array(
43                 '$userinfo' => $userinfo,
44                 '$ps' => $ps,
45         ));
46 }
47 }
48
49 //js script
50
51 $a->page['htmlhead'] .= <<< EOT
52
53 <script>
54
55 //contacts
56 $('html').click(function() {
57  $('#nav-contacts-linkmenu').removeClass('selected');
58  document.getElementById( "nav-contacts-menu" ).style.display = "none";
59  });
60  
61  $('#nav-contacts-linkmenu').click(function(event){
62      event.stopPropagation();
63  });
64
65 //messages
66 $('html').click(function() {
67  $('#nav-messages-linkmenu').removeClass('selected');
68  document.getElementById( "nav-messages-menu" ).style.display = "none";
69  });
70
71  $('#nav-messages-linkmenu').click(function(event){
72      event.stopPropagation();
73  });
74
75 //notifications
76 $('html').click(function() {
77  $('#nav-notifications-linkmenu').removeClass('selected');
78  document.getElementById( "nav-notifications-menu" ).style.display = "none";
79  });
80
81  $('#nav-notifications-linkmenu').click(function(event){
82      event.stopPropagation();
83  });
84
85 //usermenu
86 $('html').click(function() {
87  $('#nav-user-linkmenu').removeClass('selected');
88  document.getElementById( "nav-user-menu" ).style.display = "none";
89  });
90
91  $('#nav-user-linkmenu').click(function(event){
92      event.stopPropagation();
93  });
94  
95  //settingsmenu
96  $('html').click(function() {
97  $('#nav-site-linkmenu').removeClass('selected');
98  document.getElementById( "nav-site-menu" ).style.display = "none";
99  });
100
101  $('#nav-site-linkmenu').click(function(event){
102      event.stopPropagation();
103  });
104  //appsmenu
105  $('html').click(function() {
106  $('#nav-apps-link').removeClass('selected');
107  document.getElementById( "nav-apps-menu" ).style.display = "none";
108  });
109
110  $('#nav-apps-link').click(function(event){
111      event.stopPropagation();
112  });
113  
114  $(function() {
115         $('a.lightbox').fancybox(); // Select all links with lightbox class
116 });
117
118  
119  </script>
120 EOT;