From 477ed97c2fbfff903f9ebf0ffa7fba078eeac10f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 15 Mar 2017 18:31:34 -0700 Subject: convert more widgets to classes --- Zotlabs/Widget/Collections.php | 51 +++++++++++++++++++++++++++++++++++++ Zotlabs/Widget/Profile | 13 ++++++++++ Zotlabs/Widget/Suggestions.php | 58 ++++++++++++++++++++++++++++++++++++++++++ Zotlabs/Widget/Tagcloud.php | 33 ++++++++++++++++++++++++ Zotlabs/Widget/Zcard.php | 11 ++++++++ 5 files changed, 166 insertions(+) create mode 100644 Zotlabs/Widget/Collections.php create mode 100644 Zotlabs/Widget/Profile create mode 100644 Zotlabs/Widget/Suggestions.php create mode 100644 Zotlabs/Widget/Tagcloud.php create mode 100644 Zotlabs/Widget/Zcard.php (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Collections.php b/Zotlabs/Widget/Collections.php new file mode 100644 index 000000000..d2b29679a --- /dev/null +++ b/Zotlabs/Widget/Collections.php @@ -0,0 +1,51 @@ + 2) ? mt_rand(0,count($r) - 2) : 0); + + for($x = $index; $x <= ($index+1); $x ++) { + $rr = $r[$x]; + if(! $rr['xchan_url']) + break; + + $connlnk = z_root() . '/follow/?url=' . $rr['xchan_addr']; + + $arr[] = array( + 'url' => chanlink_url($rr['xchan_url']), + 'profile' => $rr['xchan_url'], + 'name' => $rr['xchan_name'], + 'photo' => $rr['xchan_photo_m'], + 'ignlnk' => z_root() . '/directory?ignore=' . $rr['xchan_hash'], + 'conntxt' => t('Connect'), + 'connlnk' => $connlnk, + 'ignore' => t('Ignore/Hide') + ); + } + + $o = replace_macros(get_markup_template('suggest_widget.tpl'),array( + '$title' => t('Suggestions'), + '$more' => t('See more...'), + '$entries' => $arr + )); + + return $o; + } +} diff --git a/Zotlabs/Widget/Tagcloud.php b/Zotlabs/Widget/Tagcloud.php new file mode 100644 index 000000000..cf7a4932e --- /dev/null +++ b/Zotlabs/Widget/Tagcloud.php @@ -0,0 +1,33 @@ +

' . t('Categories') . '

'; + foreach($r as $rv) { + $o .= '' . $rv[0] .' ' . "\r\n"; + } + $o .= '
'; + } + return $o; + } +} diff --git a/Zotlabs/Widget/Zcard.php b/Zotlabs/Widget/Zcard.php new file mode 100644 index 000000000..12e53eaab --- /dev/null +++ b/Zotlabs/Widget/Zcard.php @@ -0,0 +1,11 @@ + 875)); + } +} -- cgit v1.2.3