Skip to content

Commit

Permalink
Merge pull request #22134 from nextcloud/merge-calendar-activity-sett…
Browse files Browse the repository at this point in the history
…ings

merge activity settings for calendars, events and todos
  • Loading branch information
rullzer authored Aug 26, 2020
2 parents cb2695d + 460db94 commit df99d8f
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 44 deletions.
1 change: 1 addition & 0 deletions apps/dav/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Provider/Calendar.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => $baseDir . '/../lib/CalDAV/Activity/Provider/Event.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Provider/Todo.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\CalDAVSetting' => $baseDir . '/../lib/CalDAV/Activity/Setting/CalDAVSetting.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Setting/Calendar.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => $baseDir . '/../lib/CalDAV/Activity/Setting/Event.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Setting/Todo.php',
Expand Down
1 change: 1 addition & 0 deletions apps/dav/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ComposerStaticInitDAV
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Calendar.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Event.php',
'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Todo.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\CalDAVSetting' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/CalDAVSetting.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Calendar.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Event.php',
'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Todo.php',
Expand Down
47 changes: 47 additions & 0 deletions apps/dav/lib/CalDAV/Activity/Setting/CalDAVSetting.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

declare(strict_types=1);
/**
* @copyright Copyright (c) 2020 Robin Appelman <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCA\DAV\CalDAV\Activity\Setting;

use OCP\Activity\ActivitySettings;
use OCP\IL10N;

abstract class CalDAVSetting extends ActivitySettings {
/** @var IL10N */
protected $l;

/**
* @param IL10N $l
*/
public function __construct(IL10N $l) {
$this->l = $l;
}

public function getGroupIdentifier() {
return 'calendar';
}

public function getGroupName() {
return $this->l->t('Calendar and tasks');
}
}
16 changes: 1 addition & 15 deletions apps/dav/lib/CalDAV/Activity/Setting/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,7 @@

namespace OCA\DAV\CalDAV\Activity\Setting;

use OCP\Activity\ISetting;
use OCP\IL10N;

class Calendar implements ISetting {

/** @var IL10N */
protected $l;

/**
* @param IL10N $l
*/
public function __construct(IL10N $l) {
$this->l = $l;
}

class Calendar extends CalDAVSetting {
/**
* @return string Lowercase a-z and underscore only identifier
* @since 11.0.0
Expand Down
16 changes: 1 addition & 15 deletions apps/dav/lib/CalDAV/Activity/Setting/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,7 @@

namespace OCA\DAV\CalDAV\Activity\Setting;

use OCP\Activity\ISetting;
use OCP\IL10N;

class Event implements ISetting {

/** @var IL10N */
protected $l;

/**
* @param IL10N $l
*/
public function __construct(IL10N $l) {
$this->l = $l;
}

class Event extends CalDAVSetting {
/**
* @return string Lowercase a-z and underscore only identifier
* @since 11.0.0
Expand Down
15 changes: 1 addition & 14 deletions apps/dav/lib/CalDAV/Activity/Setting/Todo.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,7 @@

namespace OCA\DAV\CalDAV\Activity\Setting;

use OCP\Activity\ISetting;
use OCP\IL10N;

class Todo implements ISetting {

/** @var IL10N */
protected $l;

/**
* @param IL10N $l
*/
public function __construct(IL10N $l) {
$this->l = $l;
}
class Todo extends CalDAVSetting {

/**
* @return string Lowercase a-z and underscore only identifier
Expand Down

0 comments on commit df99d8f

Please sign in to comment.