Merge pull request 'uikit' (#3) from uikit into master

Reviewed-on: #3
This commit is contained in:
2021-02-16 19:52:36 +01:00
74 changed files with 2012 additions and 1452 deletions

View File

@@ -51,6 +51,9 @@ Cat::Cat()
void Cat::MakeGet()
{
// IMPROVE ME this probably should be set for all winix functions
cur->request->html_template = cur->request->last_item->html_template;
if( !cur->request->is_item )
{
log << log1 << "Content: cat function requires an item" << logend;

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2008-2018, Tomasz Sowa
* Copyright (c) 2008-2021, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,6 +52,13 @@ Ls::Ls()
void Ls::MakeGet()
{
// !! IMPROVE ME
// this should be moved to ckeditor function (similarly the html content from fun_ls.html)
if( cur->request->IsParam(L"ckeditor_browse") )
{
cur->request->html_template = config->templates_index_generic;
}
if( !cur->request->is_item )
{
DbItemQuery iq;

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2011-2018, Tomasz Sowa
* Copyright (c) 2011-2021, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -127,6 +127,8 @@ return false;
void Meta::ChangeAdminMeta()
{
// IMPROVE ME we need to show an error msg if the user is not an admin
if( cur->session->puser && cur->session->puser->super_user )
{
const std::wstring & meta_str = cur->request->PostVar(L"itemmeta");

View File

@@ -584,12 +584,16 @@ bool Mv::MoveFileOrSymlink2(Item & src_file, const std::wstring & dst_path, bool
if( !ParseDir(dst_path, check_access) )
return false;
if( src_file.parent_id == out_dir_tab.back()->id )
if( out_has_file && src_file.parent_id == out_dir_tab.back()->id && src_file.url == out_item.url )
{
// actually out_filename is here empty
// because ParseDir() have been read it to out_item
if( out_filename.empty() || src_file.url == out_filename )
return true; // the same file -- there is nothing to do
return true; // the same file -- there is nothing to do
}
if( out_has_file )
{
log << log3 << "Mv: such file already exists (skipping)" << logend;
slog << logerror << T("mv_file_exists") << logend;
return false;
}
return MoveFileOrSymlink(src_file, out_dir_tab, out_filename);

View File

@@ -60,6 +60,9 @@ void Run::MakePost()
void Run::MakeGet()
{
// IMPROVE ME this probably should be set for all winix functions
cur->request->html_template = cur->request->last_item->html_template;
if( !cur->request->is_item )
{
log << log1 << "Content: Run function requires an item" << logend;

View File

@@ -97,12 +97,17 @@ void Template::CreateTemplateFileName(const std::wstring & index_str)
}
else
if( index == 1 )
{
html_template = config->templates_index_generic;
}
else
if( index == 2 )
{
html_template = config->templates_index_raw;
}
else
{
index -= 2;
index -= 3;
Mount::ParamRow & par = system->mounts.pmount->param[system->mounts.MountParHtmlTemplate()];
if( !par.defined || (size_t)index >= par.arg.size() )