hi there,
how would i go about changing a system driver like DC_Table.php in an update-safe way? putting it in the templates folder doesn't work, does it?
thanks
hi there,
how would i go about changing a system driver like DC_Table.php in an update-safe way? putting it in the templates folder doesn't work, does it?
thanks
No, it won't work. Please take a look how Catalog is made, it uses a custom data container.
yes, that is correct, but it doesn't help me at all... ;-)Originally Posted by Tru
you can rewrite ALL the DCA's to use your new driver, but then you run the risk of breaking standard modules if your driver doesn't have a new feature.
which isn't really update-safe, i would say :-)Originally Posted by thyon
Its' update safe of course, as your rewrites will be in dcaconfig.php not in each DCA file.
You're omitting to explain to us what you're trying to do, there are many things you can add/modify without having to resort to modifying the core DC_Table list/editor (which is one of the best around): buttons and function to the header and buttons to each record, load callbacks, list callbacks, group calbacks, etc...
you are right, maybe that is a better way to ask. i just want to completely disable the possibility to delete members. did it for the list in dcaconfig, but when choosing 'Edit multiple', a delete button appears at the bottom, coming from DC_Table.php, which is easy to find and comment out, but not update safe...Originally Posted by thyon
so if you have another, better idea, i'll take it ;-)
you just specify the 'closed' => true, in the DCA config, then you can no longer delete anything from that table.
EDIT: no that only permits no more adding records, so I guess you have to use a ondelete_callback to intercept the delete function.
good idea, but that would show the user the delete button and then on delete it tells them 'you cannot', which is weird... i would prefer to not show it in the first place, if possible... but thanks for your replies so far.Originally Posted by thyon
It'll be possible to override the delete and edit multiple buttons to hide.
no, not really. that's kind of the point :DOriginally Posted by thyon
use the onload_callback in the dca to load a custom css that hides the delete buttonCode:i just want to completely disable the possibility to delete members. did it for the list in dcaconfig, but when choosing 'Edit multiple', a delete button appears at the bottom, coming from DC_Table.php, which is easy to find and comment out, but not update safe...
then use the ondelete_callback to be sure that even if an user makes a "delete request" it won't work.
Consulenza Contao CMS https://www.intco.it
I meant, that you can simply remove the delete button completely, by removing it's button entry by unsetting the delete button array completely -- you don't even need to use CSS then... you can ALSO use the ondelete to ensure that it doesn't perform that action. I'm not sure why we can't just make a table set to ONLY perform certain functions.... you should add that as a feature request.
can you *please* tell me how to remove the delete button illustrated below without using css *and* without edit the DC_Table.phpOriginally Posted by thyon
http://easycaptures.com/fs/uploaded/528/6530446037.jpg
I guess the above is a sort of correction, I guess also it won't help the O.P.Originally Posted by thyon
Consulenza Contao CMS https://www.intco.it
great answers. thank you guys. i will play with the suggestions and probably post what i did finally. thanks.
I was talking about the delete button next to each entry (the "X"), as that can also delete. The DC_Table Driver doesn't have a check or variable to remove the multiple delete button. I think leo should introduce a simple matrix of allows operations into the config and then also check this to enable/disable the standard buttons and also remove the multiple buttons.
that one was actually easy, one line in the dcaconfig:
and the red X is gone ;-)Code:unset( $GLOBALS['TL_DCA']['tl_member']['list']['operations']['delete'] );
and how the heck would I do that???Originally Posted by ga.n
take a look at this: http://www.contao.org/callbacks.htmlOriginally Posted by alexB
and this: http://contao-factory.com/code-detail.html?id=4
Consulenza Contao CMS https://www.intco.it
bingo!
the last one was the info i was lacking / didn't know...
thanks, you rule!
Bookmarks