Revision history for CloneAction


Revision [22933]

Last edited on 2016-05-20 07:38:42 by NilsLindenberg [Replaces old-style internal links with new pipe-split links.]
Additions:
This relies of the [[WikkaBugsResolved | ExistsPage]] function developed by JavaWoman and part of release 1.1.6.0. You can find this version at WikkaBugsResolved under the heading "check of user-names against page-names"..
echo "[[ | ".$to." has been created from ".$from." and note was: ".$note." ]]"; // confirms what has been done
Deletions:
This relies of the [[WikkaBugsResolved ExistsPage]] function developed by JavaWoman and part of release 1.1.6.0. You can find this version at WikkaBugsResolved under the heading "check of user-names against page-names"..
echo "[[ ".$to." has been created from ".$from." and note was: ".$note." ]]"; // confirms what has been done


Revision [18254]

Edited on 2008-01-28 00:10:44 by NilsLindenberg [Modified links pointing to docs server]

No Differences

Revision [4742]

Edited on 2005-01-17 14:37:50 by NilsLindenberg [cat. changed]
Additions:
CategoryUserContributions
Deletions:
CategoryDevelopment


Revision [4473]

Edited on 2005-01-11 17:53:06 by NilsLindenberg [argh, typo corrected]
Additions:
This relies of the [[WikkaBugsResolved ExistsPage]] function developed by JavaWoman and part of release 1.1.6.0. You can find this version at WikkaBugsResolved under the heading "check of user-names against page-names"..
Deletions:
This relies of the [[WikkaBugsResolved ExistsPage]] function developed by JavaWoman and part of release 1.1.6.0. You can find this version at WikkaBugResolved under the heading "check of user-names against page-names"..


Revision [4472]

Edited on 2005-01-11 17:52:44 by NilsLindenberg [link added]
Additions:
This relies of the [[WikkaBugsResolved ExistsPage]] function developed by JavaWoman and part of release 1.1.6.0. You can find this version at WikkaBugResolved under the heading "check of user-names against page-names"..
Deletions:
This relies of the ExistsPage function developed by JavaWoman and part of release 1.1.6.0. You can find this version at WikkaBugResolved under the heading "check of user-names against page-names"..


Revision [4471]

Edited on 2005-01-11 17:52:04 by NilsLindenberg [Link corrected]
Additions:
This relies of the ExistsPage function developed by JavaWoman and part of release 1.1.6.0. You can find this version at WikkaBugResolved under the heading "check of user-names against page-names"..
Deletions:
This relies of the ExistsPage function developed by JavaWoman and part of release 1.1.6.0. You can find this version at WikkaDevelopment.


Revision [3642]

Edited on 2004-12-24 18:26:10 by ChristianBarthelemy [CloneAction needs the ExistsPage function from JavaWoman]
Additions:
===Dependancy===
This relies of the ExistsPage function developed by JavaWoman and part of release 1.1.6.0. You can find this version at WikkaDevelopment.


Revision [3494]

Edited on 2004-12-19 22:07:16 by ChristianBarthelemy [CloneAction needs the ExistsPage function from JavaWoman]
Additions:
I wanted to build an action ""{{clone from="OldPage" to="NewPage" editoption="true"}}"" that would duplicate an existing page to a new page .
The editoption when true will create the new page and then open it for edition. This action code is here below, however DarTar convinced me that a handler makes nore sense so you should rather go to CloneHandler.
Deletions:
I would like to build an action ""{{clone from="OldPage" to="NewPage" editoption="true"}}"" that would duplicate an existing page to a new page .
The editoption when true will create the new page and then open it for edition.


Revision [3470]

Edited on 2004-12-19 15:25:29 by ChristianBarthelemy [CloneAction needs the ExistsPage function from JavaWoman]
Additions:
All discussions on this page still are at WikiTemplate. We definitely need a PageNameChange handler ;-)
Deletions:
''I get the following error (just copied the code to template.php and tried the syntax you gave):
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /.../actions/template.php on line 2
Parse error: parse error, unexpected T_STRING in /.../actions/template.php on line 2"
--NilsLindenberg''
''(After code change) Christian, OK, I see the intention now. And I like it a lot! Unfortunately, the code isn't quite correct - mind if I take a stab at clearing it up?
Nils, I don't have a clue how you can get that error; did you grab the code from the page source? --JavaWoman.''
''Yepp, I always copy from the source. --NilsLindenberg''
~Do you still have the same error with the new code? --ChristianBarthelemy
~~~''I have to try later, they don't trust me that much in the university, to allow ftp access to pages. And I haven't worked out how I should explain wikka as an essentail part of my studies ;-). I'll check later. --NilsLindenberg''
~~~~''1. Are you **entering** something in the form or as an action attribute that contains a ""\""? There's not even a ""\"" in the code that I can see. If so, try ""/"" as a path separator instead.
~~~~2. Wikka for studies - maybe this helps? [[http://shirky.com/writings/group_user.html Group as User: Flaming and the Design of Social Software]] - by Clay Shirky; I guess you're doing a field study? ;-) --JavaWoman''
~~~''Ok, I tried the new code, but it hasn't changed anything. I tried simple opage names like NewPage, ""NewerPage"" etc. even adding ""{{template}}"" gives that error. --NilsLindenberg''
~~~~Which Wikka version are you using? I do not see any reason for such an error. I replaced the template.php version from my server with a copy from this page to a new txt notepad file, renamed into template.php placed it in the action folder and it worked.
Update: Ok, I finally found out what I made wrong. My mistake: the txt files on this pc are connected with wordpad, not with notepad. I hadn't looked after that and so saved the files with useless renderings *bangs head against wall*. But after that, I found some points in your script:
1) There was an ?> missing at the end
1) The length for a page can be 75 chars, ++I changed your value to that++ just keep that in mind, cuase it means scrolling now for names >37
1) if you have much output, more simple than putting out all with echo is to leave php. I replaced the input form above. You now get the variables shown in the fields.
--NilsLindenberg
2ndUpdate: works fine, thanx. --NilsLindenberg
Any one else tried it? --ChristianBarthelemy
~''I've been tweaking the code a bit but haven't actually tested anything yet; I'm afraid I have a few more urgent things on my list right now (such as finishing WikkaGeSHiIntegration with install/update). I **will** get back to this though, promise, since I think it's very useful! --JavaWoman''
~''I like the idea too. A couple of general remarks:''
~~-''Should this really be an //action//? Why not a handler?''
~~~This action (usefully) accepts a number of parameters, either predefined in the action or via the form; as far as I can tell you can not easily do that with a handler: URL parameters are possible but are much harder to handle for an end user (requiring knowledge of how to build a query via a URL). Also, such a handler would either have to operate on the source page or on the target page while an action like this can be embedded in any page. User input really is required: an action with a form is more flexible and more user-frienldy. --JavaWoman
~~~"I thought about this when I first defined what I expected, and concluded that an action was more appropriate for the reasons explained by JavaWoman. --ChristianBarthelemy"
~~-''What about adding a menu to allow the user to choose the source page from one of the existing pages? This might avoid checking for page existence''
~~~Sounds nice but would be workable only in a small Wiki. OTH, if you limit the action to special-purpose Template pages this could be workable; or one could have an extra option to choose a template **or** any page with a dropdown only for templates and a text field for any other page. --JavaWoman
~~~"Another idea would be to predefine the pages that may be duplicated by tagging them somehow. The system would then only provide in a dropdown list such pages. --ChristianBarthelemy"
~~-''I think that the concept of **template** is associated in general to something quite different from what you are proposing here. What about using a name suggesting page //exporting//,//duplicating// or //cloning//?''
~~~First, it would be possible to create a number of (read-only) templates (e.g., a Doumentation template). In general, though //clone// (but not //export//) might be a better term if you (can) use the action to copy any page and not just special-purpose template. --JavaWoman
~~~"I agree, the name of template only fits my personnal purpose and "clone" is a more appropriate naming for this action. Hence a new page: CloneAction. --ChristianBarthelemy"
~''DarTar''
You of course have my blessing - This code surely needs some revamping and I will be more than happy that we get something cleaner --ChristianBarthelemy


Revision [3465]

The oldest known version of this page was created on 2004-12-19 14:46:39 by ChristianBarthelemy [CloneAction needs the ExistsPage function from JavaWoman]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki