Question changed to be more specific Firstly I'm using SilverStripe 2.4.7. I am tearing my hair out trying to figure out how to do this and I need to help.
Ok so I have a dataobject and I use a dataobjectmanager on the admin's page to look after all of the dataobjects. I also use dataobjectmanager on other user's pages to look after the dataobjects that only relate to them. So the fields in the dataobject are used in the popups on both types of pages (the admin and the user pages).
I need to add a checkbox to the admin page popup only so that when they create one of these dataobjects they can select multiple users and then the ids are saved in a linked table. I hope I'm being clear.
I have my getCMSFields function in my dataobject (Offer) and getCMSFields in AllOffers with a dataobjectmanager. how to I add the checkbox without adding it to every other page too?
I apologise for being unclear. I'll try to simplify. Basic users have there own page (which only they have access to) and can create movies (dataobject). The movies they create are only linked to them. The admin can edit all movies or create global ones, through their page, that apply to everyone (hence the linked table). Yes I had tried something like that.
if (! empty($stores))
But while this displayed the checkboxes perfectly, it caused a problem with saving in the database. Basically it just didn't save. I was thinking I need a function to populate the linked list but this seems like a bit of a hacky workaround.
I was also old that I should move that to the page rather than the dataobject but I'm not sure how.