Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contao5 Version #4

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
composer.lock
vendor
# Jetbrains
/.idea/*

# tools
/vendor/
/tools/*/vendor
/composer.lock
/.php-cs-fixer.cache
/tools/phpunit/.phpunit.result.cache
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
> Updated version for contao 4.13 based on https://github.com/Diversworld/Contao-CalendarEditor

# Contao-CalendarEditor

This is a revision of the module for Contao 3. Essentially, everything should run as it did in Contao 3. The only change is the direct integration of the extension "CalendarField", which allows the use of a jQuery calendar for date fields.

## Features

New settings in the Contao Calender: Enable Frontend editing
New settings in the Contao Calendar: Enable Frontend editing
* option: "Only future events", which disables editing of elapsed events
* option: Login required (highly recommended on productive sites)
* Define member groups for editing: "Members" and "Admins", which can edit all events (unless they are locked in the Backend, see below)
* option: Allow editing only for owner: Only the (Frontend) creator of an event is able to edit it later (Frontend-Admins can edit events from other users/admins anyway)

New setting in the Contao Events
* disable Frontend editing (lock single events for Frontend editing, even for Frontend Admins)

Expand Down Expand Up @@ -46,7 +48,7 @@ Should be placed on the site with the Eventreader module. Provides a proper edit

### The Calendar FE edit module

Similar to the regular Contao Calendar, but with edit-Links and "add event"-Links for every day. As a bonus, a "Holiday Calendar" can be specified. Events from this calendar are shown in the day-header of the calender module, to mark some days as "holiday", or whatever.
Similar to the regular Contao Calendar, but with edit-Links and "add event"-Links for every day. As a bonus, a "Holiday Calendar" can be specified. Events from this calendar are shown in the day-header of the calendar module, to mark some days as "holiday", or whatever.

## Usage

Expand Down
42 changes: 21 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
{
"name": "danielgausi/contao-calendareditor-bundle",
"name": "diversworld/contao-calendar-editor",
"description": "Contao Extension to create and edit calendar events in the frontend.",
"keywords": ["contao",
"calendar",
"calendar_editor",
"calendar editor",
"keywords": ["contao",
"calendar",
"calendar_editor",
"calendar editor",
"calendar frontend",
"events", "frontend",
"events", "frontend",
"events frontend"],
"type": "contao-bundle",
"homepage": "https://github.com/DanielGausi/Contao-CalendarEditor",
"homepage": "https://github.com/diversworld/contao-calendar-editor",
"license": "LGPL-3.0-or-later",

"require": {
"php": "^8.2",
"contao/core-bundle": "~4.13" ,
"contao/calendar-bundle": "~4.13",
"menatwork/contao-multicolumnwizard-bundle": "^3.0",
"hofff/contao-calendarfield": "^4.0"
},

"require": {
"php": "^8.1",
"contao/core-bundle": "~5.3" ,
"contao/calendar-bundle": "^5.3",
"menatwork/contao-multicolumnwizard-bundle": "^3.0"
},
"autoload": {
"psr-4": {
"DanielGausi\\CalendarEditorBundle\\": "src/"
},
"Diversworld\\CalendarEditorBundle\\": "src/"
},
"classmap": [
"src/Resources/contao/"
],
"exclude-from-classmap": [
"src/Resources/contao/config/",
"src/Resources/contao/dca/",
"src/Resources/contao/config/",
"src/Resources/contao/dca/",
"src/Resources/contao/languages/",
"src/Resources/contao/templates/"
]
},
"extra":{
"contao-manager-plugin": "DanielGausi\\CalendarEditorBundle\\ContaoManager\\Plugin"
"contao-manager-plugin": "Diversworld\\CalendarEditorBundle\\ContaoManager\\Plugin"
},
"config": {
"allow-plugins": {
"contao-components/installer": true,
"php-http/discovery": true,
"contao-community-alliance/composer-plugin": true
}
}
},
"version": "5.0.1"
}
3 changes: 3 additions & 0 deletions config/routes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
diversworld_calendar_editor:
resource: "@DiversworldCalendarEditorBundle/Controller/"
type: annotation
43 changes: 43 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
services:
_defaults:
autowire: true
autoconfigure: true
public: false

_instanceof:
Contao\CoreBundle\Framework\FrameworkAwareInterface:
calls:
- [ setFramework, [ '@contao.framework' ] ]

Symfony\Component\DependencyInjection\ContainerAwareInterface:
calls:
- [ setContainer, [ '@service_container' ] ]

Diversworld\CalendarEditorBundle\Controller\Module\ModuleCalendarEdit:
calls:
- [ setCheckAuthService, [ '@Diversworld\CalendarEditorBundle\Services\CheckAuthService' ] ]

Diversworld\CalendarEditorBundle\Controller\Module\ModuleEventEditor:
arguments:
- '@?logger'
- '@contao.security.token_checker'
- '@doctrine.dbal.default_connection'
tags:
- { name: monolog.logger, channel: contao.general }

Diversworld\CalendarEditorBundle\Hooks\ListAllEventsHook:
arguments:
$checkAuthService: '@Diversworld\CalendarEditorBundle\Service\CheckAuthService'
$user: '@security.token_storage'

Diversworld\CalendarEditorBundle\Services\CheckAuthService:
autowire: true
autoconfigure: true
public: true

monolog.logger.contao.general:
class: Monolog\Logger
arguments: ['contao.general']
tags:
- { name: monolog.logger, channel: contao.general }

22 changes: 0 additions & 22 deletions config/services.yml

This file was deleted.

35 changes: 35 additions & 0 deletions contao/config/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/**
* This file is part of
*
* CalendarEditorBundle
* @copyright Daniel Gaußmann 2018
* @author Daniel Gaußmann (Gausi)
* @package Calendar_Editor
* @license LGPL-3.0-or-later
* @see https://github.com/Diversworld/Contao-CalendarEditor
*
* an extension for
* Contao Open Source CMS
* (c) Leo Feyer, LGPL-3.0-or-later
*
*/

/**
* Front end modules
*/

use Diversworld\CalendarEditorBundle\Hooks\ListAllEventsHook;
use Diversworld\CalendarEditorBundle\Controller\Module\ModuleCalendarEdit;
use Diversworld\CalendarEditorBundle\Controller\Module\ModuleEventEditor;
use Diversworld\CalendarEditorBundle\Controller\Module\ModuleEventReaderEdit;
use Diversworld\CalendarEditorBundle\Controller\Module\ModuleHiddenEventlist;

$GLOBALS['FE_MOD']['events']['calendarEdit'] = ModuleCalendarEdit::class;
$GLOBALS['FE_MOD']['events']['EventEditor'] = ModuleEventEditor::class;
$GLOBALS['FE_MOD']['events']['EventReaderEditLink'] = ModuleEventReaderEdit::class;
$GLOBALS['FE_MOD']['events']['EventHiddenList'] = ModuleHiddenEventlist::class;

//$GLOBALS['TL_HOOKS']['getAllEvents'][] = [ListAllEventsHook::class, 'updateAllEvents'];
$GLOBALS['TL_HOOKS']['listAllEvents'][] = ['Diversworld\CalendarEditorBundle\Hooks\ListAllEventsHook', 'onListAllEvents'];
89 changes: 89 additions & 0 deletions contao/dca/tl_calendar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php

/**
* This file is part of
*
* CalendarEditorBundle
* @copyright Daniel Gaußmann 2018
* @author Daniel Gaußmann (Gausi)
* @package Calendar_Editor
* @license LGPL-3.0-or-later
* @see https://github.com/Diversworld/Contao-CalendarEditor
*
* an extension for
* Contao Open Source CMS
* (c) Leo Feyer, LGPL-3.0-or-later
*
*/


/**
* Add palettes to tl_calendar
*/

$GLOBALS['TL_DCA']['tl_calendar']['palettes']['default'] .= ';{edit_legend},AllowEdit';

$GLOBALS['TL_DCA']['tl_calendar']['palettes']['__selector__'][] = 'AllowEdit';
$GLOBALS['TL_DCA']['tl_calendar']['subpalettes']['AllowEdit']='caledit_onlyFuture, caledit_jumpTo, caledit_loginRequired, caledit_onlyUser, caledit_groups, caledit_adminGroup';



$GLOBALS['TL_DCA']['tl_calendar']['fields']['AllowEdit'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar']['AllowEdit'],
'exclude' => true,
'filter' => true,
'inputType' => 'checkbox',
'eval' => array('submitOnChange'=>true),
'sql' => "char(1) NOT NULL default ''"
);

$GLOBALS['TL_DCA']['tl_calendar']['fields']['caledit_onlyFuture'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar']['caledit_onlyFuture'],
'inputType' => 'checkbox',
'eval' => array('default'=>'true'),
'sql' => "char(1) NOT NULL default ''"
);

$GLOBALS['TL_DCA']['tl_calendar']['fields']['caledit_jumpTo'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar']['caledit_jumpTo'],
'exclude' => true,
'inputType' => 'pageTree',
'eval' => array('fieldType'=>'radio'),
'sql' => "int(10) unsigned NOT NULL default '0'"
);

$GLOBALS['TL_DCA']['tl_calendar']['fields']['caledit_loginRequired'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar']['caledit_loginRequired'],
'inputType' => 'checkbox',
'eval' => array('default'=>'true'),
'sql' => "char(1) NOT NULL default '1'"
);
$GLOBALS['TL_DCA']['tl_calendar']['fields']['caledit_onlyUser'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar']['caledit_onlyUser'],
'exclude' => true,
'inputType' => 'checkbox',
'sql' => "char(1) NOT NULL default ''"
);

$GLOBALS['TL_DCA']['tl_calendar']['fields']['caledit_groups'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar']['caledit_groups'],
'inputType' => 'checkbox',
'foreignKey' => 'tl_member_group.name',
'eval' => array(/*'mandatory'=>true, */ 'multiple'=>true),
'sql' => "blob NULL"
);

$GLOBALS['TL_DCA']['tl_calendar']['fields']['caledit_adminGroup'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar']['caledit_adminGroup'],
'inputType' => 'checkbox',
'foreignKey' => 'tl_member_group.name',
'eval' => array('mandatory'=>false, 'multiple'=>true),
'sql' => "blob NULL"
);
40 changes: 40 additions & 0 deletions contao/dca/tl_calendar_events.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/**
* This file is part of
*
* CalendarEditorBundle
* @copyright Daniel Gaußmann 2018
* @author Daniel Gaußmann (Gausi)
* @package Calendar_Editor
* @license LGPL-3.0-or-later
* @see https://github.com/Diversworld/Contao-CalendarEditor
*
* an extension for
* Contao Open Source CMS
* (c) Leo Feyer, LGPL-3.0-or-later
*
*/


$GLOBALS['TL_DCA']['tl_calendar_events']['palettes']['default'] .= ';{edit_legend},fe_user, disable_editing';


$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['fe_user'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['fe_user'],
'inputType' => 'select',
'exclude' => true,
'foreignKey' => 'tl_member.username',
'eval' => array('includeBlankOption'=>true, 'tl_class'=>'w50'),
'sql' => "int(10) unsigned NOT NULL default '0'"
);

$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['disable_editing'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['disable_editing'],
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50'),
'sql' => "char(1) NOT NULL default ''"
);

Loading