xref: /plugin/siteexport/helper.php (revision 6292ca7aa5efa4bec9bd483c6855b04a53f4166c)
17d101cc1SGerry Weißbach<?php
27d101cc1SGerry Weißbach/**
36f1c90e9SGerry Weißbach * Siteexport Plugin helper
47d101cc1SGerry Weißbach *
57d101cc1SGerry Weißbach * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
64b73700eSGerry Weißbach * @author     i-net software <tools@inetsoftware.de>
74b73700eSGerry Weißbach * @author     Gerry Weissbach <gweissbach@inetsoftware.de>
87d101cc1SGerry Weißbach */
97d101cc1SGerry Weißbach
107d101cc1SGerry Weißbach// must be run within Dokuwiki
117d101cc1SGerry Weißbachif(!defined('DOKU_INC')) die();
12996c253aSGerry Weißbachrequire_once(DOKU_PLUGIN.'siteexport/preload.php');
13fd385364SGerry Weißbach
14fd385364SGerry Weißbachclass helper_plugin_siteexport_page_remove {
151e1afed6SGerry Weißbach    private $start, $end;
16fd385364SGerry Weißbach
170571ece2SScrutinizer Auto-Fixer    /**
180571ece2SScrutinizer Auto-Fixer     * @param integer $start
190571ece2SScrutinizer Auto-Fixer     * @param integer $end
200571ece2SScrutinizer Auto-Fixer     */
21a8c17ab5Si-net /// software    public function __construct($start, $end=null) {
221e1afed6SGerry Weißbach        $this->start = $start;
231e1afed6SGerry Weißbach        $this->end = $end;
24fd385364SGerry Weißbach    }
25fd385364SGerry Weißbach
26a8c17ab5Si-net /// software    public function _page_remove($elem) {
271e1afed6SGerry Weißbach        return $elem[2] >= $this->start && ( is_null( $this->end ) || $elem[2] <= $this->end);
28fd385364SGerry Weißbach    }
29fd385364SGerry Weißbach}
30fd385364SGerry Weißbach
317d101cc1SGerry Weißbachclass helper_plugin_siteexport extends DokuWiki_Plugin {
327d101cc1SGerry Weißbach
337d101cc1SGerry Weißbach    /*
347d101cc1SGerry Weißbach     * return all the templates that this wiki has
357d101cc1SGerry Weißbach     */
36a8c17ab5Si-net /// software    public function __getTemplates() {
377d101cc1SGerry Weißbach
387d101cc1SGerry Weißbach        // populate $this->_choices with a list of directories
397d101cc1SGerry Weißbach        $list = array();
407d101cc1SGerry Weißbach
417d101cc1SGerry Weißbach        $_dir = DOKU_INC . 'lib/tpl/';
427d101cc1SGerry Weißbach        $_pattern = '/^[\w-]+$/';
437d101cc1SGerry Weißbach        if ($dh = @opendir($_dir)) {
447d101cc1SGerry Weißbach            while (false !== ($entry = readdir($dh))) {
450571ece2SScrutinizer Auto-Fixer                if ($entry == '.' || $entry == '..') {
460571ece2SScrutinizer Auto-Fixer                    continue;
470571ece2SScrutinizer Auto-Fixer                }
480571ece2SScrutinizer Auto-Fixer                if ($entry == '.' || $entry == '..') {
490571ece2SScrutinizer Auto-Fixer                    continue;
500571ece2SScrutinizer Auto-Fixer                }
510571ece2SScrutinizer Auto-Fixer                if ($_pattern && !preg_match($_pattern,$entry)) {
520571ece2SScrutinizer Auto-Fixer                    continue;
530571ece2SScrutinizer Auto-Fixer                }
547d101cc1SGerry Weißbach
557d101cc1SGerry Weißbach                $file = (is_link($_dir.$entry)) ? readlink($_dir.$entry) : $entry;
560571ece2SScrutinizer Auto-Fixer                if (is_dir($_dir.$file)) {
570571ece2SScrutinizer Auto-Fixer                    $list[] = $entry;
580571ece2SScrutinizer Auto-Fixer                }
597d101cc1SGerry Weißbach            }
607d101cc1SGerry Weißbach            closedir($dh);
617d101cc1SGerry Weißbach        }
627d101cc1SGerry Weißbach
637d101cc1SGerry Weißbach
647d101cc1SGerry Weißbach        sort($list);
657d101cc1SGerry Weißbach        return $list;
667d101cc1SGerry Weißbach    }
677d101cc1SGerry Weißbach
687d101cc1SGerry Weißbach    /*
697d101cc1SGerry Weißbach     * Return array list of plugins that exist
707d101cc1SGerry Weißbach     */
71a8c17ab5Si-net /// software    public function __getPluginList() {
727d101cc1SGerry Weißbach        global $plugin_controller;
737d101cc1SGerry Weißbach
747d101cc1SGerry Weißbach        $allPlugins = array();
757842d330SGerry Weißbach        foreach ($plugin_controller->getList(null, true) as $plugin) { // All plugins
767d101cc1SGerry Weißbach            // check for CSS or JS
777842d330SGerry Weißbach            if (!file_exists(DOKU_PLUGIN . "$plugin/script.js") && !file_exists(DOKU_PLUGIN . "$plugin/style.css") && !file_exists(DOKU_PLUGIN . "$plugin/print.css")) { continue; }
787d101cc1SGerry Weißbach            $allPlugins[] = $plugin;
797d101cc1SGerry Weißbach        }
807d101cc1SGerry Weißbach
817d101cc1SGerry Weißbach        return array($allPlugins, $plugin_controller->getList());
827d101cc1SGerry Weißbach    }
8395c3174fSGerry Weißbach
84a8c17ab5Si-net /// software    public function _page_sort($a, $b)
85fd385364SGerry Weißbach    {
86fd385364SGerry Weißbach        if ( $a[2] == $b[2] ) {
87fd385364SGerry Weißbach            return 0;
88fd385364SGerry Weißbach        }
89fd385364SGerry Weißbach
90fd385364SGerry Weißbach        return $a[2] > $b[2] ? -1 : 1;
91fd385364SGerry Weißbach    }
92fd385364SGerry Weißbach
93*6292ca7aSGerry Weißbach    public function __getOrderedListOfPagesForID($IDs, $start=null)
94fd385364SGerry Weißbach    {
95fd385364SGerry Weißbach        global $conf;
96fd385364SGerry Weißbach        require_once(dirname(__FILE__)."/inc/functions.php");
97fd385364SGerry Weißbach        $functions = new siteexport_functions(false);
98fd385364SGerry Weißbach
99*6292ca7aSGerry Weißbach        if ( !is_array($IDs) ) {
100*6292ca7aSGerry Weißbach            $IDs = array($IDs);
101*6292ca7aSGerry Weißbach        }
102*6292ca7aSGerry Weißbach
103fd385364SGerry Weißbach        $sites = $values = array();
104fd385364SGerry Weißbach        $page = null;
105*6292ca7aSGerry Weißbach        foreach( $IDs as $ID ) {
106fd385364SGerry Weißbach        search($sites, $conf['datadir'], 'search_allpages', array(), $functions->getNamespaceFromID($ID, $page));
107fd385364SGerry Weißbach            foreach( $sites as $site ) {
108fd385364SGerry Weißbach
1090571ece2SScrutinizer Auto-Fixer                if ( $ID == $site['id'] ) {
1100571ece2SScrutinizer Auto-Fixer                    continue;
1110571ece2SScrutinizer Auto-Fixer                }
112fd385364SGerry Weißbach                $sortIdentifier = intval(p_get_metadata($site['id'], 'mergecompare'));
1136792d0cfSGerry Weißbach                array_push($values, array(':' . $site['id'], $functions->getSiteTitle($site['id']), $sortIdentifier));
114fd385364SGerry Weißbach            }
115*6292ca7aSGerry Weißbach        }
116fd385364SGerry Weißbach
1171e1afed6SGerry Weißbach        if ( $start != null ) {
11879f984a1SGerry Weißbach
119fd385364SGerry Weißbach            // filter using the newerThanPage indicator
1201e1afed6SGerry Weißbach            $sortIdentifier = intval(p_get_metadata($start, 'mergecompare'));
12179f984a1SGerry Weißbach            $values = array_filter($values, array(new helper_plugin_siteexport_page_remove($sortIdentifier), '_page_remove'));
122fd385364SGerry Weißbach        }
123fd385364SGerry Weißbach
124fd385364SGerry Weißbach        usort($values, array($this, '_page_sort'));
125fd385364SGerry Weißbach
126fd385364SGerry Weißbach        return $values;
127fd385364SGerry Weißbach    }
128fd385364SGerry Weißbach
129a8c17ab5Si-net /// software    public function __getOrderedListOfPagesForStartEnd($ID, $start, $end)
1301e1afed6SGerry Weißbach    {
1311e1afed6SGerry Weißbach        $values = $this->__getOrderedListOfPagesForID($ID);
1321e1afed6SGerry Weißbach
1331e1afed6SGerry Weißbach           // filter using the newerThanPage indicator
1341e1afed6SGerry Weißbach        $values = array_filter($values, array(new helper_plugin_siteexport_page_remove(intval($start), intval($end)), '_page_remove'));
1351e1afed6SGerry Weißbach
1361e1afed6SGerry Weißbach        usort($values, array($this, '_page_sort'));
1371e1afed6SGerry Weißbach        return $values;
1381e1afed6SGerry Weißbach    }
1391e1afed6SGerry Weißbach
140a8c17ab5Si-net /// software    public function __siteexport_addpage() {
14195c3174fSGerry Weißbach
14295c3174fSGerry Weißbach        global $ID, $conf;
14395c3174fSGerry Weißbach
14495c3174fSGerry Weißbach        $templateSwitching = false;
14595c3174fSGerry Weißbach        $pdfExport = false;
14695c3174fSGerry Weißbach        $translationAvailable = false;
14795c3174fSGerry Weißbach        $usenumberedheading = true;
148a8c17ab5Si-net /// software        $trans = array();
14995c3174fSGerry Weißbach
150996c253aSGerry Weißbach        $preload = plugin_load('preload', 'siteexport');
151996c253aSGerry Weißbach        if ($preload && $preload->__create_preload_function()) {
15295c3174fSGerry Weißbach            $templateSwitching = true;
15395c3174fSGerry Weißbach        }
15495c3174fSGerry Weißbach
155996c253aSGerry Weißbach        $dw2pdf = plugin_load('action', 'dw2pdf');
156996c253aSGerry Weißbach        if ($dw2pdf) {
15795c3174fSGerry Weißbach            $pdfExport = true;
15895c3174fSGerry Weißbach        }
15995c3174fSGerry Weißbach
1606f1c90e9SGerry Weißbach        $translation = plugin_load('helper', 'autotranslation');
161996c253aSGerry Weißbach        if ($translation) {
16295c3174fSGerry Weißbach            $translationAvailable = true;
163a8c17ab5Si-net /// software            $trans = $translation->translations;
16495c3174fSGerry Weißbach        }
16595c3174fSGerry Weißbach
166fd385364SGerry Weißbach        print $this->locale_xhtml((defined('DOKU_SITEEXPORT_MANAGER') ? 'manager' : '') . 'intro');
16795c3174fSGerry Weißbach
16895c3174fSGerry Weißbach        $form = new Doku_Form('siteexport', null, 'post');
16995c3174fSGerry Weißbach        $form->startFieldset($this->getLang('startingNamespace'));
17095c3174fSGerry Weißbach
17195c3174fSGerry Weißbach        $form->addElement(form_makeTextField('ns', $ID, $this->getLang('ns') . ':', 'ns'));
17295c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
17395c3174fSGerry Weißbach        $form->addElement(form_makeTextField('ens', $ID, $this->getLang('ens') . ':', 'ens'));
17495c3174fSGerry Weißbach
17595c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
17695c3174fSGerry Weißbach        $form->addElement(form_makeListboxField('depthType', array("0.0" => $this->getLang('depth.pageOnly'), "1.0" => $this->getLang('depth.allSubNameSpaces'), "2.0" => $this->getLang('depth.specifiedDepth')), (empty($_REQUEST['depthType']) ? $this->getLang('depth.allSubNameSpaces') : $_REQUEST['depthType']), $this->getLang('depthType') . ':', 'depthType', null, array_merge(array('class' => 'edit'))));
17795c3174fSGerry Weißbach
17895c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
17995c3174fSGerry Weißbach        $form->addElement(form_makeOpenTag("div", array('style' => 'display:' . ($_REQUEST['depthType'] == "2" ? "block" : "none") . ';', 'id' => 'depthContainer')));
18095c3174fSGerry Weißbach        $form->addElement(form_makeTextField('depth', $this->getConf('depth'), $this->getLang('depth') . ':', 'depth'));
18195c3174fSGerry Weißbach        $form->addElement(form_makeCloseTag("div"));
18295c3174fSGerry Weißbach
18395c3174fSGerry Weißbach        $form->endFieldset();
18495c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
18595c3174fSGerry Weißbach
18695c3174fSGerry Weißbach        $form->startFieldset($this->getLang('selectYourOptions'));
18795c3174fSGerry Weißbach        $form->addElement(form_makeCheckboxField('absolutePath', 1, $this->getLang('absolutePath') . ':', 'absolutePath'));
18895c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
189a0318c58SGerry Weißbach        // The parameter needs lowercase
190a0318c58SGerry Weißbach        $form->addElement(form_makeCheckboxField('exportbody', 1, $this->getLang('exportBody') . ':', 'exportbody'));
19195c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
192351a4959Si-net /// software        $form->addElement(form_makeCheckboxField('exportLinkedPages', 1, $this->getLang('exportLinkedPages') . ':', 'exportLinkedPages', 'sendIfNotSet', array('checked' => 'checked')));
1936c03fa62SGerry Weißbach        $form->addElement(form_makeTag('br'));
19495c3174fSGerry Weißbach        $form->addElement(form_makeCheckboxField('disableCache', 1, $this->getLang('disableCache') . ':', 'disableCache'));
19595c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
19695c3174fSGerry Weißbach        $form->addElement(form_makeCheckboxField('addParams', 1, $this->getLang('addParams') . ':', 'addParams', null, array_merge(array('checked' => ($conf['userewrite'] != 1 ? 'checked' : '')))));
19795c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
19895c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
19995c3174fSGerry Weißbach        $form->addElement(form_makeListboxField('renderer', array_merge(array('', 'xhtml'), plugin_list('renderer')), '', $this->getLang('renderer') . ':', 'renderer', null, array_merge(array('class' => 'edit'))));
20095c3174fSGerry Weißbach
20195c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
20295c3174fSGerry Weißbach        if ($templateSwitching) {
20395c3174fSGerry Weißbach            $form->addElement(form_makeListboxField('template', $this->__getTemplates(), $conf['template'], $this->getLang('template') . ':', 'template', null, array_merge(array('class' => 'edit'))));
20495c3174fSGerry Weißbach            $form->addElement(form_makeTag('br'));
20595c3174fSGerry Weißbach        } else
20695c3174fSGerry Weißbach        {
20795c3174fSGerry Weißbach            $form->addElement(form_makeTag('br'));
20895c3174fSGerry Weißbach            $form->addElement(form_makeOpenTag('p', array('style' => 'color: #a00;')));
20995c3174fSGerry Weißbach            $form->addElement('Can\'t create preload file in \'inc\' directory. Template switching is not available. Plugin disabling is not available.');
21095c3174fSGerry Weißbach            $form->addElement(form_makeCloseTag('p'));
21195c3174fSGerry Weißbach        }
21295c3174fSGerry Weißbach
21395c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
21495c3174fSGerry Weißbach        $form->addElement(form_makeCheckboxField('pdfExport', 1, $this->getLang('pdfExport') . ':', 'pdfExport', null, $pdfExport ? array() : array_merge(array('disabled' => 'disabled'))));
215a8c17ab5Si-net /// software
216a8c17ab5Si-net /// software        // Hint for dw2pdf
217a8c17ab5Si-net /// software        $this->addPluginHint( $form, $pdfExport, "the PDF export", "dw2pdf" );
21895c3174fSGerry Weißbach
21995c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
22095c3174fSGerry Weißbach        $form->addElement(form_makeCheckboxField('usenumberedheading', 1, $this->getLang('usenumberedheading') . ':', 'usenumberedheading', null, $usenumberedheading && $pdfExport ? array() : array_merge(array('disabled' => 'disabled'))));
22195c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
22295c3174fSGerry Weißbach
223a8c17ab5Si-net /// software        // Hint for nodetailsxhtml
224a8c17ab5Si-net /// software        $this->addPluginHint( $form, $usenumberedheading, "numbered headings", "nodetailsxhtml" );
22595c3174fSGerry Weißbach
22695c3174fSGerry Weißbach        $form->endFieldset();
22795c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
22895c3174fSGerry Weißbach
22995c3174fSGerry Weißbach        $form->startFieldset($this->getLang('helpCreationOptions'));
23095c3174fSGerry Weißbach        $form->addElement(form_makeCheckboxField('eclipseDocZip', 1, $this->getLang('eclipseDocZip') . ':', 'eclipseDocZip'));
23195c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
23295c3174fSGerry Weißbach        $form->addElement(form_makeCheckboxField('JavaHelpDocZip', 1, $this->getLang('JavaHelpDocZip') . ':', 'JavaHelpDocZip'));
23395c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
23495c3174fSGerry Weißbach        $form->addElement(form_makeCheckboxField('useTocFile', 1, $this->getLang('useTocFile') . ':', 'useTocFile'));
23595c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
23695c3174fSGerry Weißbach        $form->addElement(form_makeCheckboxField('emptyTocElem', 1, $this->getLang('emptyTocElem') . ':', 'emptyTocElem'));
23795c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
23895c3174fSGerry Weißbach        if (!$translationAvailable) {
23995c3174fSGerry Weißbach            $form->addElement(form_makeCheckboxField('TOCMapWithoutTranslation', 1, $this->getLang('TOCMapWithoutTranslation') . ':', 'TOCMapWithoutTranslation'));
24095c3174fSGerry Weißbach            $form->addElement(form_makeTag('br'));
24113326eabSGerry Weißbach        } else {
2420f428217SGerry Weißbach
2430f428217SGerry Weißbach            if (!is_array($trans)) {
2440f428217SGerry Weißbach                $trans = array($trans);
2450f428217SGerry Weißbach            }
2460f428217SGerry Weißbach
2470f428217SGerry Weißbach            $trans = array_unique(array_merge($trans, array($conf['lang'])));
2480f428217SGerry Weißbach            $form->addElement(form_makeListboxField('defaultLang', $trans, $conf['lang'], $this->getLang('defaultLang') . ':', 'defaultLang'));
24913326eabSGerry Weißbach            $form->addElement(form_makeTag('br'));
25095c3174fSGerry Weißbach        }
25195c3174fSGerry Weißbach        $form->endFieldset();
25295c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
25395c3174fSGerry Weißbach
25495c3174fSGerry Weißbach        if ($templateSwitching)
25595c3174fSGerry Weißbach        {
25695c3174fSGerry Weißbach            $form->startFieldset($this->getLang('disablePluginsOption'));
25795c3174fSGerry Weißbach
25895c3174fSGerry Weißbach            $form->addElement(form_makeCheckboxField("disableall", 1, 'Disable All:', "disableall", 'forceVisible'));
25995c3174fSGerry Weißbach            $form->addElement(form_makeTag('br'));
26095c3174fSGerry Weißbach            $form->addElement(form_makeTag('br'));
26195c3174fSGerry Weißbach
26295c3174fSGerry Weißbach            list($allPlugins, $enabledPlugins) = $this->__getPluginList();
26395c3174fSGerry Weißbach            foreach ($allPlugins as $plugin) {
26495c3174fSGerry Weißbach                $form->addElement(form_makeCheckboxField("disableplugin[]", $plugin, $plugin . ':', "disableplugin_$plugin", null, (!in_array($plugin, $enabledPlugins) ? array('checked' => 'checked', 'disabled' => 'disabled') : array())));
26595c3174fSGerry Weißbach                $form->addElement(form_makeTag('br'));
26695c3174fSGerry Weißbach            }
26795c3174fSGerry Weißbach
26895c3174fSGerry Weißbach            $form->endFieldset();
26995c3174fSGerry Weißbach            $form->addElement(form_makeTag('br'));
27095c3174fSGerry Weißbach        }
27195c3174fSGerry Weißbach
27295c3174fSGerry Weißbach        $form->startFieldset( $this->getLang('customOptions') );
27395c3174fSGerry Weißbach        $form->addElement(form_makeOpenTag('p'));
27495c3174fSGerry Weißbach        $form->addElement( $this->getLang('customOptionsDescription') );
27595c3174fSGerry Weißbach        $form->addElement(form_makeCloseTag('p'));
27695c3174fSGerry Weißbach
27795c3174fSGerry Weißbach        $form->addElement(form_makeOpenTag('ul', array('id' => 'siteexport__customActions')));
27895c3174fSGerry Weißbach        $form->addElement(form_makeCloseTag('ul'));
27995c3174fSGerry Weißbach        $form->addElement(form_makeTag('br', array('class'=>'clear')));
28095c3174fSGerry Weißbach        $form->addElement(form_makeButton('submit', 'addoption', $this->getLang('addCustomOption') , array('style' => 'float:right;') ));
28195c3174fSGerry Weißbach
28295c3174fSGerry Weißbach        $form->endFieldset();
28395c3174fSGerry Weißbach        $form->addElement(form_makeTag('br'));
28495c3174fSGerry Weißbach
285fd385364SGerry Weißbach        if ( !defined('DOKU_SITEEXPORT_MANAGER') ) {
28695c3174fSGerry Weißbach
287fd385364SGerry Weißbach
288fd385364SGerry Weißbach            $form->startFieldset( $this->getLang('startProcess') );
28995c3174fSGerry Weißbach            $form->addElement(form_makeTextField('copyurl', "", $this->getLang('directDownloadLink') . ':', 'copyurl', null, array('readonly' => 'readonly') ));
29095c3174fSGerry Weißbach            $form->addElement(form_makeTag('br'));
29195c3174fSGerry Weißbach            $form->addElement(form_makeTextField('wgeturl', "", $this->getLang('wgetURLLink') . ':', 'wgeturl', null, array('readonly' => 'readonly') ));
29295c3174fSGerry Weißbach            $form->addElement(form_makeTag('br'));
29395c3174fSGerry Weißbach            $form->addElement(form_makeTextField('curlurl', "", $this->getLang('curlURLLink') . ':', 'curlurl', null, array('readonly' => 'readonly') ));
29495c3174fSGerry Weißbach            $form->addElement(form_makeTag('br', array('class'=>'clear')));
29595c3174fSGerry Weißbach            $form->addElement(form_makeButton('submit', 'siteexport', $this->getLang('start') , array('style' => 'float:right;')));
29695c3174fSGerry Weißbach            $form->endFieldset();
29795c3174fSGerry Weißbach            $form->addElement(form_makeTag('br'));
29895c3174fSGerry Weißbach
299fd385364SGerry Weißbach            $form->endFieldset();
300fd385364SGerry Weißbach            $form->addElement(form_makeTag('br'));
301fd385364SGerry Weißbach
30295c3174fSGerry Weißbach            $form->startFieldset( $this->getLang('status') );
30395c3174fSGerry Weißbach            $form->addElement(form_makeOpenTag('span', array('id' => 'siteexport__out')));
30495c3174fSGerry Weißbach
30595c3174fSGerry Weißbach            $form->addElement(form_makeCloseTag('span'));
30695c3174fSGerry Weißbach            $form->addElement(form_makeOpenTag('span', array('class' => 'siteexport__throbber')));
307f0a70e11Si-net /// software
308f0a70e11Si-net /// software            $throbber = DOKU_BASE.'lib/images/loading.gif';
309f0a70e11Si-net /// software            if ( !file_exists( $throbber) ) {
310f0a70e11Si-net /// software                $throbber = DOKU_BASE.'lib/images/throbber.gif';
311f0a70e11Si-net /// software            }
312f0a70e11Si-net /// software
313f0a70e11Si-net /// software            $form->addElement(form_makeTag('img', array('src' => $throbber, 'id' => 'siteexport__throbber')));
31495c3174fSGerry Weißbach            $form->addElement(form_makeCloseTag('span'));
31595c3174fSGerry Weißbach            $form->endFieldset();
31695c3174fSGerry Weißbach            $form->addElement(form_makeTag('br'));
31795c3174fSGerry Weißbach
318fd385364SGerry Weißbach        } else {
319fd385364SGerry Weißbach            $form->startFieldset( $this->getLang('startProcess') );
320fd385364SGerry Weißbach            $form->addElement(form_makeButton('submit', 'siteexport', $this->getLang('useOptionsInEditor') , array('style' => 'width:100%;')));
321fd385364SGerry Weißbach        }
32295c3174fSGerry Weißbach
32395c3174fSGerry Weißbach        $form->endFieldset();
324fd385364SGerry Weißbach        $form->addElement(form_makeTag('br'));
32595c3174fSGerry Weißbach
32695c3174fSGerry Weißbach        $form->printForm();
32795c3174fSGerry Weißbach    }
328a8c17ab5Si-net /// software
329a8c17ab5Si-net /// software    private function addPluginHint( &$form, $condition, $hint, $plugin ) {
330a8c17ab5Si-net /// software        if ($condition) { return; }
331a8c17ab5Si-net /// software
332a8c17ab5Si-net /// software        $form->addElement(form_makeOpenTag('p', array('style' => 'color: #a00;')));
333a8c17ab5Si-net /// software        $form->addElement('In order to use ' . $hint . ', please ');
334a8c17ab5Si-net /// software        $form->addElement(form_makeOpenTag('a', array('href' => 'http://www.dokuwiki.org/plugin:' . $plugin, 'alt' => 'install plugin', 'target' => '_blank')));
335a8c17ab5Si-net /// software        $form->addElement('install the ' . $plugin . ' plugin.');
336a8c17ab5Si-net /// software        $form->addElement(form_makeCloseTag('a'));
337a8c17ab5Si-net /// software        $form->addElement(form_makeCloseTag('p'));
338a8c17ab5Si-net /// software    }
339a8c17ab5Si-net /// software
3407d101cc1SGerry Weißbach}
341