activityReport/src/Frontend.php

44 lines
1.3 KiB
PHP
Raw Normal View History

<?php
2023-10-17 20:47:35 +00:00
declare(strict_types=1);
2021-09-02 22:18:08 +00:00
namespace Dotclear\Plugin\activityReport;
2021-09-02 22:18:08 +00:00
2023-10-17 20:47:35 +00:00
use Dotclear\App;
2023-08-17 14:25:19 +00:00
use Dotclear\Core\Process;
/**
2023-10-17 20:47:35 +00:00
* @brief activityReport frontend class.
* @ingroup activityReport
*
* @author Jean-Christian Denis (author)
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
2023-08-17 14:25:19 +00:00
class Frontend extends Process
{
public static function init(): bool
2021-09-02 22:18:08 +00:00
{
2023-08-17 14:25:19 +00:00
return self::status(My::checkContext(My::FRONTEND));
2021-09-02 22:18:08 +00:00
}
public static function process(): bool
2021-09-02 22:18:08 +00:00
{
2023-08-17 14:25:19 +00:00
if (!self::status()) {
return false;
2021-09-02 22:18:08 +00:00
}
// be sure to init report
ActivityReport::init();
2023-10-17 20:47:35 +00:00
App::frontend()->template()->setPath(App::frontend()->template()->getPath(), implode(DIRECTORY_SEPARATOR, [My::path(), 'default-templates', 'tpl']));
2023-10-17 20:47:35 +00:00
App::frontend()->template()->addBlock('activityReports', Template::activityReports(...));
App::frontend()->template()->addValue('activityReportFeedID', Template::activityReportFeedID(...));
App::frontend()->template()->addValue('activityReportTitle', Template::activityReportTitle(...));
App::frontend()->template()->addValue('activityReportDate', Template::activityReportDate(...));
App::frontend()->template()->addValue('activityReportContent', Template::activityReportContent(...));
2022-11-18 20:24:30 +00:00
return true;
2021-09-02 22:18:08 +00:00
}
2022-11-18 20:24:30 +00:00
}