mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Added up directory links to the BrowsableFolderServeNode.
This commit is contained in:
parent
a4e4df979d
commit
b337b8f7de
@ -68,16 +68,24 @@ void BrowsableFolderServeNode::evaluate_dir(const String &path, const bool top_l
|
||||
folders.sort_inc();
|
||||
files.sort_inc();
|
||||
|
||||
render_dir_page(dir_uri, folders, files);
|
||||
render_dir_page(dir_uri, folders, files, top_level);
|
||||
}
|
||||
|
||||
void BrowsableFolderServeNode::render_dir_page(const String &dir_uri, const Vector<String> &folders, const Vector<String> &files) {
|
||||
void BrowsableFolderServeNode::render_dir_page(const String &dir_uri, const Vector<String> &folders, const Vector<String> &files, const bool top_level) {
|
||||
HTMLBuilder b;
|
||||
|
||||
String uri = get_full_uri(false);
|
||||
|
||||
b.div("file_list");
|
||||
{
|
||||
if (!top_level) {
|
||||
b.div("file_list_entry");
|
||||
{
|
||||
b.a(uri + dir_uri.path_get_prev_dir())->w("..")->ca();
|
||||
}
|
||||
b.cdiv();
|
||||
}
|
||||
|
||||
for (int i = 0; i < folders.size(); ++i) {
|
||||
b.div("file_list_entry");
|
||||
{
|
||||
@ -109,7 +117,7 @@ BrowsableFolderServeNode::BrowsableFolderServeNode() :
|
||||
}
|
||||
|
||||
BrowsableFolderServeNode::~BrowsableFolderServeNode() {
|
||||
for (std::map<String, String*>::iterator E = _folder_indexes.begin(); E != _folder_indexes.end(); E++) {
|
||||
for (std::map<String, String *>::iterator E = _folder_indexes.begin(); E != _folder_indexes.end(); E++) {
|
||||
if (E->second) {
|
||||
delete E->second;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ public:
|
||||
virtual void load();
|
||||
|
||||
void evaluate_dir(const String &path, const bool top_level = false);
|
||||
virtual void render_dir_page(const String &dir_uri, const Vector<String> &folders, const Vector<String> &files);
|
||||
virtual void render_dir_page(const String &dir_uri, const Vector<String> &folders, const Vector<String> &files, const bool top_level);
|
||||
|
||||
bool should_render_menu;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user