01185: {[foxdelrange button]} and {[foxdelline button]} does not work

Summary: {[foxdelrange button]} and {[foxdelline button]} does not work
Created: 2010-04-22 16:36
Status: Closed
Category: Cookbook
From: Jeff
Assigned:
Priority: 2
Version: 2.2.0
OS: OS: Windows Server 2003 /IIS/ 5.2.9-1

Description: Hi everyone, I'm struggling through getting Fox Contacts to work, and am almost at the point where everything is working correctly. However, I'm having an issue with the delete markup not being correctly parsed by PmWiki. I've found what I think is the relevent PITS issue (PITS:01122 )however, being a complete neebie, I'm not sure as to how I should make the changes to fox.php & foxdelete.php. I'm assuming that I should remove the lines marked with a minus (-) and add the lines with a plus (+) but there are lines in the diff that don't have either symbol. Additionally, I don't even have a clue as to whether any action is necessary for the lines which have the -XXXX,XX +XXXX,X in front of them.

Thanks you for you help!!

Jeffrey

diff --git a/cookbook/fox/fox.php b/cookbook/fox/fox.php index 06ff05d..2566760 100644 --- a/cookbook/fox/fox.php +++ b/cookbook/fox/fox.php -1121,14 +1121,7 function FoxTemplateEngine( $pn, $template, $fx, $targ, $linekeyseed=NULL, $call

                if (preg_match("/\\{\\[foxdel([^]]+)FullName\\}\\s*\\]\\}/", $entry)) continue;
                $linekey = $linekeyseed.'b'.$index;
                //adding linekey + pagename to any foxdelete markup for unique id

- // Add linekey to delete button for line delete - $entry = str_replace( '{[foxdelline button', "{[foxdelline button $linekey {\$FullName} ", $entry ); - // Add linekey to delete link for line delete - $entry = str_replace( '{[foxdelline', "{[foxdelline $linekey {\$FullName} ", $entry ); - // Add linekey to delete button for range delete - $entry = str_replace( '{[foxdelrange button', "{[foxdelrange button $linekey {\$FullName} ", $entry ); - // Add linekey to delete link for range delete - $entry = str_replace( '{[foxdelrange', "{[foxdelrange $linekey {\$FullName} ", $entry ); + $entry = ereg_replace( '\{\[foxdel(line|range)( button)?', "\\0 $linekey {\$FullName} ", $entry );

                //Add line-key to delete range begin marker
                $entry = str_replace( '#foxbegin#', "#foxbegin $linekey#", $entry );
                // Add line-key to delete range end marker

-1794,4 +1787,4 function InputDefault2($pagename, $type, $args) {

        return '';
 } //}}}

-///EOF \ No newline at end of file +///EOF diff --git a/cookbook/fox/foxdelete.php b/cookbook/fox/foxdelete.php index 68ba6be..5c51b5d 100644 --- a/cookbook/fox/foxdelete.php +++ b/cookbook/fox/foxdelete.php -49,11 +49,11 function FoxHandleDelete($pagename) {

 } //}}}

-Markup('foxdelete','directives','/\{\[foxdel(line|range) ?(|button)\\s*(.*?)\\s*\]}/e', - "Keep(FoxDeleteMarkup(\$pagename, '$1', '$2', PSS('$3') ))"); +Markup('foxdelete','directives','/\{\[foxdel(?:line|range) (button)?\s*(.+)\s*\]\}/e', + "Keep(FoxDeleteMarkup(\$pagename, '$1', PSS('$2') ))");

 # Creates the HTML code for delete links {[foxdelline]}, {[foxdelrange]}
 # and delete buttons {[foxdelline button]} and {[foxdelrange button]}

-function FoxDeleteMarkup($pagename, $range, $type, $args) { +function FoxDeleteMarkup($pagename, $type, $args) {

        global $ScriptUrl, $EnablePathInfo, $EnableFoxDeleteMsg, $FoxDeleteMsg, $FoxDeleteSummaryMsg;
        SDV($EnableFoxDeleteMsg, false); //set to true to enable post delete confirmation
        SDV($FoxDeleteMsg, 'Please confirm: Do you want to delete this post?');

================================

Solved, although not sure why. Changing to single quotes around the {[foxdelrange]} on the Contacts.Contacts.Templates (shown below) page resolved the issue.