2017-03-16 01:31:34 +00:00
|
|
|
<?php
|
|
|
|
|
2022-02-16 04:08:28 +00:00
|
|
|
namespace Code\Widget;
|
2017-03-16 01:31:34 +00:00
|
|
|
|
2021-12-02 22:33:36 +00:00
|
|
|
use App;
|
|
|
|
|
2022-10-23 21:18:44 +00:00
|
|
|
class Tagcloud implements WidgetInterface
|
2021-12-02 23:02:31 +00:00
|
|
|
{
|
|
|
|
|
2022-10-24 03:39:49 +00:00
|
|
|
public function widget(array $arguments): string
|
2021-12-02 23:02:31 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
$o = '';
|
|
|
|
$uid = App::$profile_uid;
|
2022-10-24 03:39:49 +00:00
|
|
|
$count = ((x($arguments, 'count')) ? intval($arguments['count']) : 24);
|
2021-12-02 23:02:31 +00:00
|
|
|
$flags = 0;
|
|
|
|
$type = TERM_HASHTAG;
|
|
|
|
|
|
|
|
// @FIXME there exists no $authors variable
|
|
|
|
$r = tagadelic($uid, $count, $authors, $owner, $flags, 0, $type);
|
|
|
|
|
|
|
|
// @FIXME this should use a template
|
|
|
|
|
|
|
|
if ($r) {
|
|
|
|
$o = '<div class="tagblock widget"><h3>' . t('Tags') . '</h3><div class="tags" align="center">';
|
|
|
|
foreach ($r as $rv) {
|
|
|
|
$o .= '<span class="tag' . $rv[2] . '">' . $rv[0] . ' </span> ' . "\r\n";
|
|
|
|
}
|
|
|
|
$o .= '</div></div>';
|
|
|
|
}
|
|
|
|
return $o;
|
|
|
|
}
|
2017-03-16 01:31:34 +00:00
|
|
|
}
|