2021-09-02 22:04:20 +00:00
|
|
|
<?php
|
2021-09-02 22:18:08 +00:00
|
|
|
/**
|
|
|
|
* @brief activityReport, a plugin for Dotclear 2
|
2022-11-18 20:24:30 +00:00
|
|
|
*
|
2021-09-02 22:18:08 +00:00
|
|
|
* @package Dotclear
|
|
|
|
* @subpackage Plugin
|
2022-11-18 20:24:30 +00:00
|
|
|
*
|
2021-09-02 22:18:08 +00:00
|
|
|
* @author Jean-Christian Denis and contributors
|
2022-11-18 20:24:30 +00:00
|
|
|
*
|
2021-09-02 22:18:08 +00:00
|
|
|
* @copyright Jean-Christian Denis
|
|
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
*/
|
2023-04-20 12:22:43 +00:00
|
|
|
declare(strict_types=1);
|
2021-09-02 22:18:08 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
namespace Dotclear\Plugin\activityReport;
|
2021-09-02 22:18:08 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
use dcCore;
|
|
|
|
use dcNsProcess;
|
2021-09-02 22:04:20 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
/**
|
|
|
|
* Front end process.
|
|
|
|
*/
|
|
|
|
class Frontend extends dcNsProcess
|
2021-09-02 22:04:20 +00:00
|
|
|
{
|
2023-04-20 12:22:43 +00:00
|
|
|
public static function init(): bool
|
2021-09-02 22:18:08 +00:00
|
|
|
{
|
2023-04-20 12:22:43 +00:00
|
|
|
static::$init = defined('ACTIVITY_REPORT')
|
|
|
|
&& My::phpCompliant()
|
|
|
|
&& My::isInstalled();
|
2021-09-02 22:18:08 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
return static::$init;
|
2021-09-02 22:18:08 +00:00
|
|
|
}
|
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
public static function process(): bool
|
2021-09-02 22:18:08 +00:00
|
|
|
{
|
2023-04-20 12:22:43 +00:00
|
|
|
if (!static::$init) {
|
|
|
|
return false;
|
2021-09-02 22:18:08 +00:00
|
|
|
}
|
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
dcCore::app()->tpl->setPath(dcCore::app()->tpl->getPath(), implode(DIRECTORY_SEPARATOR, [My::root(), 'default-templates', 'tpl']));
|
2021-09-02 22:04:20 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
dcCore::app()->tpl->addBlock('activityReports', [Template::class, 'activityReports']);
|
|
|
|
dcCore::app()->tpl->addValue('activityReportFeedID', [Template::class, 'activityReportFeedID']);
|
|
|
|
dcCore::app()->tpl->addValue('activityReportTitle', [Template::class, 'activityReportTitle']);
|
|
|
|
dcCore::app()->tpl->addValue('activityReportDate', [Template::class, 'activityReportDate']);
|
|
|
|
dcCore::app()->tpl->addValue('activityReportContent', [Template::class, 'activityReportContent']);
|
2022-11-18 20:24:30 +00:00
|
|
|
|
2023-04-20 12:22:43 +00:00
|
|
|
return true;
|
2021-09-02 22:18:08 +00:00
|
|
|
}
|
2022-11-18 20:24:30 +00:00
|
|
|
}
|