From 0bad26e116499d9b656c28f64c81275df4bbecb6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 16 Mar 2017 17:11:48 -0700 Subject: the rest of the standard widgets converted --- Zotlabs/Widget/Activity.php | 61 +++++++++++++++++ Zotlabs/Widget/Album.php | 106 +++++++++++++++++++++++++++++ Zotlabs/Widget/Bookmarkedchats.php | 28 ++++++++ Zotlabs/Widget/Categories.php | 1 + Zotlabs/Widget/Clock.php | 63 +++++++++++++++++ Zotlabs/Widget/Cover_photo.php | 59 ++++++++++++++++ Zotlabs/Widget/Dirsort.php | 11 +++ Zotlabs/Widget/Dirtags.php | 13 ++++ Zotlabs/Widget/Filer.php | 1 + Zotlabs/Widget/Findpeople.php | 12 ++++ Zotlabs/Widget/Forums.php | 97 ++++++++++++++++++++++++++ Zotlabs/Widget/Helpindex.php | 45 ++++++++++++ Zotlabs/Widget/Item.php | 54 +++++++++++++++ Zotlabs/Widget/Photo.php | 55 +++++++++++++++ Zotlabs/Widget/Photo_rand.php | 66 ++++++++++++++++++ Zotlabs/Widget/Pubsites.php | 16 +++++ Zotlabs/Widget/Random_block.php | 46 +++++++++++++ Zotlabs/Widget/Rating.php | 67 ++++++++++++++++++ Zotlabs/Widget/Suggestedchats.php | 37 ++++++++++ Zotlabs/Widget/Website_portation_tools.php | 22 ++++++ 20 files changed, 860 insertions(+) create mode 100644 Zotlabs/Widget/Activity.php create mode 100644 Zotlabs/Widget/Album.php create mode 100644 Zotlabs/Widget/Bookmarkedchats.php create mode 100644 Zotlabs/Widget/Clock.php create mode 100644 Zotlabs/Widget/Cover_photo.php create mode 100644 Zotlabs/Widget/Dirsort.php create mode 100644 Zotlabs/Widget/Dirtags.php create mode 100644 Zotlabs/Widget/Findpeople.php create mode 100644 Zotlabs/Widget/Forums.php create mode 100644 Zotlabs/Widget/Helpindex.php create mode 100644 Zotlabs/Widget/Item.php create mode 100644 Zotlabs/Widget/Photo.php create mode 100644 Zotlabs/Widget/Photo_rand.php create mode 100644 Zotlabs/Widget/Pubsites.php create mode 100644 Zotlabs/Widget/Random_block.php create mode 100644 Zotlabs/Widget/Rating.php create mode 100644 Zotlabs/Widget/Suggestedchats.php create mode 100644 Zotlabs/Widget/Website_portation_tools.php (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Activity.php b/Zotlabs/Widget/Activity.php new file mode 100644 index 000000000..72a27bdf1 --- /dev/null +++ b/Zotlabs/Widget/Activity.php @@ -0,0 +1,61 @@ + $v) { + $arr[] = [ 'author_xchan' => $k, 'total' => $v ]; + } + usort($arr,'total_sort'); + xchan_query($arr); + } + + $x = [ 'entries' => $arr ]; + call_hooks('activity_widget',$x); + $arr = $x['entries']; + + if($arr) { + $o .= '
'; + $o .= '

' . t('Activity','widget') . '

'; + } + return $o; + } + +} + diff --git a/Zotlabs/Widget/Album.php b/Zotlabs/Widget/Album.php new file mode 100644 index 000000000..f359e6d0f --- /dev/null +++ b/Zotlabs/Widget/Album.php @@ -0,0 +1,106 @@ + $rr['id'], + 'twist' => ' ' . $twist . rand(2,4), + 'link' => $imagelink, + 'title' => t('View Photo'), + 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['imgscale'] . '.' .$ext, + 'alt' => $imgalt_e, + 'desc'=> $desc_e, + 'ext' => $ext, + 'hash'=> $rr['resource_id'], + 'unknown' => t('Unknown') + ); + } + } + + + $tpl = get_markup_template('photo_album.tpl'); + $o .= replace_macros($tpl, array( + '$photos' => $photos, + '$album' => (($title) ? $title : $album), + '$album_id' => rand(), + '$album_edit' => array(t('Edit Album'), $album_edit), + '$can_post' => false, + '$upload' => array(t('Upload'), z_root() . '/photos/' . \App::$profile['channel_address'] . '/upload/' . bin2hex($album)), + '$order' => false, + '$upload_form' => $upload_form, + '$usage' => $usage_message + )); + + return $o; + } +} + diff --git a/Zotlabs/Widget/Bookmarkedchats.php b/Zotlabs/Widget/Bookmarkedchats.php new file mode 100644 index 000000000..d64bbdb4b --- /dev/null +++ b/Zotlabs/Widget/Bookmarkedchats.php @@ -0,0 +1,28 @@ + t('Bookmarked Chatrooms'), + '$rooms' => $r + )); + } +} diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php index 82fffccc8..d1dcfda93 100644 --- a/Zotlabs/Widget/Categories.php +++ b/Zotlabs/Widget/Categories.php @@ -2,6 +2,7 @@ namespace Zotlabs\Widget; +require_once('include/contact_widgets.php'); class Categories { diff --git a/Zotlabs/Widget/Clock.php b/Zotlabs/Widget/Clock.php new file mode 100644 index 000000000..b63b5f748 --- /dev/null +++ b/Zotlabs/Widget/Clock.php @@ -0,0 +1,63 @@ + +

+ + +EOT; + + return $o; + } +} + diff --git a/Zotlabs/Widget/Cover_photo.php b/Zotlabs/Widget/Cover_photo.php new file mode 100644 index 000000000..d2eb1be92 --- /dev/null +++ b/Zotlabs/Widget/Cover_photo.php @@ -0,0 +1,59 @@ +') !== false) + $style = ''; + + if(array_key_exists('title', $arr) && isset($arr['title'])) + $title = $arr['title']; + else + $title = $channel['channel_name']; + + if(array_key_exists('subtitle', $arr) && isset($arr['subtitle'])) + $subtitle = $arr['subtitle']; + else + $subtitle = str_replace('@','@',$channel['xchan_addr']); + + $c = get_cover_photo($channel_id,'html'); + + if($c) { + $photo_html = (($style) ? str_replace('alt=',' style="' . $style . '" alt=',$c) : $c); + + $o = replace_macros(get_markup_template('cover_photo_widget.tpl'),array( + '$photo_html' => $photo_html, + '$title' => $title, + '$subtitle' => $subtitle, + '$hovertitle' => t('Click to show more'), + )); + } + return $o; + } +} diff --git a/Zotlabs/Widget/Dirsort.php b/Zotlabs/Widget/Dirsort.php new file mode 100644 index 000000000..e75a00e50 --- /dev/null +++ b/Zotlabs/Widget/Dirsort.php @@ -0,0 +1,11 @@ +'; + $o .= '

' . t('Forums') . '

'; + } + return $o; + + } +} diff --git a/Zotlabs/Widget/Helpindex.php b/Zotlabs/Widget/Helpindex.php new file mode 100644 index 000000000..62cecce1f --- /dev/null +++ b/Zotlabs/Widget/Helpindex.php @@ -0,0 +1,45 @@ +'; + + $level_0 = get_help_content('sitetoc'); + if(! $level_0) + $level_0 = get_help_content('toc'); + + $level_0 = preg_replace('/\/','