Author Topic: uploads and new folders  (Read 7481 times)

0 Members and 1 Guest are viewing this topic.

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1234
  • ....... chut ! shh!
    • View Profile
Re: uploads and new folders
« Reply #15 on: September 16, 2010, 07:29:05 AM »
For the beta buid #270 and its default template, this should/must be used in /home > Diff template tab:

Quote
[ajax.mkdir|no log]
{.break|if={.not|{.can mkdir.}.}|result={.!forbidden.}.}
{.set|x|{.force ansi|%folder%{.postvar|name.}.}.}
{.break|if={.exists|{.^x.}.}|result={.!exists.}.}
{.if|{.length|{.mkdir|{.^x.}.}.}|ok|{.!failed.}.}
{.add to log|%user% {.!has created this folder:.} {.^x.}.}

[ajax.rename|no log]
{.break|if={.not|{.can rename.}.}|result={.!forbidden.}.}
{.set|x|{.force ansi|%folder%{.postvar|from.}.}.}
{.set|y|{.force ansi|%folder%{.postvar|to.}.}.}
{.break|if={.not|{.exists|{.^x.}.}.}|result={.!not found.}.}
{.break|if={.exists|{.^y.}.}|result={.!exists.}.}
{.if|{.length|{.rename|{.^x.}|{.^y.}.}.}|ok|{.!failed.}.}
{.add to log|%user% {.!has renamed an item:.} {.^x.} --> {.^y.}.}

[ajax.move|no log]
{.set|dst|{.force ansi|{.postvar|dst.}.}.}
{.break|if={.not|{.and|{.get|can delete.}|{.get|can upload|path={.^dst.}.}/and.}.} |result={.!forbidden.}.}
{.for each|fn|{.replace|:|{.no pipe||.}|{.postvar|files.}.}|{:
    {.set|x|{.force ansi|%folder%{.^fn.}.}.}
    {.set|y|{.^dst.}/{.^fn.}.}
    {.if not |{.exists|{.^x.}.}|{.^x.}{.!:.} {.!not found.}|{:
        {.if|{.exists|{.^y.}.}|{.^y.}{.!:.} {.!already exists.}|{:
         {.if not|{.length|{.move|{.^x.}|{.^y.}.}.}|{.^fn.}{.!:.} {.!not moved.}.}
           {.add to log|%user% {.!has moved an item:.} {.^x.} --> {.^y.}.}
        :}.}
    :}.}
    ;
:}.}
« Last Edit: September 16, 2010, 07:37:44 AM by SilentPliz »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: uploads and new folders
« Reply #16 on: September 17, 2010, 09:47:46 AM »
i will include it in the default tpl

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1234
  • ....... chut ! shh!
    • View Profile
Re: uploads and new folders
« Reply #17 on: September 17, 2010, 09:52:32 AM »
Thank you very much! ;)

I could forget this topic. :D