Skip to content

Instantly share code, notes, and snippets.

@qzminski
Last active May 12, 2016 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qzminski/f7c3ca49cb8f921f4b0f3a6012ede419 to your computer and use it in GitHub Desktop.
Save qzminski/f7c3ca49cb8f921f4b0f3a6012ede419 to your computer and use it in GitHub Desktop.
<?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