@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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() )
|
||||
|
||||
Reference in New Issue
Block a user