[pmwiki-users] Some answers to: More Wikiforms

Sameer Kumar skumar at eharch.com
Wed Aug 1 14:30:46 CDT 2007


1. I see where the value= is coming from. In wikiform.php, look for:

 

} elseif (preg_match('/^(\\d+)(?:\\*(\\d+))?$/',$f[$i]['etype'],$m)) {

    $col = ($m[2]) ? $m[2] : 40;

    if ($editing) $rows = explode("\\\\\n",$fv[$f[$i]['element']]);

    for($j=0;$j<$m[1];$j++) {

        $rows[$j] = (isset($rows[$j])) ? " value='".$rows[$j]."'" : '';

        $out[] = "<input type='text' size='$col' name='".

            $f[$i]['element']."[]'".$rows[$j]." />";

    }

} ...

 

and make the following change:

 

    if ($editing) $rows = explode("\\\\\n",$fv[$f[$i]['element']]);

    else $rows = array();

 

The first field is OK; others of that type are not. The above change 

should fix it.

 

It did fix it! Thank you.

 

2. The extra \\ characters, there are several possibilities. 

You may be able to tell from the above code that it splits the field 

value on '2 backslashes followed by a newline'. I can call up the 

edit form, but not save the results, so it's hard to see what is 

happening. Leave that one with me to test. It used to work; maybe 

I broke it at some point.

 

It looks as if it is recognising all the \ characters, instead of

escaping them, when I join the array of values into one field.

 

I will wait to hear from you.

 

3. The Projectstext title.

 

We have to create a title for this explicitly, using the pmwiki

variable markup. In Projectstext.GroupFooter, we want to add:

 

(:title {Projects/{$Name}}$:Project Name} :)

 

However, we have a problem, because AFAIK, pmwiki doesn't support 

spaces in variable names. What I suggest you do is change 

'Project Name' in your form and all current records to 'Project'.

 

If you don't want to do that...

 

I actually made it work differently, based on your previous
recommendation of adding to the Projecttext.php file

$EditRedirectFmt = 'Projects.$Name';

It works quite well.

 

4. The discussion page links.

 

>From Projects/00003, I click Discussion and it takes me to

Comments/Projects-00003

 

This is missing a title attribute. I think you need the

following in a Comments.GroupFooter, to do the same as

in the Projecttext field:

 

(:fparatitle title=@3@{$Name}@3@:)

 

However, there is a problem: '@3@' evaluates inline,

which is after title evaluates, so this will not work.

Try changing

 

Markup("@3@", "inline", "/@3@(.*?)@3@/e", 'str_replace("-",".","$1")');

 

to

 

Markup("@3@", "<fparatitle", "/@3@(.*?)@3@/e",
'str_replace("-",".","$1")');

 

However, that might break something else; I'm not sure.

 

Also, the View link doesn't pick up the view template.

I think this is because of the ?action=view -- it won't

let me save edits to Comments.PageActions, so I can't test

this. Try removing the '?action=view' on the first item;

I don't think it's needed.

 

It does not let me remove or modify "?action=view"... As soon as I do
it, the "View" tab goes dead and stops being a link.

 

-------------------------------------------------------

 

John, I have a concern: What happens when a user wants to create a link
to a Project page from another page? It seems that they will have to
know the five digit number, isn't it?

This means that by simply adding '[[' and ']]' to a wikiword, they may
not be able to create a link. Would you agree that this would be a loss
of an important functionality?

 

I have been wondering if it would be better if the actual project form
is Project.Projectname which "includes" the Project.00001 page instead
of it being the other way round. 

 

This would mean the following:

1.    The user still creates a new page with the 'Add a new project'
wikiform.

2.    When the form is submitted, the form data is saved in
Projects.00001 and the screen changes to Projects.Museum?action=edit for
the user to now create the actual Project page.

3.    Upon save, the user is presented with a Projects.Museum form with
Projects.00001 already 'included', complete with a "=>Edit form" link
which would take the user back to Projects.00001 form page for editing
of the form data.

4.    The important thing will be to ensure that pmwiki understands the
relationship between Projects.00001 and Projects.Museum.

5.    This will ensure that the project page is Projects.Museum and not
Projects.00001.

 

What do you think? Is this achievable? 

 

S

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20070801/02d2102d/attachment-0001.html 


More information about the pmwiki-users mailing list