added: cp function for directories
added: emacs/mkdir uses group_id of the parent directory when creating new items added: parameter 'dirls' to ls function git-svn-id: svn://ttmath.org/publicrep/winix/trunk@606 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -43,6 +43,34 @@ void dir_without_slash(Info & i)
|
||||
}
|
||||
|
||||
|
||||
void dir_parent(Info & i)
|
||||
{
|
||||
if( request.dir_table.empty() )
|
||||
return;
|
||||
|
||||
for(size_t a=0 ; a<request.dir_table.size()-1 ; ++a)
|
||||
{
|
||||
HtmlEscape(i.out, request.dir_table[a]->url);
|
||||
i.out << '/';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void dir_parent_without_slash(Info & i)
|
||||
{
|
||||
if( request.dir_table.empty() )
|
||||
return;
|
||||
|
||||
for(size_t a=0 ; a<request.dir_table.size()-1 ; ++a)
|
||||
{
|
||||
HtmlEscape(i.out, request.dir_table[a]->url);
|
||||
|
||||
if( request.dir_table.size()>=2 && a<request.dir_table.size()-2 )
|
||||
i.out << '/';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//!! moze wystarczy sprawdzac tylko ostatni katalog?
|
||||
// bo inaczej i tak bylo by 'access denied'
|
||||
void dir_can_read_exec(Info & i)
|
||||
@@ -113,10 +141,11 @@ void dir_can_use_mkdir(Info & i)
|
||||
|
||||
static std::vector<Item*> dir_childs_table;
|
||||
static size_t dir_childs_index;
|
||||
|
||||
// request.id is never 0 and we can start dir_childs_reqid from 0
|
||||
static size_t dir_childs_reqid = 0;
|
||||
|
||||
// is the first directory the parent ('..')
|
||||
static bool dir_childs_has_parent;
|
||||
|
||||
|
||||
void dir_childs_tab(Info & i)
|
||||
@@ -125,9 +154,19 @@ void dir_childs_tab(Info & i)
|
||||
{
|
||||
dir_childs_reqid = request.id;
|
||||
dir_childs_table.clear();
|
||||
|
||||
dir_childs_has_parent = false;
|
||||
|
||||
if( !request.dir_table.empty() )
|
||||
{
|
||||
if( request.dir_table.size() >= 2 && i.par == "with_parent")
|
||||
{
|
||||
Item * dir_up = request.dir_table[request.dir_table.size()-2];
|
||||
dir_childs_table.push_back(dir_up);
|
||||
dir_childs_has_parent = true;
|
||||
}
|
||||
|
||||
data.dirs.GetDirChilds(request.dir_table.back()->id, dir_childs_table);
|
||||
}
|
||||
}
|
||||
|
||||
dir_childs_index = i.iter;
|
||||
@@ -135,6 +174,13 @@ void dir_childs_tab(Info & i)
|
||||
}
|
||||
|
||||
|
||||
// is this child a parent ('..')
|
||||
void dir_childs_is_parent(Info & i)
|
||||
{
|
||||
i.res = (dir_childs_has_parent && dir_childs_index == 0);
|
||||
}
|
||||
|
||||
|
||||
void dir_childs_tab_url(Info & i)
|
||||
{
|
||||
if( dir_childs_index < dir_childs_table.size() )
|
||||
|
||||
@@ -249,6 +249,8 @@ void Templates::CreateFunctions()
|
||||
*/
|
||||
functions.Insert("dir", dir);
|
||||
functions.Insert("dir_without_slash", dir_without_slash);
|
||||
functions.Insert("dir_parent", dir_parent);
|
||||
functions.Insert("dir_parent_without_slash", dir_parent_without_slash);
|
||||
functions.Insert("dir_can_read_exec", dir_can_read_exec);
|
||||
functions.Insert("dir_can_write", dir_can_write);
|
||||
functions.Insert("dir_can_remove", dir_can_remove);
|
||||
@@ -256,6 +258,7 @@ void Templates::CreateFunctions()
|
||||
functions.Insert("dir_can_use_mkdir", dir_can_use_mkdir);
|
||||
|
||||
functions.Insert("dir_childs_tab", dir_childs_tab);
|
||||
functions.Insert("dir_childs_is_parent", dir_childs_is_parent);
|
||||
functions.Insert("dir_childs_tab_url", dir_childs_tab_url);
|
||||
functions.Insert("dir_childs_tab_privileges", dir_childs_tab_privileges);
|
||||
functions.Insert("dir_childs_tab_user", dir_childs_tab_user);
|
||||
|
||||
@@ -161,6 +161,8 @@ namespace TemplatesFunctions
|
||||
*/
|
||||
void dir(Info & i);
|
||||
void dir_without_slash(Info & i);
|
||||
void dir_parent(Info & i);
|
||||
void dir_parent_without_slash(Info & i);
|
||||
void dir_can_read_exec(Info & i);
|
||||
void dir_can_write(Info & i);
|
||||
void dir_can_remove(Info & i);
|
||||
@@ -168,6 +170,7 @@ namespace TemplatesFunctions
|
||||
void dir_can_use_mkdir(Info & i);
|
||||
|
||||
void dir_childs_tab(Info & i);
|
||||
void dir_childs_is_parent(Info & i);
|
||||
void dir_childs_tab_url(Info & i);
|
||||
void dir_childs_tab_privileges(Info & i);
|
||||
void dir_childs_tab_user(Info & i);
|
||||
|
||||
Reference in New Issue
Block a user