luisdias / CakePHP-Report-Manager-Plugin

CakePHP 2.x Report Manager Plugin
MIT License
42 stars 22 forks source link

JS changes to work on non-root URLs #1

Closed srs81 closed 12 years ago

srs81 commented 12 years ago

Hi, thanks for the great plugin. I found one problem where it doesn't work on non-root URLs.

I see that you solved the problem using the window.location and Javascript, but for some reason, it doesn't work on my app install.

I've re-factored the code slightly to get the "firstLevel" variable from CakePHP itself, so that way its always getting the right URL. This also reduces the Javascript dependency for getting the path information.

srs81 commented 12 years ago

I think it does for me - it doesn't give the trailing slash on your end?

luisdias commented 12 years ago

My point is: if there is an ending slash, you do not need the initial slash on the index.js file at the url ( right before report_manager : firstlevel + '/report_manager ...) otherwise we will have double slash in the firstlevel variable.

What do you think?

By the way, thank you for your cooperation!

2012/5/2 Suman reply@reply.github.com:

I think it does for me - it doesn't give the trailing slash on your end?


Reply to this email directly or view it on GitHub: https://github.com/luisdias/CakePHP-Report-Manager-Plugin/pull/1#issuecomment-5452995

L.D.

srs81 commented 12 years ago

Ah yes, totally agreed. :) Sorry about that. I interpreted your question the opposite way - somehow I thought the Router::url('/") was not returning a slash. The additional / is just in case, but not necessary, like you say.