[pmwiki-users] Re: newwin with defined size

Albi Rebmann albi at life.de
Tue Jul 5 14:51:38 CDT 2005


> A custom markup could look like the following:
> 
> Markup('newwin', 'directives', '/\\(:newwin(.*?):\\)/e',
>        "newwin(PSS('$1'))");
> 
> function newwin($args) {
>   $defaults = array('height' => 480, 'width' => 640, 'title' => '',
>                     'text' => '');
>   $args = array_merge($defaults, ParseArgs($args));
>   $link = array_pop($args['']);
>   extract($args);
> 
>   $htmllink = "<a href=\"$link\" onClick=\"window.open(this.href, ".
>     "'$title', 'width=$width,height=$height'); return false\">".
>     "$text</a>";
>   return Keep($htmllink, 'L');
> }
> 
> After copying this into config.php (or in a cookbook file), you can use 
> markups in a wiki page like

Thanks very much. But I get some error using it:

Warning: array_pop(): The argument should be an array in 
.../local/config.php on line 173

Warning: Cannot modify header information - headers already sent by 
(output started at .../local/config.php:173) in .../pmwiki.php on line 705

My idea was using it together with easygallery 
(http://pmwiki.org/wiki/Cookbook/EasyGallery), so I can define the size 
of the popup window for the big picture. At the moment it opens just in 
same size as normal window.

Maybe PM can make a small modification, thats this is possible. I think 
%newwin% with width and size would be interesting in other cases too.


ALBI...




More information about the pmwiki-users mailing list