The correct places for uploaded-by-user layout file and css file

yes,

There’s a static method to get its alias by its ID




$this->layout=LayoutModule::getLayoutAlias($id);



what do you mean by replace ?

Reupload a file to overwrite the old one?

no no.

There might be other solution to it and that is rename of the newly uploaded theme.

But the effective solution could be achieved by storing the information into the database and instead of using its ID, its name of dir should be used.

Sorry for taking so long … I’m very busy lately

I didn’t have time to finish yet so I’ll post it here with the dependencies, like suggested, and you do whatever you want

Code edition not done, also the after area edit part, its only half done

feel free to ask me anything, I’m sure you will have some doubts

It will comes also with some dependencies that I use in my base application, that may be useful for you

hope you enjoy,

Cheers

EDIT: removed some more dependencies and posted under tips & tutorials here

i build a small business application for building websites "on the air", in this application you can upload your own PHP file that simply is expected to returns a value from a well know function (public function main() { returns "code"; } ), and this value is expected to be a CSS or HTML layout…BUT…this application is used only by my small office members (very small, my wife as web page builder role, and two friends, in the same role, they create websites every day using this tool)…it resolve a lot a problems, because they can upload its own galleries or other stuff, whitout waiting for me for upload a new feature.

Well, opening this feature to public usage will be a big problem as you said, but in a controlled environment will be very usefull…

a an example, all this website is build as "virtual" (created on the air on request) : http://www.cleanandbrightservices.com and its gallery is build using a uploaded "gallery.php" always stored in a blob on the website main db record.