Extending / overwriting panel classes

Is it easily possible to extend or overwrite panel classes like extending or overwriting page classes / models?

My use case: I have one directory with a large image collection. The images are assigned to projects. When showing a project on the frontend, I was able to simply overwrite the page class and its images() method so the images of the image collection directory would be returned, filtered by the according project.

It would be great to achieve the same functionality in the panel: opening the page and seeing the filtered images of the image collection directory instead of its own.

Are these image assigned to multiple projects or what is your reason not to upload them to their corresponding projects instead of into a big folder with all images.

I don’t think what you want can be achieved without modifying the core or some custom field hack.

The images need to be sortable all together so I thought the easiest way to achieve this was to put them into one directory.

Is there an update-surviving way to overwrite parts of the core? Like the site.php? But as far as I understood the docs and the code it’s not possible there?

As you suggested in an other topic, should I load the overwriting php classes in the index.php before autoloading is initiated?

I don’t feel very happy with the custom field hacks but maybe that’s the safest way to go. But changing the needed parts in the panel controller shouldn’t be too complicated and would be a lot cleaner.

Thank you for your help, as always!

I haven’t had a look at the source code, but if all you need is to change a controller, you can in fact overwrite those. You can find examples in the Authenticator plugin or the custom add form.