Revision [13976]
This is an old revision of BrianKoontz made by BrianKoontz on 2006-04-29 00:31:51.
Why I'm here
I'm the coordinator for the Computer Science and Open Source Technology (OST) programs at North Lake College in Irving, TX. I've worked my way through several versions of the Wakka->Wacko->Wikka progeny line. Wakka dead-ended on me, while my Russian never did get any better with Wacko (no, I don't speak Russian, which made it very difficult to work with Wacko beyond the level of an end user). I'm currently using Wikka to host the course notes and other miscellaneous items for the OST program. I would like to see, at some point down the road, a merger of the best of features in both Wacko and Wikka...I believe both have their strong points, and it would be such a waste to see features in one lost on the other.
Wikka stuff
Stuff I've written
- I wrote a perl script to MigrateFromWackoWiki migrate my Wacko pages to Wikka. The code is documented, so I won't bore anyone with the details.
- WordcountAction: Needed a quick and dirty wordcount action. Needs more work when time permits...
- Clone ACLs Patch: A patch you can apply to handlers/page/clone.php that will optionally copy the ACLs from the source page to the new page (see below).
- PageCloaking: Hide page tags (titles) from users who do not have read privileges.
Stuff others have written that I've found useful
- ACLsWithUserGroups Group ACLs -- A very elegant and simple solution for providing group-level granularity to ACLs.
- SpellcheckHack -- Another nice mod. Some typos in the code as posted; see comments for details.
- AnchorAction -- HTML anchors. Again, some minor code changes noted in comments to get this to work.
- MySkin Skins -- Testing this on my own site. Still some minor glitches to work through on this, but it's pretty slick once you get it working!
Stuff I'd like to implement if/when I get the time
- A de.lirio.us clone (maybe extend one of the existing link actions such as AddLinkAction?)
- A front-end to permit restricted pre-defined operations on a database (i.e., field updates, queries, etc.)
- A quick and dirty handler (such as {{s}}) to insert a sig in the editor
- A "store and continue edit" button on the editor (user would be able to continue editing from the same point)
Contact info
Brian KoontzNorth Lake College
Irving, TX
[email protected] [email protected]
Misc. Code (see above for descriptions)
A note about patches
The patch utility is included in most *nix systems and allows all changes to files to be packaged into one convenient'patch file' for distribution. I've found that in the process of transferring files with embedded tabs from the development machine to the wiki environment, the tabs are lost when using copy-and-paste. Consequently, the patch command will sometimes fail, since the tabs have been munged up. I've found that patch -p0 -l < some.patch (note the "dash el" option -- not "dash one") seems to handle munged-up whitespace quite nicely.
Clone ACLs Patch
--- clone.php 2006/03/11 05:26:01 1.1 +++ clone.php 2006/03/11 06:03:04 @@ -29,6 +29,8 @@ * * @input boolean $editoption optional: if true, the new page will be opened for edition on creation * default is false (to allow multiple cloning of the same source) + * @input boolean $cloneaclsoption optional: if true, ACLs will be copied from the source page to the new page + * default is false * * @todo Use central library for valid pagenames. * @@ -39,6 +41,7 @@ $to = $this->tag; $note = 'Cloned from '.$from; #i18n $editoption = ''; +$cloneaclsoption = ''; $box = 'Please fill in a valid target ""PageName"" and an (optional) edit note.'; #i18n // print header @@ -65,6 +68,8 @@ $to = ($_POST['to'])? $_POST['to'] : $to; $note = ($_POST['note'])? $_POST['note'] : $note; $editoption = (isset($_POST['editoption']))? 'checked="checked"' : ''; + $cloneaclsoption = (isset($_POST['cloneaclsoption']))? 'checked="checked"' : ''; + // 3. check target pagename validity if (!preg_match("/^[A-Zƒ÷‹]+[a-zfl‰ˆ¸]+[A-Z0-9ƒ÷‹][A-Za-z0-9ƒ÷‹fl‰ˆ¸]*$/s", $to)) @@ -90,6 +95,17 @@ $thepage=$this->LoadPage($from); # load the source page if ($thepage) $pagecontent = $thepage['body']; # get its content $this->SavePage($to, $pagecontent, $note); #create target page + // Clone ACLs if requested + if($cloneaclsoption == 'checked="checked"') + { + $read_acl = $this->LoadACL($from, "read", 0); + $write_acl = $this->LoadACL($from, "write", 0); + $comment_acl = $this->LoadACL($from, "comment", 0); + $this->SaveACL($to, "read", $this->TrimACLs($read_acl["read_acl"])); + $this->SaveACL($to, "write", $this->TrimACLs($write_acl["write_acl"])); + $this->SaveACL($to, "comment", $this->TrimACLs($comment_acl["comment_acl"])); + } + // Open editor if requested if ($editoption == 'checked="checked"') { // quick edit @@ -118,6 +134,11 @@ '<td></td>'. '<td>'. '<input type="checkbox" name="editoption" '.$editoption.' /> Edit after creation '. + '<input type="checkbox" name="cloneaclsoption" '.$cloneaclsoption.' /> Clone ACLs '. + '</tr>'. + '<tr>'. + '<td></td>'. + '<td>'. '<input type="submit" name="create" value="Clone" />'. '</td>'. '</tr>'.
CategoryUsers