1<?php
2/**
3 * PopUpViewer
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     i-net software <tools@inetsoftware.de>
7 * @author     Gerry Weissbach <gweissbach@inetsoftware.de>
8 */
9
10// must be run within Dokuwiki
11if(!defined('DOKU_INC')) die();
12
13class helper_plugin_popupviewer extends DokuWiki_Plugin {
14
15    function _getWidthHeightParams($w, $h) {
16        $params = ''; $params2 = '';
17        if ( !empty($w) && intval($w) == $w ) $params2 .= ',\'' . intval($w) . '\'';
18        else {
19            if ( !empty($w) && doubleVal($w) == $w )
20            $params .= 'viewer.maxWidthFactor=' . doubleVal($w) . ';';
21            $params2 .= ',null';
22        }
23
24        if ( !empty($h) && intval($h) == $h ) $params2 .= ',\'' . intval($h) . '\'';
25        else {
26            if ( !empty($h) && doubleVal($h) == $h )
27            $params .= 'viewer.maxHeightFactor=' . doubleVal($h) . ';';
28            $params2 .= ',null';
29        }
30
31        return array($params, $params2);
32    }
33
34}
35