diff --git a/html/fun_gallery.html b/html/fun_gallery.html index b55404d..da3b52d 100755 --- a/html/fun_gallery.html +++ b/html/fun_gallery.html @@ -46,6 +46,50 @@ [end] +[if gallery_mount_type_arg_is "galleria1.2.9"] + + [if gallery_tab] + + + + + [if gallery_mount_theme_arg_is "transparent"] + + + [if-no winix_function_param_is "image"] + + [else] + + [end] + + [else] + [if gallery_mount_theme_arg_is "transparentinfo"] + + + [if-no winix_function_param_is "image"] + + [else] + + [end] + [else] + + + [if-no winix_function_param_is "image"] + + [else] + + [end] + [end] + [end] + + [end] + +[end] + [if gallery_mount_type_arg_is "galleriathumb"] @@ -79,4 +123,43 @@ [end] + +[if gallery_mount_type_arg_is "galleriathumb1.2.9"] + + + [if-no winix_function_param_is "image"] + [if gallery_tab] + + [end] + [else] + + [if gallery_tab] + + + + [if gallery_mount_theme_arg_is "transparent"] + + + [else] + [if gallery_mount_theme_arg_is "transparentinfo"] + + + [end] + [end] + + [end] + + [end] + +[end] + + diff --git a/html/index_head_functions_add.html b/html/index_head_functions_add.html index 35c4a9c..3e6db76 100755 --- a/html/index_head_functions_add.html +++ b/html/index_head_functions_add.html @@ -102,6 +102,11 @@ [end] + + [if-one gallery_mount_type_arg_is "galleria1.2.9" gallery_mount_type_arg_is "galleriathumb1.2.9"] + + + [end] [end] diff --git a/plugins/gallery/Makefile.dep b/plugins/gallery/Makefile.dep index a88f0ba..34dad4c 100755 --- a/plugins/gallery/Makefile.dep +++ b/plugins/gallery/Makefile.dep @@ -176,3 +176,4 @@ templates.o: ../../core/htmlfilter.h ../../templates/templates.h templates.o: ../../templates/patterncacher.h ../../templates/indexpatterns.h templates.o: ../../templates/patterns.h ../../templates/changepatterns.h templates.o: ../../templates/htmltextstream.h ../../core/sessionmanager.h +templates.o: ../../templates/miscspace.h ../../templates/templates.h diff --git a/plugins/gallery/gallery.cpp b/plugins/gallery/gallery.cpp index 3fb241f..01783a3 100755 --- a/plugins/gallery/gallery.cpp +++ b/plugins/gallery/gallery.cpp @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2011, Tomasz Sowa + * Copyright (c) 2011-2013, Tomasz Sowa * All rights reserved. * */ @@ -53,12 +53,13 @@ void Gallery::SortPointers() void Gallery::MakeGetDir() { iq.SetAll(false, false); - iq.sel_parent_id = true; - iq.sel_subject = true; - iq.sel_url = true; - iq.sel_type = true; - iq.sel_file = true; - iq.sel_sort_index = true; + iq.sel_parent_id = true; + iq.sel_subject = true; + iq.sel_url = true; + iq.sel_type = true; + iq.sel_file = true; + iq.sel_sort_index = true; + iq.sel_meta = true; iq.WhereParentId(cur->request->dir_tab.back()->id); iq.WhereFileType(WINIX_ITEM_FILETYPE_IMAGE); diff --git a/plugins/gallery/templates.cpp b/plugins/gallery/templates.cpp index ddbb200..83c2a0a 100755 --- a/plugins/gallery/templates.cpp +++ b/plugins/gallery/templates.cpp @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2011, Tomasz Sowa + * Copyright (c) 2011-2013, Tomasz Sowa * All rights reserved. * */ @@ -13,6 +13,7 @@ #include "core/plugin.h" #include "templates/templates.h" #include "functions/functions.h" +#include "templates/miscspace.h" @@ -85,6 +86,64 @@ void gallery_tab_link(Info & i) + + +void gallery_tab_meta_str(Info & i) +{ + if( gallery_index < gallery_info.item_sort_tab.size() ) + { + Item & item = *gallery_info.item_sort_tab[gallery_index]; + item.meta.Serialize(i.out, true, false); + } +} + + +void gallery_tab_meta(Info & i) +{ + if( gallery_index < gallery_info.item_sort_tab.size() ) + { + Item & item = *gallery_info.item_sort_tab[gallery_index]; + space(i, item.meta); + } +} + + +void gallery_tab_meta_tab(Info & i) +{ + if( gallery_index < gallery_info.item_sort_tab.size() ) + { + Item & item = *gallery_info.item_sort_tab[gallery_index]; + spaces_tab(i, item.meta); + } +} + + +void gallery_tab_meta_tab_value(Info & i) +{ + if( gallery_index < gallery_info.item_sort_tab.size() ) + { + Item & item = *gallery_info.item_sort_tab[gallery_index]; + spaces_tab_value(i, item.meta); + } +} + + +void gallery_tab_meta_tab_has_next(Info & i) +{ + if( gallery_index < gallery_info.item_sort_tab.size() ) + { + Item & item = *gallery_info.item_sort_tab[gallery_index]; + spaces_tab_has_next(i, item.meta); + } +} + + + + + + + + void gallery_width(Info & i) { if( !system->mounts.pmount ) @@ -147,17 +206,22 @@ void AddEzcFunctions(PluginInfo & info) using TemplatesFunctions::EzcFun; EzcFun * fun = reinterpret_cast(info.p1); - fun->Insert("gallery_tab", gallery_tab); - fun->Insert("gallery_tab_index", gallery_tab_index); - fun->Insert("gallery_tab_dir", gallery_tab_dir); - fun->Insert("gallery_tab_url", gallery_tab_url); - fun->Insert("gallery_tab_subject", gallery_tab_subject); - fun->Insert("gallery_tab_link", gallery_tab_link); - fun->Insert("gallery_width", gallery_width); - fun->Insert("gallery_height", gallery_height); - fun->Insert("gallery_has_not_mount_type", gallery_has_not_mount_type); - fun->Insert("gallery_mount_type_arg_is", gallery_mount_type_arg_is); - fun->Insert("gallery_mount_theme_arg_is", gallery_mount_theme_arg_is); + fun->Insert("gallery_tab", gallery_tab); + fun->Insert("gallery_tab_index", gallery_tab_index); + fun->Insert("gallery_tab_dir", gallery_tab_dir); + fun->Insert("gallery_tab_url", gallery_tab_url); + fun->Insert("gallery_tab_subject", gallery_tab_subject); + fun->Insert("gallery_tab_link", gallery_tab_link); + fun->Insert("gallery_tab_meta_str", gallery_tab_meta_str); + fun->Insert("gallery_tab_meta", gallery_tab_meta); + fun->Insert("gallery_tab_meta_tab", gallery_tab_meta_tab); + fun->Insert("gallery_tab_meta_tab_value", gallery_tab_meta_tab_value); + fun->Insert("gallery_tab_meta_tab_has_next", gallery_tab_meta_tab_has_next); + fun->Insert("gallery_width", gallery_width); + fun->Insert("gallery_height", gallery_height); + fun->Insert("gallery_has_not_mount_type", gallery_has_not_mount_type); + fun->Insert("gallery_mount_type_arg_is", gallery_mount_type_arg_is); + fun->Insert("gallery_mount_theme_arg_is", gallery_mount_theme_arg_is); } diff --git a/plugins/group/groups.cpp b/plugins/group/groups.cpp index b61e737..76f9a54 100755 --- a/plugins/group/groups.cpp +++ b/plugins/group/groups.cpp @@ -58,6 +58,9 @@ size_t i, v; for( i=0 ; i < set.spaces.size() ; ++i ) { PT::Space & group = *set.spaces[i]; + // !! IMPROVE ME will be safer to copy the value out + // if we used accidently the group.Text later the key + // would be overwritten const std::wstring & key = group.Text(L"key", L"value"); // loop through all values in the group diff --git a/templates/item.cpp b/templates/item.cpp index 2d461a4..0cd69f1 100755 --- a/templates/item.cpp +++ b/templates/item.cpp @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2008-2012, Tomasz Sowa + * Copyright (c) 2008-2013, Tomasz Sowa * All rights reserved. * */ @@ -803,6 +803,48 @@ void item_tab_has_next(Info & i) i.res = item_index + 1 < cur->request->item_tab.size(); } + + +void item_tab_meta_str(Info & i) +{ + if( item_index < cur->request->item_tab.size() ) + cur->request->item_tab[item_index].meta.Serialize(i.out, true, false); +} + + +void item_tab_meta(Info & i) +{ + if( item_index < cur->request->item_tab.size() ) + space(i, cur->request->item_tab[item_index].meta); +} + + +void item_tab_meta_tab(Info & i) +{ + if( item_index < cur->request->item_tab.size() ) + spaces_tab(i, cur->request->item_tab[item_index].meta); +} + + +void item_tab_meta_tab_value(Info & i) +{ + if( item_index < cur->request->item_tab.size() ) + spaces_tab_value(i, cur->request->item_tab[item_index].meta); +} + + + +void item_tab_meta_tab_has_next(Info & i) +{ + if( item_index < cur->request->item_tab.size() ) + spaces_tab_has_next(i, cur->request->item_tab[item_index].meta); +} + + + + + + } // namespace TemplatesFunctions diff --git a/templates/templates.cpp b/templates/templates.cpp index a290851..a9eb5b7 100755 --- a/templates/templates.cpp +++ b/templates/templates.cpp @@ -359,44 +359,49 @@ void Templates::CreateFunctions() ezc_functions.Insert("item_admin_meta_tab_value", item_admin_meta_tab_value); ezc_functions.Insert("item_admin_meta_tab_has_next", item_admin_meta_tab_has_next); - ezc_functions.Insert("item_tab", item_tab); - ezc_functions.Insert("item_tab_index", item_tab_index); - ezc_functions.Insert("item_tab_id", item_tab_id); - ezc_functions.Insert("item_tab_subject", item_tab_subject); - ezc_functions.Insert("item_tab_subject_noescape", item_tab_subject_noescape); - ezc_functions.Insert("item_tab_content", item_tab_content); - ezc_functions.Insert("item_tab_content_noescape", item_tab_content_noescape); - ezc_functions.Insert("item_tab_print_content", item_tab_print_content); - ezc_functions.Insert("item_tab_privileges", item_tab_privileges); - ezc_functions.Insert("item_tab_dir", item_tab_dir); - ezc_functions.Insert("item_tab_url", item_tab_url); - ezc_functions.Insert("item_tab_link", item_tab_link); - ezc_functions.Insert("item_tab_filetype_is_none", item_tab_filetype_is_none); - ezc_functions.Insert("item_tab_filetype_is_image", item_tab_filetype_is_image); - ezc_functions.Insert("item_tab_can_read", item_tab_can_read); - ezc_functions.Insert("item_tab_can_write", item_tab_can_write); - ezc_functions.Insert("item_tab_user", item_tab_user); - ezc_functions.Insert("item_tab_modification_user", item_tab_modification_user); - ezc_functions.Insert("item_tab_users_different", item_tab_users_different); - ezc_functions.Insert("item_tab_group", item_tab_group); - ezc_functions.Insert("item_tab_date_creation", item_tab_date_creation); - ezc_functions.Insert("item_tab_date_modification", item_tab_date_modification); - ezc_functions.Insert("item_tab_date_creation_nice", item_tab_date_creation_nice); - ezc_functions.Insert("item_tab_date_modification_nice", item_tab_date_modification_nice); - ezc_functions.Insert("item_tab_dates_equal", item_tab_dates_equal); - ezc_functions.Insert("item_tab_run", item_tab_run); - ezc_functions.Insert("item_tab_can_use_emacs", item_tab_can_use_emacs); - ezc_functions.Insert("item_tab_has_static_file", item_tab_has_static_file); - ezc_functions.Insert("item_tab_has_thumb", item_tab_has_thumb); - ezc_functions.Insert("item_tab_type_is_dir", item_tab_type_is_dir); - ezc_functions.Insert("item_tab_type_is_file", item_tab_type_is_file); - ezc_functions.Insert("item_tab_type_is_symlink", item_tab_type_is_symlink); - ezc_functions.Insert("item_tab_is_link_to", item_tab_is_link_to); - ezc_functions.Insert("item_tab_link_to", item_tab_link_to); - ezc_functions.Insert("item_tab_is_link_redirect", item_tab_is_link_redirect); - ezc_functions.Insert("item_tab_file_size", item_tab_file_size); - ezc_functions.Insert("item_tab_sort", item_tab_sort); - ezc_functions.Insert("item_tab_has_next", item_tab_has_next); + ezc_functions.Insert("item_tab", item_tab); + ezc_functions.Insert("item_tab_index", item_tab_index); + ezc_functions.Insert("item_tab_id", item_tab_id); + ezc_functions.Insert("item_tab_subject", item_tab_subject); + ezc_functions.Insert("item_tab_subject_noescape", item_tab_subject_noescape); + ezc_functions.Insert("item_tab_content", item_tab_content); + ezc_functions.Insert("item_tab_content_noescape", item_tab_content_noescape); + ezc_functions.Insert("item_tab_print_content", item_tab_print_content); + ezc_functions.Insert("item_tab_privileges", item_tab_privileges); + ezc_functions.Insert("item_tab_dir", item_tab_dir); + ezc_functions.Insert("item_tab_url", item_tab_url); + ezc_functions.Insert("item_tab_link", item_tab_link); + ezc_functions.Insert("item_tab_filetype_is_none", item_tab_filetype_is_none); + ezc_functions.Insert("item_tab_filetype_is_image", item_tab_filetype_is_image); + ezc_functions.Insert("item_tab_can_read", item_tab_can_read); + ezc_functions.Insert("item_tab_can_write", item_tab_can_write); + ezc_functions.Insert("item_tab_user", item_tab_user); + ezc_functions.Insert("item_tab_modification_user", item_tab_modification_user); + ezc_functions.Insert("item_tab_users_different", item_tab_users_different); + ezc_functions.Insert("item_tab_group", item_tab_group); + ezc_functions.Insert("item_tab_date_creation", item_tab_date_creation); + ezc_functions.Insert("item_tab_date_modification", item_tab_date_modification); + ezc_functions.Insert("item_tab_date_creation_nice", item_tab_date_creation_nice); + ezc_functions.Insert("item_tab_date_modification_nice", item_tab_date_modification_nice); + ezc_functions.Insert("item_tab_dates_equal", item_tab_dates_equal); + ezc_functions.Insert("item_tab_run", item_tab_run); + ezc_functions.Insert("item_tab_can_use_emacs", item_tab_can_use_emacs); + ezc_functions.Insert("item_tab_has_static_file", item_tab_has_static_file); + ezc_functions.Insert("item_tab_has_thumb", item_tab_has_thumb); + ezc_functions.Insert("item_tab_type_is_dir", item_tab_type_is_dir); + ezc_functions.Insert("item_tab_type_is_file", item_tab_type_is_file); + ezc_functions.Insert("item_tab_type_is_symlink", item_tab_type_is_symlink); + ezc_functions.Insert("item_tab_is_link_to", item_tab_is_link_to); + ezc_functions.Insert("item_tab_link_to", item_tab_link_to); + ezc_functions.Insert("item_tab_is_link_redirect", item_tab_is_link_redirect); + ezc_functions.Insert("item_tab_file_size", item_tab_file_size); + ezc_functions.Insert("item_tab_sort", item_tab_sort); + ezc_functions.Insert("item_tab_has_next", item_tab_has_next); + ezc_functions.Insert("item_tab_meta_str", item_tab_meta_str); + ezc_functions.Insert("item_tab_meta", item_tab_meta); + ezc_functions.Insert("item_tab_meta_tab", item_tab_meta_tab); + ezc_functions.Insert("item_tab_meta_tab_value", item_tab_meta_tab_value); + ezc_functions.Insert("item_tab_meta_tab_has_next", item_tab_meta_tab_has_next); /* diff --git a/templates/templates.h b/templates/templates.h index cbecdc6..cd59a28 100755 --- a/templates/templates.h +++ b/templates/templates.h @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2008-2012, Tomasz Sowa + * Copyright (c) 2008-2013, Tomasz Sowa * All rights reserved. * */ @@ -309,6 +309,11 @@ namespace TemplatesFunctions void item_tab_file_size(Info & i); void item_tab_sort(Info & i); void item_tab_has_next(Info & i); + void item_tab_meta_str(Info & i); + void item_tab_meta(Info & i); + void item_tab_meta_tab(Info & i); + void item_tab_meta_tab_value(Info & i); + void item_tab_meta_tab_has_next(Info & i); /*