changed: added Cur structure
we have there two pointers: Request * request; Session * session; these are the current request and the current session the session GC was moved to SessionManager (was in SessionContainer) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@708 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -28,41 +28,41 @@ static EzcGen ezc_generator;
|
||||
|
||||
void item_is(Info & i)
|
||||
{
|
||||
i.res = request->is_item;
|
||||
i.res = cur->request->is_item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void item_id(Info & i)
|
||||
{
|
||||
i.out << request->item.id;
|
||||
i.out << cur->request->item.id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void item_subject(Info & i)
|
||||
{
|
||||
i.out << request->item.subject;
|
||||
i.out << cur->request->item.subject;
|
||||
}
|
||||
|
||||
|
||||
void item_subject_noescape(Info & i)
|
||||
{
|
||||
i.out << R(request->item.subject);
|
||||
i.out << R(cur->request->item.subject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void item_content(Info & i)
|
||||
{
|
||||
i.out << request->item.content;
|
||||
i.out << cur->request->item.content;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void item_content_noescape(Info & i)
|
||||
{
|
||||
i.out << R(request->item.content);
|
||||
i.out << R(cur->request->item.content);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ void item_content_type_is(Item & item, Info & i)
|
||||
|
||||
void item_content_type_is(Info & i)
|
||||
{
|
||||
item_content_type_is(request->item, i);
|
||||
item_content_type_is(cur->request->item, i);
|
||||
}
|
||||
|
||||
|
||||
@@ -124,19 +124,19 @@ void item_print_content(HtmlTextStream & out, const std::wstring & content, Item
|
||||
|
||||
void item_content_is_empty(Info & i)
|
||||
{
|
||||
i.res = request->item.content.empty();
|
||||
i.res = cur->request->item.content.empty();
|
||||
}
|
||||
|
||||
void item_print_content(Info & i)
|
||||
{
|
||||
item_print_content(i.out, request->item.content, request->item.content_type);
|
||||
item_print_content(i.out, cur->request->item.content, cur->request->item.content_type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void item_privileges(Info & i)
|
||||
{
|
||||
i.out << Toa(request->item.privileges, 8);
|
||||
i.out << Toa(cur->request->item.privileges, 8);
|
||||
}
|
||||
|
||||
|
||||
@@ -148,16 +148,16 @@ void item_dir(Info & i)
|
||||
|
||||
void item_url(Info & i)
|
||||
{
|
||||
i.out << request->item.url;
|
||||
i.out << cur->request->item.url;
|
||||
}
|
||||
|
||||
|
||||
void item_url_is(Info & i)
|
||||
{
|
||||
if( !request->is_item )
|
||||
if( !cur->request->is_item )
|
||||
return; // default false
|
||||
|
||||
i.res = (request->item.url == i.par);
|
||||
i.res = (cur->request->item.url == i.par);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,37 +173,37 @@ void item_link(Info & i)
|
||||
|
||||
void item_filetype_is_none(Info & i)
|
||||
{
|
||||
i.res = request->item.file_type == WINIX_ITEM_FILETYPE_NONE;
|
||||
i.res = cur->request->item.file_type == WINIX_ITEM_FILETYPE_NONE;
|
||||
}
|
||||
|
||||
|
||||
void item_filetype_is_image(Info & i)
|
||||
{
|
||||
i.res = request->item.file_type == WINIX_ITEM_FILETYPE_IMAGE;
|
||||
i.res = cur->request->item.file_type == WINIX_ITEM_FILETYPE_IMAGE;
|
||||
}
|
||||
|
||||
|
||||
void item_has_static_file(Info & i)
|
||||
{
|
||||
i.res = request->item.file_type != WINIX_ITEM_FILETYPE_NONE && !request->item.file_path.empty();
|
||||
i.res = cur->request->item.file_type != WINIX_ITEM_FILETYPE_NONE && !cur->request->item.file_path.empty();
|
||||
}
|
||||
|
||||
|
||||
void item_has_thumb(Info & i)
|
||||
{
|
||||
i.res = request->item.has_thumb;
|
||||
i.res = cur->request->item.has_thumb;
|
||||
}
|
||||
|
||||
|
||||
void item_can_read(Info & i)
|
||||
{
|
||||
i.res = system->HasReadAccess(request->item);
|
||||
i.res = system->HasReadAccess(cur->request->item);
|
||||
}
|
||||
|
||||
|
||||
void item_can_write(Info & i)
|
||||
{
|
||||
i.res = system->HasWriteAccess(request->item);
|
||||
i.res = system->HasWriteAccess(cur->request->item);
|
||||
}
|
||||
|
||||
|
||||
@@ -211,61 +211,61 @@ void item_can_remove(Info & i)
|
||||
{
|
||||
// !! tutaj trzeba bedzie cos innego zrobic
|
||||
// zwlaszcza jak dojdzie sticky bit
|
||||
i.res = system->HasWriteAccess(*request->dir_tab.back());
|
||||
i.res = system->HasWriteAccess(*cur->request->dir_tab.back());
|
||||
}
|
||||
|
||||
|
||||
void item_user(Info & i)
|
||||
{
|
||||
User * puser = system->users.GetUser(request->item.user_id);
|
||||
print_user_name(i, puser, request->item.guest_name);
|
||||
User * puser = system->users.GetUser(cur->request->item.user_id);
|
||||
print_user_name(i, puser, cur->request->item.guest_name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void item_modification_user(Info & i)
|
||||
{
|
||||
User * puser = system->users.GetUser(request->item.modification_user_id);
|
||||
print_user_name(i, puser, request->item.guest_name);
|
||||
User * puser = system->users.GetUser(cur->request->item.modification_user_id);
|
||||
print_user_name(i, puser, cur->request->item.guest_name);
|
||||
}
|
||||
|
||||
|
||||
void item_users_different(Info & i)
|
||||
{
|
||||
i.res = (request->item.user_id != request->item.modification_user_id);
|
||||
i.res = (cur->request->item.user_id != cur->request->item.modification_user_id);
|
||||
}
|
||||
|
||||
|
||||
void item_date_creation(Info & i)
|
||||
{
|
||||
tm rtm = system->LocalTime(request->item.date_creation);
|
||||
tm rtm = system->LocalTime(cur->request->item.date_creation);
|
||||
i.out << DateToStr(rtm.tm_year + 1900, rtm.tm_mon + 1, rtm.tm_mday, rtm.tm_hour, rtm.tm_min, rtm.tm_sec);
|
||||
}
|
||||
|
||||
|
||||
void item_date_modification(Info & i)
|
||||
{
|
||||
tm rtm = system->LocalTime(request->item.date_modification);
|
||||
tm rtm = system->LocalTime(cur->request->item.date_modification);
|
||||
i.out << DateToStr(rtm.tm_year + 1900, rtm.tm_mon + 1, rtm.tm_mday, rtm.tm_hour, rtm.tm_min, rtm.tm_sec);
|
||||
}
|
||||
|
||||
|
||||
void item_date_creation_nice(Info & i)
|
||||
{
|
||||
print_date_nice(i, request->item.date_creation);
|
||||
print_date_nice(i, cur->request->item.date_creation);
|
||||
}
|
||||
|
||||
|
||||
void item_date_modification_nice(Info & i)
|
||||
{
|
||||
print_date_nice(i, request->item.date_modification);
|
||||
print_date_nice(i, cur->request->item.date_modification);
|
||||
}
|
||||
|
||||
|
||||
void item_dates_equal(Info & i)
|
||||
{
|
||||
tm * ptm1 = &request->item.date_creation;
|
||||
tm * ptm2 = &request->item.date_modification;
|
||||
tm * ptm1 = &cur->request->item.date_creation;
|
||||
tm * ptm2 = &cur->request->item.date_modification;
|
||||
|
||||
i.res = ptm1->tm_year == ptm2->tm_year &&
|
||||
ptm1->tm_mon == ptm2->tm_mon &&
|
||||
@@ -279,20 +279,20 @@ void item_dates_equal(Info & i)
|
||||
|
||||
void item_run(Info & i)
|
||||
{
|
||||
if( !request->is_item )
|
||||
if( !cur->request->is_item )
|
||||
{
|
||||
i.out << "<!-- there is no an item to run -->";
|
||||
return;
|
||||
}
|
||||
|
||||
if( system->HasReadExecAccess(request->item) )
|
||||
if( system->HasReadExecAccess(cur->request->item) )
|
||||
{
|
||||
Ezc::Pattern * p = pattern_cacher.GetPattern(request->item);
|
||||
Ezc::Pattern * p = pattern_cacher.GetPattern(cur->request->item);
|
||||
|
||||
item_run_content.Clear();
|
||||
ezc_generator.Generate(item_run_content, *p);
|
||||
|
||||
item_print_content(i.out, item_run_content.Str(), request->item.content_type);
|
||||
item_print_content(i.out, item_run_content.Str(), cur->request->item.content_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -303,55 +303,55 @@ void item_run(Info & i)
|
||||
|
||||
void item_guest_name(Info & i)
|
||||
{
|
||||
i.out << request->item.guest_name;
|
||||
i.out << cur->request->item.guest_name;
|
||||
}
|
||||
|
||||
|
||||
void item_html_template(Info & i)
|
||||
{
|
||||
i.out << request->item.html_template;
|
||||
i.out << cur->request->item.html_template;
|
||||
}
|
||||
|
||||
|
||||
void item_has_html_template(Info & i)
|
||||
{
|
||||
i.res = !request->item.html_template.empty();
|
||||
i.res = !cur->request->item.html_template.empty();
|
||||
}
|
||||
|
||||
|
||||
void item_type_is_dir(Info & i)
|
||||
{
|
||||
i.res = request->item.type == Item::dir;
|
||||
i.res = cur->request->item.type == Item::dir;
|
||||
}
|
||||
|
||||
|
||||
void item_type_is_file(Info & i)
|
||||
{
|
||||
i.res = request->item.type == Item::file;
|
||||
i.res = cur->request->item.type == Item::file;
|
||||
}
|
||||
|
||||
|
||||
void item_type_is_symlink(Info & i)
|
||||
{
|
||||
i.res = request->item.type == Item::symlink;
|
||||
i.res = cur->request->item.type == Item::symlink;
|
||||
}
|
||||
|
||||
|
||||
void item_is_link_to(Info & i)
|
||||
{
|
||||
i.res = !request->item.link_to.empty();
|
||||
i.res = !cur->request->item.link_to.empty();
|
||||
}
|
||||
|
||||
|
||||
void item_link_to(Info & i)
|
||||
{
|
||||
i.out << request->item.link_to;
|
||||
i.out << cur->request->item.link_to;
|
||||
}
|
||||
|
||||
|
||||
void item_is_link_redirect(Info & i)
|
||||
{
|
||||
i.res = request->item.link_redirect == 1;
|
||||
i.res = cur->request->item.link_redirect == 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -364,51 +364,51 @@ static size_t item_index;
|
||||
void item_tab(Info & i)
|
||||
{
|
||||
item_index = i.iter;
|
||||
i.res = item_index < request->item_tab.size();
|
||||
i.res = item_index < cur->request->item_tab.size();
|
||||
}
|
||||
|
||||
|
||||
void item_tab_id(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.out << request->item_tab[item_index].id;
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.out << cur->request->item_tab[item_index].id;
|
||||
}
|
||||
|
||||
|
||||
void item_tab_subject(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.out << request->item_tab[item_index].subject;
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.out << cur->request->item_tab[item_index].subject;
|
||||
}
|
||||
|
||||
void item_tab_subject_noescape(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.out << R(request->item_tab[item_index].subject);
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.out << R(cur->request->item_tab[item_index].subject);
|
||||
}
|
||||
|
||||
|
||||
void item_tab_content(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.out << request->item_tab[item_index].content;
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.out << cur->request->item_tab[item_index].content;
|
||||
}
|
||||
|
||||
|
||||
void item_tab_content_noescape(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.out << R(request->item_tab[item_index].content);
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.out << R(cur->request->item_tab[item_index].content);
|
||||
}
|
||||
|
||||
|
||||
void item_tab_print_content(Info & i)
|
||||
{
|
||||
if( item_index >= request->item_tab.size() )
|
||||
if( item_index >= cur->request->item_tab.size() )
|
||||
return;
|
||||
|
||||
std::wstring & content = request->item_tab[item_index].content;
|
||||
Item::ContentType type = request->item_tab[item_index].content_type;
|
||||
std::wstring & content = cur->request->item_tab[item_index].content;
|
||||
Item::ContentType type = cur->request->item_tab[item_index].content_type;
|
||||
|
||||
item_print_content(i.out, content, type);
|
||||
}
|
||||
@@ -416,19 +416,19 @@ void item_tab_print_content(Info & i)
|
||||
|
||||
void item_tab_privileges(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.out << "0" << Toa(request->item_tab[item_index].privileges, 8);
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.out << "0" << Toa(cur->request->item_tab[item_index].privileges, 8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void item_tab_dir(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
std::wstring path;
|
||||
|
||||
if( system->dirs.MakePath(request->item_tab[item_index].parent_id, path) )
|
||||
if( system->dirs.MakePath(cur->request->item_tab[item_index].parent_id, path) )
|
||||
i.out << path;
|
||||
else
|
||||
i.out << "/the path does not exist/"; // !! do konfiga
|
||||
@@ -438,14 +438,14 @@ void item_tab_dir(Info & i)
|
||||
|
||||
void item_tab_url(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.out << request->item_tab[item_index].url;
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.out << cur->request->item_tab[item_index].url;
|
||||
}
|
||||
|
||||
|
||||
void item_tab_link(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
i.out << config->base_url;
|
||||
item_tab_dir(i);
|
||||
@@ -458,9 +458,9 @@ void item_tab_link(Info & i)
|
||||
|
||||
void item_tab_can_read(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
if( system->HasReadAccess(request->item_tab[item_index]) )
|
||||
if( system->HasReadAccess(cur->request->item_tab[item_index]) )
|
||||
i.res = true;
|
||||
}
|
||||
}
|
||||
@@ -468,9 +468,9 @@ void item_tab_can_read(Info & i)
|
||||
|
||||
void item_tab_can_write(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
if( system->HasWriteAccess(request->item_tab[item_index]) )
|
||||
if( system->HasWriteAccess(cur->request->item_tab[item_index]) )
|
||||
i.res = true;
|
||||
}
|
||||
}
|
||||
@@ -478,10 +478,10 @@ void item_tab_can_write(Info & i)
|
||||
|
||||
void item_tab_user(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
User * puser = system->users.GetUser(request->item_tab[item_index].user_id);
|
||||
print_user_name(i, puser, request->item_tab[item_index].guest_name);
|
||||
User * puser = system->users.GetUser(cur->request->item_tab[item_index].user_id);
|
||||
print_user_name(i, puser, cur->request->item_tab[item_index].guest_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -489,10 +489,10 @@ void item_tab_user(Info & i)
|
||||
|
||||
void item_tab_modification_user(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
User * puser = system->users.GetUser(request->item_tab[item_index].modification_user_id);
|
||||
print_user_name(i, puser, request->item_tab[item_index].guest_name);
|
||||
User * puser = system->users.GetUser(cur->request->item_tab[item_index].modification_user_id);
|
||||
print_user_name(i, puser, cur->request->item_tab[item_index].guest_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,9 +500,9 @@ void item_tab_modification_user(Info & i)
|
||||
|
||||
void item_tab_users_different(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
i.res = (request->item_tab[item_index].user_id != request->item_tab[item_index].modification_user_id);
|
||||
i.res = (cur->request->item_tab[item_index].user_id != cur->request->item_tab[item_index].modification_user_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,9 +510,9 @@ void item_tab_users_different(Info & i)
|
||||
|
||||
void item_tab_group(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
long group_id = request->item_tab[item_index].group_id;
|
||||
long group_id = cur->request->item_tab[item_index].group_id;
|
||||
Group * pgroup = system->groups.GetGroup(group_id);
|
||||
|
||||
if( pgroup )
|
||||
@@ -525,9 +525,9 @@ void item_tab_group(Info & i)
|
||||
|
||||
void item_tab_date_creation(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
tm rtm = system->LocalTime(request->item_tab[item_index].date_creation);
|
||||
tm rtm = system->LocalTime(cur->request->item_tab[item_index].date_creation);
|
||||
i.out << DateToStr(rtm.tm_year + 1900, rtm.tm_mon + 1, rtm.tm_mday, rtm.tm_hour, rtm.tm_min, rtm.tm_sec);
|
||||
}
|
||||
}
|
||||
@@ -535,9 +535,9 @@ void item_tab_date_creation(Info & i)
|
||||
|
||||
void item_tab_date_modification(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
tm rtm = system->LocalTime(request->item_tab[item_index].date_modification);
|
||||
tm rtm = system->LocalTime(cur->request->item_tab[item_index].date_modification);
|
||||
i.out << DateToStr(rtm.tm_year + 1900, rtm.tm_mon + 1, rtm.tm_mday, rtm.tm_hour, rtm.tm_min, rtm.tm_sec);
|
||||
}
|
||||
}
|
||||
@@ -545,9 +545,9 @@ void item_tab_date_modification(Info & i)
|
||||
|
||||
void item_tab_date_creation_nice(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
print_date_nice(i, request->item_tab[item_index].date_creation);
|
||||
print_date_nice(i, cur->request->item_tab[item_index].date_creation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,19 +555,19 @@ void item_tab_date_creation_nice(Info & i)
|
||||
|
||||
void item_tab_date_modification_nice(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
print_date_nice(i, request->item_tab[item_index].date_modification);
|
||||
print_date_nice(i, cur->request->item_tab[item_index].date_modification);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void item_tab_dates_equal(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
tm * ptm1 = &request->item_tab[item_index].date_creation;
|
||||
tm * ptm2 = &request->item_tab[item_index].date_modification;
|
||||
tm * ptm1 = &cur->request->item_tab[item_index].date_creation;
|
||||
tm * ptm2 = &cur->request->item_tab[item_index].date_modification;
|
||||
|
||||
i.res = ptm1->tm_year == ptm2->tm_year &&
|
||||
ptm1->tm_mon == ptm2->tm_mon &&
|
||||
@@ -581,14 +581,14 @@ void item_tab_dates_equal(Info & i)
|
||||
|
||||
void item_tab_run(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
if( system->HasReadExecAccess(request->item_tab[item_index]) )
|
||||
if( system->HasReadExecAccess(cur->request->item_tab[item_index]) )
|
||||
{
|
||||
Ezc::Pattern * p = pattern_cacher.GetPattern(request->item_tab[item_index]);
|
||||
Ezc::Pattern * p = pattern_cacher.GetPattern(cur->request->item_tab[item_index]);
|
||||
item_run_content.Clear();
|
||||
ezc_generator.Generate(item_run_content, *p);
|
||||
item_print_content(i.out, item_run_content.Str(), request->item_tab[item_index].content_type);
|
||||
item_print_content(i.out, item_run_content.Str(), cur->request->item_tab[item_index].content_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -600,70 +600,70 @@ void item_tab_run(Info & i)
|
||||
|
||||
void item_tab_can_use_emacs(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
// !!
|
||||
//i.res = request->CanUseEmacs(request->item_tab[item_index], true);
|
||||
//i.res = cur->request->CanUseEmacs(cur->request->item_tab[item_index], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void item_tab_has_static_file(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
i.res = request->item_tab[item_index].file_type != WINIX_ITEM_FILETYPE_NONE &&
|
||||
!request->item_tab[item_index].file_path.empty();
|
||||
i.res = cur->request->item_tab[item_index].file_type != WINIX_ITEM_FILETYPE_NONE &&
|
||||
!cur->request->item_tab[item_index].file_path.empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void item_tab_has_thumb(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.res = request->item_tab[item_index].has_thumb;
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.res = cur->request->item_tab[item_index].has_thumb;
|
||||
}
|
||||
|
||||
|
||||
void item_tab_type_is_dir(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.res = request->item_tab[item_index].type == Item::dir;
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.res = cur->request->item_tab[item_index].type == Item::dir;
|
||||
}
|
||||
|
||||
|
||||
void item_tab_type_is_file(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.res = request->item_tab[item_index].type == Item::file;
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.res = cur->request->item_tab[item_index].type == Item::file;
|
||||
}
|
||||
|
||||
|
||||
void item_tab_type_is_symlink(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.res = request->item_tab[item_index].type == Item::symlink;
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.res = cur->request->item_tab[item_index].type == Item::symlink;
|
||||
}
|
||||
|
||||
|
||||
void item_tab_is_link_to(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.res = !request->item_tab[item_index].link_to.empty();
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.res = !cur->request->item_tab[item_index].link_to.empty();
|
||||
}
|
||||
|
||||
|
||||
void item_tab_link_to(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.out << request->item_tab[item_index].link_to;
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.out << cur->request->item_tab[item_index].link_to;
|
||||
}
|
||||
|
||||
|
||||
void item_tab_is_link_redirect(Info & i)
|
||||
{
|
||||
if( item_index < request->item_tab.size() )
|
||||
i.res = request->item_tab[item_index].link_redirect == 1;
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
i.res = cur->request->item_tab[item_index].link_redirect == 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user