]> git.mxchange.org Git - friendica-addons.git/blob - widgets/widget_friendheader.php
More indentations
[friendica-addons.git] / widgets / widget_friendheader.php
1 <?php
2
3 use Friendica\Content\Text\HTML;
4 use Friendica\Content\Widget\ContactBlock;
5 use Friendica\DI;
6 use Friendica\Model\User;
7
8 function friendheader_widget_name()
9 {
10         return "Shows friends as a bar";
11 }
12 function friendheader_widget_help()
13 {
14         return "";
15 }
16
17 function friendheader_widget_args()
18 {
19         return [];
20 }
21
22 function friendheader_widget_size()
23 {
24         return ['780px','140px'];
25 }
26
27
28 function friendheader_widget_content(&$a, $conf)
29 {
30         $owner = User::getOwnerDataById($conf['uid']);
31         if (empty($owner)) {
32                 return;
33         }
34
35         $o = "";
36         $o .= "<style>
37                 body {font-size: 0.8em; margin: 0px; padding: 0px;}
38                 #contact-block { overflow: hidden; height: auto; }
39                 .contact-block-h4 { float: left; margin: 0px; }
40                 .allcontact-link { float: right; margin: 0px; }
41                 .contact-block-content { clear:both; }
42                 .contact-block-div { display: block !important; float: left!important; width: 50px!important; height: 50px!important; margin: 2px!important;}
43
44         </style>";
45         $o .= _abs_url(ContactBlock::getHTML($owner));
46         $o .= "<a href='".DI::baseUrl()->get().'/profile/'.$owner['nickname']."' target=new>". DI::l10n()->t('Get added to this list!') ."</a>";
47
48         return $o;
49 }