-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Features - Added overviewPage and customLabel for recommendation readers 89420a7 - Added customLabel for recommendation lists 89420a7 - add an option to open a `dialog`-popup for recommendation lists 679b3f4 7820cd4 cc38f35 > In case you don't need a reader and want to shorten your recommendations with line-clamp. > This does not include any CSS and uses the native HTML functionality ### Bugfixes - Allow cspInlineStyles in recommendation teasers 7820cd4 - Do not show jumpTo link on reader pages when using reader on the same page e335f97 - Use own translations for `More` -description a70a94a - Properly check auto-item aliases in contao 5 1804ecb - Allow auto-item for Contao `5.x-dev` 31ff8db
- Loading branch information
Showing
14 changed files
with
186 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php $GLOBALS['TL_HEAD'][] = '<script> | ||
window.addEventListener("load", () => { | ||
new MutationObserver((mutations) => { | ||
mutations.forEach((mutation) => { | ||
const elements = mutation.target.matches(".rec_show-modal") ? mutation.target : mutation.target.querySelectorAll(".rec_show-modal"); | ||
elements.forEach(element => { | ||
element.addEventListener("click", (el) => { | ||
document.querySelector(`.rec_dialog_${el.currentTarget.dataset?.id}`)?.showModal(); | ||
}) | ||
}); | ||
}); | ||
}).observe(document, { attributes: false, childList: true, subtree: true }); | ||
}) | ||
</script>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Oveleon\ContaoRecommendationBundle\EventListener\DataContainer; | ||
|
||
use Contao\CoreBundle\DependencyInjection\Attribute\AsCallback; | ||
use Contao\CoreBundle\Security\ContaoCorePermissions; | ||
use Contao\Database; | ||
use Contao\DataContainer; | ||
use Contao\Input; | ||
use Contao\Message; | ||
use Contao\ModuleModel; | ||
use Contao\System; | ||
|
||
class ModuleListener | ||
{ | ||
#[AsCallback(table: 'tl_module', target: 'config.onload')] | ||
public function showJsLibraryHint(DataContainer $dc): void | ||
{ | ||
if ($_POST || Input::get('act') != 'edit') | ||
{ | ||
return; | ||
} | ||
|
||
$security = System::getContainer()->get('security.helper'); | ||
|
||
if ( | ||
!$security->isGranted(ContaoCorePermissions::USER_CAN_ACCESS_MODULE, 'themes') || | ||
!$security->isGranted(ContaoCorePermissions::USER_CAN_ACCESS_LAYOUTS) | ||
) { | ||
return; | ||
} | ||
|
||
$objModule = ModuleModel::findByPk($dc->id); | ||
|
||
if (null !== $objModule && 'recommendationlist' === $objModule->type) | ||
{ | ||
// Get module | ||
$objModule = Database::getInstance()->prepare("SELECT * FROM " . $dc->table . " WHERE id=?") | ||
->limit(1) | ||
->execute($dc->id); | ||
|
||
if (null !== $objModule && !!$objModule->recommendation_useDialog) | ||
{ | ||
Message::addInfo(sprintf(($GLOBALS['TL_LANG']['tl_module']['includeRecTemplate'] ?? null), 'js_recommendation')); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.