Skip to content

Commit

Permalink
Remove view
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-farre committed Nov 18, 2024
1 parent eeb1fa7 commit 0ed9e1c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 40 deletions.
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
1.7.0 (Unreleased)
-----------------------
- Fix #509: Fix event type visibility
- Enh #512: Move the widget wall entry links to a view and surround the links with a dedicated HTML class
- Enh #512: Surround the widget wall entry links with a dedicated HTML class

1.6.4 (Unreleased)
-----------------------
Expand Down
15 changes: 12 additions & 3 deletions widgets/DownloadIcsLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
namespace humhub\modules\calendar\widgets;

use humhub\components\Widget;
use humhub\libs\Html;
use humhub\modules\calendar\helpers\Url;
use humhub\modules\calendar\interfaces\event\CalendarEventIF;
use Yii;

/**
* Class DownloadIcsLink
Expand All @@ -27,8 +30,14 @@ public function run()
return '';
}

return $this->render('downloadLink', [
'calendarEntry' => $this->calendarEntry,
]);
return Html::tag(
'span',
Html::a(
Yii::t('CalendarModule.base', 'Download ICS'),
Url::toEntryDownloadICS($this->calendarEntry),
['target' => '_blank'],
),
['class' => 'calendar-entry-ics-download'],
);
}
}
16 changes: 12 additions & 4 deletions widgets/ReminderLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
namespace humhub\modules\calendar\widgets;

use humhub\components\Widget;
use humhub\libs\Html;
use humhub\modules\calendar\helpers\Url;
use humhub\modules\calendar\interfaces\event\CalendarEventIF;
use humhub\modules\content\components\ContentActiveRecord;
use humhub\widgets\ModalButton;
use Yii;

/**
* Class DownloadIcsLink
Expand All @@ -24,12 +28,16 @@ class ReminderLink extends Widget

public function run()
{
if (!$this->entry || !$this->entry instanceof ContentActiveRecord || !$this->entry instanceof CalendarEventIF) {
if (!$this->entry instanceof ContentActiveRecord || !$this->entry instanceof CalendarEventIF) {
return;
}

return $this->render('reminderLink', [
'entry' => $this->entry,
]);
return Html::tag(
'span',
ModalButton::asLink(Yii::t('CalendarModule.base', 'Set reminder'))
->load(Url::toUserLevelReminderConfig($this->entry))
->loader(true),
['class' => 'calendar-entry-reminder'],
);
}
}
16 changes: 0 additions & 16 deletions widgets/views/downloadLink.php

This file was deleted.

16 changes: 0 additions & 16 deletions widgets/views/reminderLink.php

This file was deleted.

0 comments on commit 0ed9e1c

Please sign in to comment.