added: some ezc functions (item_tab_meta*)

added: some ezc functions (gallery_tab_meta*) to gallery plugin
added: to gallery plugin: a new gallery: Gallery version 1.2.9



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@917 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2013-02-26 11:49:22 +00:00
parent 293e426ed4
commit be6e09c5af
9 changed files with 268 additions and 59 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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<EzcFun*>(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);
}

View File

@@ -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