[pmwiki-users] About Upload form

V.Krishn vkrishn4 at gmail.com
Sun Jan 8 03:04:21 CST 2012


On Sunday, January 08, 2012 02:08:18 AM Petko Yotov wrote:
> On Saturday 07 January 2012 13:38:54, V.Krishn wrote :
> > I am trying to add some directives in Site/UploadQuickReference.
> > Seems that if directive scripts sets $HTMLHeaderFmt[] from within a
> > function it does not reflect on the page.
> > Is this same issue as in http://www.pmwiki.org/wiki/PITS/01139 ?
> 
> Yes.
> 
> > Does core support an upload form to be in a wiki page, similar to
> > Site/EditForm?
> 
> You can define your own $PageUploadFmt array which should contain the
> upload form and possibly the quick reference, for example:
> 
>   $PageUploadFmt = array(
>     'wiki:Site.UploadForm',
>     'wiki:$[{$SiteGroup}/UploadQuickReference]'
>   );
Thanks, I used the above PageUploadFmt settings and following for form:

(:div id='wikiupload':)
!! $[Attachments for] {*$FullName}
!!!$UploadResult
(:input form action='{*$PageUrl}' method='post' enctype="multipart/form-
data":)
(:input hidden name='n' value='{*$FullName}':)
(:input hidden name='action' value='postupload':)
|| $[File to upload:]||(:input file name=uploadfile:) ||
|| $[Name attachment as:]||(:input text name=upname value="$UploadName":) 
(:input submit value=' $[Upload] ':) ||

(:include $[{$SiteGroup}/UploadQuickReference]:)

Upload works!

Issues:
$UploadResult and $UploadName are not correctly displayed.

Since Pmwiki allows HTMLHeaderFmt in directives to display correctly in 
Site/EditForm, it would be great if it works similarly for 
wiki:Site.UploadForm.

> 
> but this will not allow you to modify the $HTMLHeaderFmt entries by some
> directives in these pages.
> 
> There is also a recipe http://www.pmwiki.org/wiki/Cookbook/UpForm .

Tried http://www.pmwiki.org/wiki/Cookbook/UpForm , I think this has similar 
problem for $UploadResult.

> 
> > Any suggestions appreciated.
> 
> To set certain $HTMLHeaderFmt entries only when the wiki is called with
> ?action=upload, you can use something like this in config.php:
> 
>   if($action == 'upload') {
>     $HTMLHeaderFmt['some-key'] = 'My custom HTML header';
>   }
> 
> Petko
> 
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users

-- 
Regards.
V.Krishn



More information about the pmwiki-users mailing list