-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhelper.php
34 lines (28 loc) · 999 Bytes
/
helper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* PopUpViewer
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author i-net software <[email protected]>
* @author Gerry Weissbach <[email protected]>
*/
// must be run within Dokuwiki
if(!defined('DOKU_INC')) die();
class helper_plugin_popupviewer extends DokuWiki_Plugin {
function _getWidthHeightParams($w, $h) {
$params = ''; $params2 = '';
if ( !empty($w) && intval($w) == $w ) $params2 .= ',\'' . intval($w) . '\'';
else {
if ( !empty($w) && doubleVal($w) == $w )
$params .= 'viewer.maxWidthFactor=' . doubleVal($w) . ';';
$params2 .= ',null';
}
if ( !empty($h) && intval($h) == $h ) $params2 .= ',\'' . intval($h) . '\'';
else {
if ( !empty($h) && doubleVal($h) == $h )
$params .= 'viewer.maxHeightFactor=' . doubleVal($h) . ';';
$params2 .= ',null';
}
return array($params, $params2);
}
}