Functions
WebDev/*nix assorted functions & hacks
Search
find all
Array
-
Bash
-
Classes
-
Config
-
DateTime
-
Debug
-
dotjs
-
File
-
foooo
-
Git
-
HTML
-
Images
-
Javascript
-
Linux
-
Math
-
Misc
-
MySQL
-
OS X
-
Reading
-
Redis
-
Shell scripts
-
snippets
-
SQL
-
Strings
-
TextMate
-
Web
-
\(^o^)/ Fun!
-
_Misc hacks
-
_Pages
HTML
* Readme
pageStart($list)
popup_link(...)
styled($string, $color='black', $style='')
template($file, $assoc_data)
5
found
auth
Name:
Category: HTML
Body:
# echos or returns ($options['return']=true;) a JS popup link #__________________________________________________________________ # popup_link($link, $label, $width=300, $height=300, $options='') / function popup_link($link, $label, $width=300, $height=300, $options='') { $output = ''; $defaults = array( 'toolbar'=>'no', 'location'=>'no', 'directories'=>'no', 'status'=>'no', 'menubar'=>'no', 'scrollbars'=>'yes', 'resizable'=>'yes', 'style'=>'', 'class'=>'', 'return'=>false); # that last key makes the function return the code instead of echo it if (is_array($options)) { $options = array_merge($defaults, $options); # have the values of options override those in defaults, but $defaults = array_intersect_key($options, $defaults); # ..kick out the keys not existing in defaults. } extract($defaults); $output = "<A HREF='#' style='$style' class='$class' onClick=\"MyWindow=window.open('$link','MyWindow','toolbar=$toolbar,location=$location,directories=$directories,status=$status,menubar=$menubar,scrollbars=$scrollbars,resizable=$resizable,width=$width,height=$height'); return false;\">$label</A>"; if ((bool) $return) { return $output; }else{ echo $output; } }
Footer