changed: plugin 'export': export winix function

the checkbox is now selected when we want to export static files too 
         (default it is not checked)
         



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@922 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2013-04-17 00:37:39 +00:00
parent 8705b3437c
commit c10c9393c0
5 changed files with 32 additions and 17 deletions

View File

@@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2012, Tomasz Sowa
* Copyright (c) 2012-2013, Tomasz Sowa
* All rights reserved.
*
*/
@@ -31,8 +31,9 @@ void FunExport::SetExportInfo(ExportInfo * pexport_info)
bool FunExport::HasAccess()
{
// temporarily only the root can use this function
return cur->session->puser && cur->session->puser->super_user;
// temporarily only a logged user can use this function
// !! IMPROVEME we have to change to only some users can use this function in a specified directory
return cur->session->puser;
}
@@ -52,7 +53,7 @@ void FunExport::ExportFile(const Item & item)
}
void FunExport::ExportDir(const Item & dir, bool only_non_static_files)
void FunExport::ExportDir(const Item & dir, bool static_files_too)
{
export_info->SendDir(dir);
@@ -65,7 +66,7 @@ void FunExport::ExportDir(const Item & dir, bool only_non_static_files)
iq_dir.WhereParentId(dir.id);
iq_dir.WhereType(Item::file);
if( only_non_static_files )
if( !static_files_too )
iq_dir.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
db->GetItems(dir_items, iq_dir);
@@ -81,7 +82,7 @@ void FunExport::ExportDir(const Item & dir, bool only_non_static_files)
for( ; i != system->dirs.ParentEnd() ; i = system->dirs.NextChild(i) )
{
ExportDir(*i->second, only_non_static_files);
ExportDir(*i->second, static_files_too);
}
}
@@ -89,12 +90,12 @@ void FunExport::ExportDir(const Item & dir, bool only_non_static_files)
void FunExport::Export()
{
export_info->ResetRecurrenceCheck();
bool onlynonstatic = cur->request->IsPostVar(L"onlynonstatic");
bool static_files_too = cur->request->IsPostVar(L"staticfilestoo");
if( cur->request->is_item )
ExportFile(cur->request->item);
else
ExportDir(*cur->request->dir_tab.back(), onlynonstatic);
ExportDir(*cur->request->dir_tab.back(), static_files_too);
}