2020-05-22 13:47:02 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Shaarli\Front\Controller\Admin;
|
|
|
|
|
2020-07-06 08:04:35 +02:00
|
|
|
use Shaarli\Render\TemplatePage;
|
2020-05-22 13:47:02 +02:00
|
|
|
use Slim\Http\Request;
|
|
|
|
use Slim\Http\Response;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class ToolsController
|
|
|
|
*
|
|
|
|
* Slim controller used to display the tools page.
|
|
|
|
*/
|
|
|
|
class ToolsController extends ShaarliAdminController
|
|
|
|
{
|
|
|
|
public function index(Request $request, Response $response): Response
|
|
|
|
{
|
|
|
|
$data = [
|
|
|
|
'pageabsaddr' => index_url($this->container->environment),
|
|
|
|
'sslenabled' => is_https($this->container->environment),
|
|
|
|
];
|
|
|
|
|
2020-06-06 14:01:03 +02:00
|
|
|
$data = $this->executeHooks($data);
|
2020-05-22 13:47:02 +02:00
|
|
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
$this->assignView($key, $value);
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->assignView('pagetitle', t('Tools') .' - '. $this->container->conf->get('general.title', 'Shaarli'));
|
|
|
|
|
2020-07-06 08:04:35 +02:00
|
|
|
return $response->write($this->render(TemplatePage::TOOLS));
|
2020-05-22 13:47:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed[] $data Variables passed to the template engine
|
|
|
|
*
|
|
|
|
* @return mixed[] Template data after active plugins render_picwall hook execution.
|
|
|
|
*/
|
|
|
|
protected function executeHooks(array $data): array
|
|
|
|
{
|
|
|
|
$this->container->pluginManager->executeHooks(
|
|
|
|
'render_tools',
|
|
|
|
$data
|
|
|
|
);
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
}
|