// SPDX-License-Identifier: GPL-3.0-or-later namespace Icinga\Module\Graphite\Web\Controller; use Icinga\Module\Graphite\Forms\TimeRangePicker\CommonForm; use Icinga\Module\Graphite\Forms\TimeRangePicker\CustomForm; use Icinga\Web\Request; use Icinga\Web\Url; use Icinga\Web\View; trait TimeRangePickerTrait { /** * @var CommonForm */ protected $timeRangePickerCommonForm; /** * @var CustomForm */ protected $timeRangePickerCustomForm; /** * Process the given request using the forms * * @param ?Request $request The request to be processed * * @return Request The request supposed to be processed */ protected function handleTimeRangePickerRequest(?Request $request = null) { $this->getTimeRangePickerCommonForm()->handleRequest($request); return $this->getTimeRangePickerCustomForm()->handleRequest($request); } /** * Render all needed forms and links * * @param View $view * * @return string */ protected function renderTimeRangePicker(View $view) { $url = Url::fromRequest()->getAbsoluteUrl(); return '