-
-
Save qzminski/f7c3ca49cb8f921f4b0f3a6012ede419 to your computer and use it in GitHub Desktop.
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
<?php | |
/** | |
* /system/modules/twoj_modul/dca/tl_iso_product.php (lub nawet /system/modules/dcaconfig.php) | |
*/ | |
$GLOBALS['TL_DCA']['tl_iso_product']['config']['onload_callback'][] = function () { | |
$user = \Contao\BackendUser::getInstance(); | |
if ($user->isAdmin) { | |
return; | |
} | |
$GLOBALS['TL_DCA']['tl_iso_product']['list']['sorting']['filter'][] = ['author=?', $user->id]; | |
}; | |
$GLOBALS['TL_DCA']['tl_iso_product']['fields']['author'] = [ | |
'default' => \Contao\BackendUser::getInstance()->id, | |
'sql' => "int(10) unsigned NOT NULL default '0'", | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment