Results 1 to 20 of 20

Thread: edit system driver like DC_Table.php

  1. #1
    New user
    Join Date
    07-26-10.
    Posts
    14

    Default edit system driver like DC_Table.php

    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

  2. #2
    User
    Join Date
    07-26-09.
    Posts
    175

    Default Re: edit system driver like DC_Table.php

    No, it won't work. Please take a look how Catalog is made, it uses a custom data container.

  3. #3
    New user
    Join Date
    07-26-10.
    Posts
    14

    Default Re: edit system driver like DC_Table.php

    Quote Originally Posted by Tru
    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... ;-)

  4. #4
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: edit system driver like DC_Table.php

    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.

  5. #5
    New user
    Join Date
    07-26-10.
    Posts
    14

    Default Re: edit system driver like DC_Table.php

    Quote Originally Posted by thyon
    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 :-)

  6. #6
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: edit system driver like DC_Table.php

    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...

  7. #7
    New user
    Join Date
    07-26-10.
    Posts
    14

    Default Re: edit system driver like DC_Table.php

    Quote 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...
    so if you have another, better idea, i'll take it ;-)

  8. #8
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: edit system driver like DC_Table.php

    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.

  9. #9
    New user
    Join Date
    07-26-10.
    Posts
    14

    Default Re: edit system driver like DC_Table.php

    Quote Originally Posted by thyon
    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.

  10. #10
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: edit system driver like DC_Table.php

    It'll be possible to override the delete and edit multiple buttons to hide.

  11. #11
    New user
    Join Date
    07-26-10.
    Posts
    14

    Default Re: edit system driver like DC_Table.php

    Quote 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 :D

  12. #12
    User
    Join Date
    06-19-09.
    Posts
    328

    Default Re: edit system driver like DC_Table.php

    Code:
    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...
    use the onload_callback in the dca to load a custom css that hides the delete button
    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

  13. #13
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: edit system driver like DC_Table.php

    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.

  14. #14
    User
    Join Date
    06-19-09.
    Posts
    328

    Default Re: edit system driver like DC_Table.php

    Quote Originally Posted by thyon
    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
    can you *please* tell me how to remove the delete button illustrated below without using css *and* without edit the DC_Table.php

    http://easycaptures.com/fs/uploaded/528/6530446037.jpg

    Quote Originally Posted by thyon
    then ... you can ALSO use the ondelete to ensure that it doesn't perform that action.
    I guess the above is a sort of correction, I guess also it won't help the O.P.
    Consulenza Contao CMS https://www.intco.it

  15. #15
    New user
    Join Date
    07-26-10.
    Posts
    14

    Default Re: edit system driver like DC_Table.php

    great answers. thank you guys. i will play with the suggestions and probably post what i did finally. thanks.

  16. #16
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: edit system driver like DC_Table.php

    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.

  17. #17
    New user
    Join Date
    07-26-10.
    Posts
    14

    Default Re: edit system driver like DC_Table.php

    that one was actually easy, one line in the dcaconfig:

    Code:
    unset( $GLOBALS['TL_DCA']['tl_member']['list']['operations']['delete'] );
    and the red X is gone ;-)

  18. #18
    New user
    Join Date
    07-26-10.
    Posts
    14

    Default Re: edit system driver like DC_Table.php

    Quote Originally Posted by ga.n
    use the onload_callback in the dca to load a custom css
    and how the heck would I do that???

  19. #19
    User
    Join Date
    06-19-09.
    Posts
    328

    Default Re: edit system driver like DC_Table.php

    Quote Originally Posted by alexB
    Quote Originally Posted by ga.n
    use the onload_callback in the dca to load a custom css
    and how the heck would I do that???
    take a look at this: http://www.contao.org/callbacks.html

    and this: http://contao-factory.com/code-detail.html?id=4
    Consulenza Contao CMS https://www.intco.it

  20. #20
    New user
    Join Date
    07-26-10.
    Posts
    14

    Default Re: edit system driver like DC_Table.php

    bingo!
    the last one was the info i was lacking / didn't know...

    thanks, you rule!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •