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:
Tomasz Sowa 2013-04-17 00:37:39 +00:00
parent 8705b3437c
commit c10c9393c0
5 changed files with 32 additions and 17 deletions

View File

@ -1,16 +1,19 @@
<div class="winix"> <div class="winix">
<h1>Export</h1> <h1>{export_header}</h1>
<p>Press Export to transfer the [if item_is]file[else]directory[end] to an external ftp server</p> [if item_is]
<p>{export_transer_file_info}</p>
[else]
<p>{export_transer_dir_info}</p>
[end]
<form action="[doc_base_url][dir][if item_is][item_url]/[end]export" method="post"> <form action="[doc_base_url][dir][if item_is][item_url]/[end]export" method="post">
<fieldset>
<input type="checkbox" name="staticfilestoo" id="nonstaticfiles"><label for="nonstaticfiles">{export_checkbox_static_file_too}</label>
<input type="checkbox" name="onlynonstatic" id="nonstaticfiles"><label for="nonstaticfiles">Export only non static files</label>
<br><br> <br><br>
<input type="submit" value="Export"> <input type="submit" value="Export">
@ -19,8 +22,6 @@
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]"> <input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
[end] [end]
</fieldset>
</form> </form>

View File

@ -24,6 +24,12 @@ account_already_activated = This account is already activated
account_cannot_be_activated = This account cannot be activated, please contact with the system administrator account_cannot_be_activated = This account cannot be activated, please contact with the system administrator
account_email_sent = An email with an activation link has been sent to you account_email_sent = An email with an activation link has been sent to you
export_header = Export
export_transer_file_info = Press Export to transfer the file to an external ftp server
export_transer_dir_info = Press Export to transfer the directory to an external ftp server
export_checkbox_static_file_too = "Export static files too (images etc.)"
code_expired = The code has expired code_expired = The code has expired
password_cannot_be_changed = The password cannot be changed, please contact with the system administrator password_cannot_be_changed = The password cannot be changed, please contact with the system administrator
incorrect_change_password_code = Incorrect code for changing your password incorrect_change_password_code = Incorrect code for changing your password

View File

@ -26,6 +26,13 @@ account_already_activated = To konto jest już aktywowane
account_cannot_be_activated = To konto nie może być aktywowane, proszę skontaktować się z administratorem account_cannot_be_activated = To konto nie może być aktywowane, proszę skontaktować się z administratorem
account_email_sent = Wysłaliśmy Tobie email z linkiem aktywacyjnym account_email_sent = Wysłaliśmy Tobie email z linkiem aktywacyjnym
export_header = Export
export_transer_file_info = Wciśnij przycisk Export aby wysłać ten plik na zewnętrzny serwer ftp
export_transer_dir_info = Wciśnij przycisk Export aby wysłać podany katalog na zewnętrzny serwer ftp
export_checkbox_static_file_too = "Wyślij także pliki statyczne (zdjęcia itp.)"
code_expired = Ten kod stracił już swoją ważność code_expired = Ten kod stracił już swoją ważność
password_cannot_be_changed = Niestety nie możemy zmienić hasła dla tego konta, proszę skontaktować się z administratorem password_cannot_be_changed = Niestety nie możemy zmienić hasła dla tego konta, proszę skontaktować się z administratorem
incorrect_change_password_code = Nieprawidłowy kod do zmiany hasła incorrect_change_password_code = Nieprawidłowy kod do zmiany hasła

View File

@ -2,7 +2,7 @@
* This file is a part of Winix * This file is a part of Winix
* and is not publicly distributed * and is not publicly distributed
* *
* Copyright (c) 2012, Tomasz Sowa * Copyright (c) 2012-2013, Tomasz Sowa
* All rights reserved. * All rights reserved.
* *
*/ */
@ -31,8 +31,9 @@ void FunExport::SetExportInfo(ExportInfo * pexport_info)
bool FunExport::HasAccess() bool FunExport::HasAccess()
{ {
// temporarily only the root can use this function // temporarily only a logged user can use this function
return cur->session->puser && cur->session->puser->super_user; // !! 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); 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.WhereParentId(dir.id);
iq_dir.WhereType(Item::file); iq_dir.WhereType(Item::file);
if( only_non_static_files ) if( !static_files_too )
iq_dir.WhereFileType(WINIX_ITEM_FILETYPE_NONE); iq_dir.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
db->GetItems(dir_items, iq_dir); 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) ) 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() void FunExport::Export()
{ {
export_info->ResetRecurrenceCheck(); export_info->ResetRecurrenceCheck();
bool onlynonstatic = cur->request->IsPostVar(L"onlynonstatic"); bool static_files_too = cur->request->IsPostVar(L"staticfilestoo");
if( cur->request->is_item ) if( cur->request->is_item )
ExportFile(cur->request->item); ExportFile(cur->request->item);
else else
ExportDir(*cur->request->dir_tab.back(), onlynonstatic); ExportDir(*cur->request->dir_tab.back(), static_files_too);
} }

View File

@ -2,7 +2,7 @@
* This file is a part of Winix * This file is a part of Winix
* and is not publicly distributed * and is not publicly distributed
* *
* Copyright (c) 2012, Tomasz Sowa * Copyright (c) 2012-2013, Tomasz Sowa
* All rights reserved. * All rights reserved.
* *
*/ */
@ -33,7 +33,7 @@ public:
void ExportFile(const Item & item); void ExportFile(const Item & item);
void ExportDir(const Item & dir, bool only_non_static_files = false); void ExportDir(const Item & dir, bool static_files_too = false);
private: private: