Move new events routes to calendar routes

This commit is contained in:
Philipp 2022-11-02 08:59:46 +01:00
parent 2c90ab69d6
commit 7c4a7bff2e
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
7 changed files with 17 additions and 17 deletions

View file

@ -19,7 +19,7 @@
* *
*/ */
namespace Friendica\Module\Events; namespace Friendica\Module\Calendar;
use Friendica\App; use Friendica\App;
use Friendica\BaseModule; use Friendica\BaseModule;
@ -34,7 +34,7 @@ use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
/** /**
* Controller to export calendar * Controller to export a calendar from a given user
*/ */
class Export extends BaseModule class Export extends BaseModule
{ {
@ -88,7 +88,7 @@ class Export extends BaseModule
// If nothing went wrong we can echo the export content // If nothing went wrong we can echo the export content
if ($evexport["success"]) { if ($evexport["success"]) {
$this->response->setHeader(sprintf('content-disposition: attachment; filename="%s-%s.%s"', $this->response->setHeader(sprintf('Content-Disposition: attachment; filename="%s-%s.%s"',
$this->t('calendar'), $this->t('calendar'),
$this->parameters['nickname'], $this->parameters['nickname'],
$evexport["extension"] $evexport["extension"]

View file

@ -19,7 +19,7 @@
* *
*/ */
namespace Friendica\Module\Events; namespace Friendica\Module\Calendar;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -51,17 +51,17 @@ class Json extends \Friendica\BaseModule
$start = sprintf('%d-%d-%d %d:%d:%d', $y, $m, 1, 0, 0, 0); $start = sprintf('%d-%d-%d %d:%d:%d', $y, $m, 1, 0, 0, 0);
$finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59); $finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59);
if (!empty($_GET['start'])) { if (!empty($request['start'])) {
$start = $_GET['start']; $start = $request['start'];
} }
if (!empty($_GET['end'])) { if (!empty($request['end'])) {
$finish = $_GET['end']; $finish = $request['end'];
} }
// put the event parametes in an array so we can better transmit them // put the event parametes in an array so we can better transmit them
$event_params = [ $event_params = [
'event_id' => intval($_GET['id'] ?? 0), 'event_id' => intval($request['id'] ?? 0),
'start' => $start, 'start' => $start,
'finish' => $finish, 'finish' => $finish,
'ignore' => 0, 'ignore' => 0,

View file

@ -365,6 +365,9 @@ return [
'/bookmarklet' => [Module\Bookmarklet::class, [R::GET]], '/bookmarklet' => [Module\Bookmarklet::class, [R::GET]],
'/calendar/{nickname}/export[/{format}]' => [Module\Calendar\Export::class, [R::GET]],
'/calendar/json' => [Module\Calendar\Json::class, [R::GET]],
'/community[/{content}]' => [Module\Conversation\Community::class, [R::GET]], '/community[/{content}]' => [Module\Conversation\Community::class, [R::GET]],
'/compose[/{type}]' => [Module\Item\Compose::class, [R::GET, R::POST]], '/compose[/{type}]' => [Module\Item\Compose::class, [R::GET, R::POST]],
@ -398,9 +401,6 @@ return [
'/dirfind' => [Module\Search\Directory::class, [R::GET]], '/dirfind' => [Module\Search\Directory::class, [R::GET]],
'/directory' => [Module\Directory::class, [R::GET]], '/directory' => [Module\Directory::class, [R::GET]],
'/events/{nickname}/export[/{format}]' => [Module\Events\Export::class, [R::GET]],
'/events/json' => [Module\Events\Json::class, [R::GET]],
'/featured/{nickname}' => [Module\ActivityPub\Featured::class, [R::GET]], '/featured/{nickname}' => [Module\ActivityPub\Featured::class, [R::GET]],
'/feed' => [ '/feed' => [

View file

@ -81,7 +81,7 @@
week: '{{$i18n.week|escape:'quotes'}}', week: '{{$i18n.week|escape:'quotes'}}',
day: '{{$i18n.day|escape:'quotes'}}' day: '{{$i18n.day|escape:'quotes'}}'
}, },
events: '{{$baseurl}}{{$module_url}}/json/', events: '{{$baseurl}}/calendar/json',
header: { header: {
left: 'prev,next today', left: 'prev,next today',
center: 'title', center: 'title',

View file

@ -3,7 +3,7 @@
<h3>{{$etitle}}</h3> <h3>{{$etitle}}</h3>
<ul class="sidebar-calendar-export-ul"> <ul class="sidebar-calendar-export-ul">
<li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/events/{{$user}}/export/ical">{{$export_ical}}</a></li> <li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/calendar/{{$user}}/export/ical">{{$export_ical}}</a></li>
<li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/events/{{$user}}/export/csv">{{$export_csv}}</a></li> <li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/calendar/{{$user}}/export/csv">{{$export_csv}}</a></li>
</ul> </ul>
</div> </div>

View file

@ -22,7 +22,7 @@
year: yesterday.getFullYear(), year: yesterday.getFullYear(),
month: yesterday.getMonth(), month: yesterday.getMonth(),
date: yesterday.getDate(), date: yesterday.getDate(),
events: '{{$baseurl}}/events/json/', events: '{{$baseurl}}/calendar/json/',
header: false, header: false,
timeFormat: 'H(:mm)', timeFormat: 'H(:mm)',
defaultView: 'basicWeek', defaultView: 'basicWeek',

View file

@ -87,7 +87,7 @@
week: '{{$i18n.week|escape:'quotes'}}', week: '{{$i18n.week|escape:'quotes'}}',
day: '{{$i18n.day|escape:'quotes'}}' day: '{{$i18n.day|escape:'quotes'}}'
}, },
events: '{{$baseurl}}{{$module_url}}/json/', events: '{{$baseurl}}/calendar/json',
header: { header: {
left: 'prev,next today', left: 'prev,next today',
center: 'title', center: 'title',