mirror of
https://github.com/friendica/friendica
synced 2024-12-23 00:00:21 +00:00
Move new events routes to calendar routes
This commit is contained in:
parent
2c90ab69d6
commit
7c4a7bff2e
7 changed files with 17 additions and 17 deletions
|
@ -19,7 +19,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
namespace Friendica\Module\Events;
|
||||
namespace Friendica\Module\Calendar;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\BaseModule;
|
||||
|
@ -34,7 +34,7 @@ use Friendica\Util\Profiler;
|
|||
use Psr\Log\LoggerInterface;
|
||||
|
||||
/**
|
||||
* Controller to export calendar
|
||||
* Controller to export a calendar from a given user
|
||||
*/
|
||||
class Export extends BaseModule
|
||||
{
|
||||
|
@ -88,7 +88,7 @@ class Export extends BaseModule
|
|||
|
||||
// If nothing went wrong we can echo the export content
|
||||
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->parameters['nickname'],
|
||||
$evexport["extension"]
|
|
@ -19,7 +19,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
namespace Friendica\Module\Events;
|
||||
namespace Friendica\Module\Calendar;
|
||||
|
||||
use Friendica\Core\System;
|
||||
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);
|
||||
$finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59);
|
||||
|
||||
if (!empty($_GET['start'])) {
|
||||
$start = $_GET['start'];
|
||||
if (!empty($request['start'])) {
|
||||
$start = $request['start'];
|
||||
}
|
||||
|
||||
if (!empty($_GET['end'])) {
|
||||
$finish = $_GET['end'];
|
||||
if (!empty($request['end'])) {
|
||||
$finish = $request['end'];
|
||||
}
|
||||
|
||||
// put the event parametes in an array so we can better transmit them
|
||||
$event_params = [
|
||||
'event_id' => intval($_GET['id'] ?? 0),
|
||||
'event_id' => intval($request['id'] ?? 0),
|
||||
'start' => $start,
|
||||
'finish' => $finish,
|
||||
'ignore' => 0,
|
|
@ -365,6 +365,9 @@ return [
|
|||
|
||||
'/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]],
|
||||
|
||||
'/compose[/{type}]' => [Module\Item\Compose::class, [R::GET, R::POST]],
|
||||
|
@ -398,9 +401,6 @@ return [
|
|||
'/dirfind' => [Module\Search\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]],
|
||||
|
||||
'/feed' => [
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
week: '{{$i18n.week|escape:'quotes'}}',
|
||||
day: '{{$i18n.day|escape:'quotes'}}'
|
||||
},
|
||||
events: '{{$baseurl}}{{$module_url}}/json/',
|
||||
events: '{{$baseurl}}/calendar/json',
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<h3>{{$etitle}}</h3>
|
||||
|
||||
<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}}/events/{{$user}}/export/csv">{{$export_csv}}</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}}/calendar/{{$user}}/export/csv">{{$export_csv}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
year: yesterday.getFullYear(),
|
||||
month: yesterday.getMonth(),
|
||||
date: yesterday.getDate(),
|
||||
events: '{{$baseurl}}/events/json/',
|
||||
events: '{{$baseurl}}/calendar/json/',
|
||||
header: false,
|
||||
timeFormat: 'H(:mm)',
|
||||
defaultView: 'basicWeek',
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
week: '{{$i18n.week|escape:'quotes'}}',
|
||||
day: '{{$i18n.day|escape:'quotes'}}'
|
||||
},
|
||||
events: '{{$baseurl}}{{$module_url}}/json/',
|
||||
events: '{{$baseurl}}/calendar/json',
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
|
|
Loading…
Reference in a new issue