streams/Code/Module/Categories.php

43 lines
910 B
PHP
Raw Normal View History

2019-03-25 03:08:23 +00:00
<?php
2022-02-16 04:08:28 +00:00
namespace Code\Module;
2019-03-25 03:08:23 +00:00
use App;
2022-02-16 04:08:28 +00:00
use Code\Lib\Apps;
use Code\Lib\Libprofile;
use Code\Web\Controller;
use Code\Render\Comanche;
2019-03-25 03:08:23 +00:00
2021-12-02 23:02:31 +00:00
class Categories extends Controller
{
public function init()
{
if (local_channel()) {
$channel = App::get_channel();
2022-08-26 22:37:04 +00:00
$which = '';
2021-12-02 23:02:31 +00:00
if ($channel && $channel['channel_address']) {
$which = $channel['channel_address'];
}
Libprofile::load($which, 0);
}
}
2019-03-25 03:08:23 +00:00
2021-12-02 23:02:31 +00:00
public function get()
{
2019-03-25 03:08:23 +00:00
$desc = t('This app allows you to add categories to posts and events.');
$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(), 'Categories'))) {
2019-03-25 03:08:23 +00:00
return $text;
}
2021-12-02 23:02:31 +00:00
$c = new Comanche();
return $c->widget('catcloud', EMPTY_STR);
}
}