<p><br>
On Jul 22, 2012 11:01 PM, "Alex Eftimiades" <<a href="mailto:alexeftimiades@gmail.com">alexeftimiades@gmail.com</a>> wrote:<br>
><br>
> Hi again, I tried making this a page action as follows (in Site.PageActions)<br>
> * %item rel=nofollow% {(wikish source {$SiteGroup}.PageActions#RenamePage)}Rename Page:(:input text name=NewPage value={$FullName} size=30:)(:input submit name=submit value=Rename:)(:input end:)<br>
><br>
> (:if false:)<br>
> [[#RenamePage]]<br>
> wikish_form quickform process<br>
> if test -n "${submit}"<br>
> then<br>
> if test "${NewPage}" ~= "/^[a-z0-9-]+(\.|\/)[a-z0-9-]+$/i"<br>
> then<br>
> if test {$Name}!={$Group}<br>
> then<br>
> set -s NewPagePN = `echo ${NewPage} | sed 's|\s||gi' | sed 's|/|\.|gi'`<br>
> sed -i 's%({$Group}|{$Groupspaced})(/|\.)({$Name}|{$NameSpaced})%${NewPage}%g' `pagelist link={$FullName} sep=\n`<br>
> mv {$FullName} ${NewPagePN}<br>
> wikish_form redirect target=${NewPagePN}<br>
> fi<br>
> fi<br>
> [[#RenamePage]]<br>
> (:ifend:)<br>
><br>
> But with this setup the rename button is disabled. Could anyone tell me what part of this I need to fix? Perhaps I am going about this wrong.<br>
><br>
> Thanks,<br>
> Alex<br>
><br>
><br>
><br>
> On Jul 21, 2012, at 10:16 PM, Alex Eftimiades wrote:<br>
><br>
>> Yes this seems to work now. Thank you very much. I am going to try to modify this into a page action and for renaming groups.<br>
>><br>
>> Thanks<br>
>> Alex<br>
>><br>
>> On Jul 21, 2012, at 12:53 PM, Peter Bowers wrote:<br>
>><br>
>>> No that's fine. If it's an action you do on a regular basis then<br>
>>> you'll probably want to put the code on a page and put it together<br>
>>> with a form, but that can easily be a future step. Doing it in the<br>
>>> ControlPanel is a good way to get things working...<br>
>>><br>
>>> I loaded the first command from your command history and noticed that<br>
>>> you have a newline in the middle of the line that should read like<br>
>>> this:<br>
>>><br>
>>> sed -i 's|${OldGroup}([./]\)?)${OldPage}|${NewGroup}$1${NewPage}|gi'<br>
>>> `pagelist link=${OldGroupPN}.${OldPagePN} sep=\n`<br>
>>><br>
>>> That should all be on one line with no newline before the `pagelist...<br>
>>><br>
>>> It may have gotten confusing because the email may have automatically<br>
>>> wordwrapped it when I sent it to you.<br>
>>><br>
>>> Anyway, I certainly don't want to come anywhere close to actually<br>
>>> running code like this on someone else's system, so I'm just letting<br>
>>> you know what needs to happen and then leave it up to you.<br>
>>><br>
>>> If that works, please report back to the list that it was just a<br>
>>> newline due to the email wordwrapping. If it doesn't work then let me<br>
>>> know and I'll take another look -- just give me the exact error<br>
>>> message since I'm wanting to avoid actually executing anything on your<br>
>>> system.<br>
>>><br>
>>> -Peter<br>
>><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> pmwiki-users mailing list<br>
> <a href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a><br>
> <a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a><br></p>
<p>Something about the idea of putting sort of thing in PageActions like this scares me. It seems like a chance for vandalization to occur of a sort that would be hard to recover from. Wikish may be highly useful, but I think this action would be better raised to a first-class recipe with attendant authorization and validation, if one is going to make available on PageActions. Just my deux centimes.</p>