streams/Code/Module/Drafts.php

32 lines
697 B
PHP
Raw Normal View History

2020-11-30 00:38:45 +00:00
<?php
2022-02-16 04:08:28 +00:00
namespace Code\Module;
2020-11-30 00:38:45 +00:00
2022-02-16 04:08:28 +00:00
use Code\Lib\Apps;
use Code\Lib\Libsync;
use Code\Web\Controller;
2020-11-30 00:38:45 +00:00
2021-12-02 23:02:31 +00:00
class Drafts extends Controller
{
2020-11-30 00:38:45 +00:00
2021-12-02 23:02:31 +00:00
public function init()
{
if (local_channel() && Apps::system_app_installed(local_channel(), 'Drafts')) {
goaway(z_root() . '/stream/?draft=1');
2020-11-30 00:38:45 +00:00
}
2021-12-02 23:02:31 +00:00
}
2020-11-30 00:38:45 +00:00
2021-12-02 23:02:31 +00:00
public function get()
{
2020-11-30 00:38:45 +00:00
$desc = t('This app allows you to save posts you are writing and finish them later prior to sharing/publishing.');
$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(), 'Drafts'))) {
2020-11-30 00:38:45 +00:00
return $text;
}
2021-12-02 23:02:31 +00:00
}
2020-11-30 00:38:45 +00:00
}