[pmwiki-users] Input Select To Trigger Go To Page

Sivakatirswami katir at hindu.org
Wed May 9 14:50:34 CDT 2007


I understand the [[#jumpbox]] option. And sorry if I  sound obstinate.
But I'm alway working to  control "scope bloat"  The more
and more complexity we add to anything the less and less
maintainable and "delegatable" it becomes...

Put more in PMwiki context: this means one wants as much
as possible for basic things (and triggering a GET
request from a pulldown is *really* basic) to be in the wiki pages
and not in config files.

Under the previous "input" recipe structure

Project Pages:
(:input form:)
     (:select+ project:)
       (:option :)Jump To Page:
       (:pagelist group={$Group} name=-RecentChanges 
fmt="#selectlistpages":)
      (:selectend:)
(:input end:)
(:ifend:)

[@
[[#selectlistpages]]
(:option value="index.php?n={=$FullName}":)(:keep {=$Name}:)
[[#selectlistpagesend]]
@]

would trigger at GET request for PMwiki to go to another  page without 
further need to
add code to the configuration file. So before I "throw in the towel"
and swallow yet another 15 lines of archane Javascript that I don't 
understand,
will never be be able to fix, is unmaintainable, cannot transfer to 
someone else etc...

I'm looking for a clear answer, first... what broke and why?

1) The old code cannot and will not be able to be
simply re-written because ZAP no longer supports it?

2) Or No the old (:option value="index.php?n={=$FullName}":)(:keep 
{=$Name}:)
cannot be change to a "input select" variation that works because
PMwiki core no  longer supports it?

## is it a ZAP change or a PMwiki input core change the broke it?

or (hopefully)

3) yes there is a way to re-write
(:option value="index.php?n={=$FullName}":)(:keep {=$Name}:)

in the some new fashion of

(:input select  value="index.php?n={=$FullName}":)(:keep {=$Name}:)

That will trigger a GET request for the page selected in the pull down.

You see: I'm a bit spoiled because I use another language for almost
all my CGI and desktop application development: Revolution and
in that environment:

on menupick  tItem
   revGoUrl tItem
end menupick

or  in a CGI:

on redirect_it pageToRedirectTo
   put pageToRedirectTo into newURL
   put "Status: 301 Moved Permanently" & cr
   put "Location: "  & newURL & cr & cr
end redirect_it

is all that I would need to get this done...3 lines in a desktop app, 5 
lines in a CGI.
so when I see these things like

"add this java garble to your config file"  it pushes a big button:
  "why does it have to be so complicated... isn't there
a simpler way?"

I guess I'm waiting for PM to chime in here to give me the bottom line.

Sivakatirswami



The Editor wrote:
> On your page just put:
> 
> (:input form:)
> (:pagelist group={$Group} name=-RecentChanges fmt="#jumpbox":)
> (:input end:)
> 
> 
> Use this for your pagelist template
> 
> [[#jumpbox]]
> (:template first:)
> (:input jumpbox value='' label='Jump to page...':)
> (:template each:)
> (:input jumpbox value="{=$PageUrl}" label="{=$Title}":)
> [[#jumpboxend]]
> 
> 
> You will need to put the following code into your config file for the
> latter to work:
> 
> $FmtPV['$_UniqId_'] = '($GLOBALS["_UniqId_"] = uniqid("id"))';
> $FmtPV['$_PrevId_'] = '$GLOBALS["_UniqId_"]';
> 
> $InputTags['jumpbox'] = array(
>  'name' => 'n',
>  ':html' =>
>    "<form action='{$PageUrl}' method='get'>
>     <select 
> onchange='window.location.href=this.options[this.selectedIndex].value'
>       \$InputSelectArgs class='inputbox' >\$InputSelectOptions</select>
>     <input id='{\$_UniqId_}' type='submit' value='$[Jump to page]'
> class='inputbutton' />
>     <script type='text/javascript'><!--
> document.getElementById('{\$_PrevId_}').style.display = 'none';
> //--></script></form>");
> 
> Markup('input-jumpbox', '<split',
>  '/\\(:input\\s+jumpbox\\s.*?:\\)(?:\\s*\\(:input\\s+jumpbox\\s.*?:\\))*/ei', 
> 
>  "InputSelect(\$pagename, 'jumpbox', PSS('$0'))");
> 
> 
> Cheers,
> Dan
> 






More information about the pmwiki-users mailing list