gilbitron / Pico-Editor-Plugin

Provides an online Markdown editor and file manager for Pico.
http://pico.dev7studios.com
MIT License
58 stars 30 forks source link

Fix subdirectories #4

Open exhnozoaa opened 11 years ago

exhnozoaa commented 11 years ago

In this fork/branch, do_open(), do_save(), and do_delete() now support subdirectories and index.md files. Instead of using basename() on the URL, it is now using parse_url().

Currently, Pico does not support files with the same names as directories. In this fork/branch, the plugin uses the correct file/directory based on a trailing slash being used for directories and no trailing slash being used for files. However, this will not fix that the directory will override the file on the Pico front end (a different bug for a different project).

exhnozoaa commented 11 years ago

This is meant to address issue #2, but I can't seem to figure out how to link them in GitHub. I apologize for the duplicate issue.

csholmq commented 11 years ago

This didn't fix my issues. If anything now I can't edit anything.

exhnozoaa commented 11 years ago

Thanks for the feedback. Hmm... I'm not sure what the problem could be. Where there any error messages, or did it just not work?

csholmq commented 11 years ago

I have no idea. I turned on all PHP errors but nothing showed up. All I get is Error: Invalid file. I can successfully create and edit a file. But as soon as I click on another file the error message pops up. So something is up with opening them.

csholmq commented 11 years ago

I did some probing and it's line 122 that goes off. I.e the second die(error) in do_open. I think it's due to my site being in a subdirectory.

print_r($parse_file_url) Array ( [scheme] => http [host] => honken.eu [path] => /pages/blog/pwd_req )

echo CONTENT_DIR . $parse_file_url['path'] /share/MD0_DATA/Web/pages/content//pages/blog/pwd_req

As you can see /pages is my subdirectory and is in both path and the physical file path.

pomaxa commented 11 years ago

It will be nice, to be able to create subdirictory and a new page in subdirictory; btw, - thanks

pomaxa commented 11 years ago

@exhnozoaa I've taken your changes and create a new pull request with some more improvements (https://github.com/gilbitron/Pico-Editor-Plugin/pull/5)

pomaxa commented 10 years ago

@varakh - I haven't use pico for a while, - so can't tell you right now, but if you can describe the error in my version, I'll be able to update it.

pomaxa commented 10 years ago

@varakh have you update base_url ?

pomaxa commented 10 years ago

all scripts use this var when load resources like

<script src="{{ base_url }}/{{ plugin_path }}/epiceditor/js/epiceditor.min.js"></script>

so if you change your base_url, by moving your project from root dir, please be sure to update this var.

pomaxa commented 10 years ago

@varakh - have you check error log ? can you show an example?

ghost commented 10 years ago

@pomaxa I just moved it to / and won't try it in /blog/ again. Guess I won't be able to figure out a solution to this problem. But nevermind. It's okay like this. Thanks anyway.