How can I use the MY_ prefix in modules (like the /locale folder in G2). I would like to keep the possibility to update modules without loosing certain customization.
Tried to modify the organize_event.php in a MY_organize_event.php and only got a blank page 
while the same modification in the original file does the wanted job.
It is about making the organize-module accessible only for admins.
Posts: 25957
Does your new file extend the class organize_event_Core?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 25957
What options do you want the module to have?
I have created a test module and I guess you only want the admin to be able to 'organize'?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 25957
All I know is to build a module with MY_ to override other modules/core. That is why I asked what behavior you want for the organize.
perhaps another community member knows.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 66
I thought the same way like in G2. I take the original file, modify it an name it MY_ (G2 -> put in subfolder /locale) and the system will now take the MY_ file instead of the original.
What I did: I took the organize_event.php and added in line 24 this:
&& identity::active_user()->admin
to make the organize-menu-entry only visible for admin-users.
The result was a blank page.
Do I replace the original file with a MY_ file? Wills the original file be ignored if there is a MY_ file?
Or do I place additional functions and overrides in an additionally used (MY_) file?
Posts: 25957
All I know is to build a module with MY_ to override other modules/core. I could be wrong.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 25957
Well I can override helpers with MY_
what I did to test was: copied
gallery3/modules/helpers/organize_event.php
to
gallery3/modules/helpers/MY_organize_event.php
edited
class organize_event_Core {to
class organize_event extends organize_event_Core {Hope that helps.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 25957
Looking at the core gallery and gallery-contrib repository, I don't see one MY_ in a controller. I only see MY_ in helpers and library directories.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 66
Thanks a lot floridave. Thats it:
It works.
Now updates may come
Posts: 25957
That was not a big enough clue? I could have explained it better I guess.
Glad it is working for you as well.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 12
why do some files like "MY_album.php" are working well under my Path \themes\wind\helpers\MY_album.php,
and others like "MY_gallery_event.php" not.
This works only in the \modules\gallery\helpers\MY_gallery_event.php Path.
I would like to put all my custom made extended Classes in my Themes Path
and leave the core directory untouched.
And "MY_" Files under "/controllers/" doesen't work at all.
thanks in advance
Fred
Posts: 66
Maybe this can help you:
http://stackoverflow.com/questions/1309383/extending-the-template-controller-in-kohana
Especially the third answer: