4 * Copyright 2004 Nicolas Noble <pixels@users.sf.net>
5 * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
7 * This file is part of PhpWiki.
9 * PhpWiki is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * PhpWiki is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with PhpWiki; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * Display a page in a clickable popup link.
30 * title="PopUpped HomePage"
31 * text="Click here to popup the HomePage"
43 * <?plugin PopUp close=yes ?>
46 class WikiPlugin_PopUp
52 function getDescription () {
53 return _("Used to create a clickable popup link.");
56 function getVersion() {
57 return preg_replace("/[Revision: $]/", '',
60 function getDefaultArguments() {
61 return array('link' => "HomePage",
70 'directories' => "no",
73 'copyhistory' => "no",
78 function run($dbi, $argstr, &$request, $basepage) {
79 extract($this->getArgs($argstr, $request));
80 return HTML::a(array('href' => WikiURL($link),
82 'onclick' => ($close == "yes" ? "window.close()" : ("window.open('" .
83 WikiURL($link) . "', '" .
84 ($title == "" ? ($text == "" ? $link : $text) : $title) . "', '" .
87 "resizable=$resizable," .
88 "scrollbars=$scrollbars," .
90 "location=$location," .
91 "directories=$directories," .
94 "copyhistory=$copyhistory')"
97 ($text == "" ? ($close == "yes" ? "Close window" : $link) : $text)
107 // c-hanging-comment-ender-p: nil
108 // indent-tabs-mode: nil