streams/Code/Module/Tagadelic.php

48 lines
1.1 KiB
PHP
Raw Normal View History

2020-10-21 22:22:23 +00:00
<?php
2022-02-16 04:08:28 +00:00
namespace Code\Module;
2020-10-21 22:22:23 +00:00
use App;
2022-02-16 04:08:28 +00:00
use Code\Lib\Apps;
use Code\Lib\Libsync;
use Code\Lib\Libprofile;
use Code\Web\Controller;
use Code\Render\Comanche;
2020-10-21 22:22:23 +00:00
2021-12-02 23:02:31 +00:00
class Tagadelic extends Controller
{
public function init()
{
if (local_channel()) {
$channel = App::get_channel();
if ($channel && $channel['channel_address']) {
$which = $channel['channel_address'];
}
Libprofile::load($which, 0);
}
}
2020-10-21 22:22:23 +00:00
2021-12-02 23:02:31 +00:00
public function get()
{
2020-10-21 22:22:23 +00:00
$desc = t('This app displays a hashtag cloud on your channel homepage.');
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
2021-12-02 23:02:31 +00:00
if (!(local_channel() && Apps::system_app_installed(local_channel(), 'Tagadelic'))) {
2020-10-21 22:22:23 +00:00
return $text;
}
$desc = t('This app is installed. It displays a hashtag cloud on your channel homepage.');
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
2021-12-02 23:02:31 +00:00
$c = new Comanche();
return $text . EOL . EOL . $c->widget('tagcloud_wall', EMPTY_STR);
}
2020-10-21 22:22:23 +00:00
}