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 936292ca7aSGerry 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 996292ca7aSGerry Weißbach if ( !is_array($IDs) ) { 1006292ca7aSGerry Weißbach $IDs = array($IDs); 1016292ca7aSGerry Weißbach } 1026292ca7aSGerry Weißbach 103fd385364SGerry Weißbach $sites = $values = array(); 1046292ca7aSGerry Weißbach foreach( $IDs as $ID ) { 10539a762abSGerry Weißbach $page = null; 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')); 11339a762abSGerry Weißbach $entry = array(':' . $site['id'], $functions->getSiteTitle($site['id']), $sortIdentifier); 11439a762abSGerry Weißbach 11539a762abSGerry Weißbach if ( !in_array($entry[0], array_column($values, 0)) ) { 11639a762abSGerry Weißbach array_push($values, $entry); 117fd385364SGerry Weißbach } 1186292ca7aSGerry Weißbach } 11939a762abSGerry Weißbach } 12039a762abSGerry Weißbach 121fd385364SGerry Weißbach 1221e1afed6SGerry Weißbach if ( $start != null ) { 123fd385364SGerry Weißbach // filter using the newerThanPage indicator 1241e1afed6SGerry Weißbach $sortIdentifier = intval(p_get_metadata($start, 'mergecompare')); 12579f984a1SGerry Weißbach $values = array_filter($values, array(new helper_plugin_siteexport_page_remove($sortIdentifier), '_page_remove')); 126fd385364SGerry Weißbach } 127fd385364SGerry Weißbach 128fd385364SGerry Weißbach usort($values, array($this, '_page_sort')); 129fd385364SGerry Weißbach 130fd385364SGerry Weißbach return $values; 131fd385364SGerry Weißbach } 132fd385364SGerry Weißbach 133a8c17ab5Si-net /// software public function __getOrderedListOfPagesForStartEnd($ID, $start, $end) 1341e1afed6SGerry Weißbach { 1351e1afed6SGerry Weißbach $values = $this->__getOrderedListOfPagesForID($ID); 1361e1afed6SGerry Weißbach 1371e1afed6SGerry Weißbach // filter using the newerThanPage indicator 1381e1afed6SGerry Weißbach $values = array_filter($values, array(new helper_plugin_siteexport_page_remove(intval($start), intval($end)), '_page_remove')); 1391e1afed6SGerry Weißbach 1401e1afed6SGerry Weißbach usort($values, array($this, '_page_sort')); 1411e1afed6SGerry Weißbach return $values; 1421e1afed6SGerry Weißbach } 1431e1afed6SGerry Weißbach 144a8c17ab5Si-net /// software public function __siteexport_addpage() { 14595c3174fSGerry Weißbach 146f161d4fbSatisne global $ID, $conf, $INPUT; 14795c3174fSGerry Weißbach 14895c3174fSGerry Weißbach $templateSwitching = false; 14995c3174fSGerry Weißbach $pdfExport = false; 15095c3174fSGerry Weißbach $translationAvailable = false; 15195c3174fSGerry Weißbach $usenumberedheading = true; 152a8c17ab5Si-net /// software $trans = array(); 15395c3174fSGerry Weißbach 154996c253aSGerry Weißbach $preload = plugin_load('preload', 'siteexport'); 155996c253aSGerry Weißbach if ($preload && $preload->__create_preload_function()) { 15695c3174fSGerry Weißbach $templateSwitching = true; 15795c3174fSGerry Weißbach } 15895c3174fSGerry Weißbach 159996c253aSGerry Weißbach $dw2pdf = plugin_load('action', 'dw2pdf'); 160*56c4b32dSGerry Weißbach if (!function_exists('siteexport_dw2pdf_has_mpdf_engine')) { 161*56c4b32dSGerry Weißbach require_once DOKU_PLUGIN . 'siteexport/inc/pdfgenerator.php'; 16295c3174fSGerry Weißbach } 163*56c4b32dSGerry Weißbach // mPDF may live in legacy dw2pdf/mpdf/ or current dw2pdf/vendor/ (+ DokuPDF) 164*56c4b32dSGerry Weißbach $pdfExport = siteexport_dw2pdf_has_mpdf_engine(); 16595c3174fSGerry Weißbach 1666f1c90e9SGerry Weißbach $translation = plugin_load('helper', 'autotranslation'); 167996c253aSGerry Weißbach if ($translation) { 16895c3174fSGerry Weißbach $translationAvailable = true; 169a8c17ab5Si-net /// software $trans = $translation->translations; 17095c3174fSGerry Weißbach } 17195c3174fSGerry Weißbach 172fd385364SGerry Weißbach print $this->locale_xhtml((defined('DOKU_SITEEXPORT_MANAGER') ? 'manager' : '') . 'intro'); 17395c3174fSGerry Weißbach 17495c3174fSGerry Weißbach $form = new Doku_Form('siteexport', null, 'post'); 17595c3174fSGerry Weißbach $form->startFieldset($this->getLang('startingNamespace')); 17695c3174fSGerry Weißbach 17795c3174fSGerry Weißbach $form->addElement(form_makeTextField('ns', $ID, $this->getLang('ns') . ':', 'ns')); 17895c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 17995c3174fSGerry Weißbach $form->addElement(form_makeTextField('ens', $ID, $this->getLang('ens') . ':', 'ens')); 18095c3174fSGerry Weißbach 18195c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 182f161d4fbSatisne $form->addElement(form_makeListboxField('depthType', array("0.0" => $this->getLang('depth.pageOnly'), "1.0" => $this->getLang('depth.allSubNameSpaces'), "2.0" => $this->getLang('depth.specifiedDepth')), $INPUT->str('depthType', $this->getLang('depth.allSubNameSpaces'), true), $this->getLang('depthType') . ':', 'depthType', null, array_merge(array('class' => 'edit')))); 18395c3174fSGerry Weißbach 18495c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 185f161d4fbSatisne $form->addElement(form_makeOpenTag("div", array('style' => 'display:' . ($INPUT->str('depthType') == "2" ? "block" : "none") . ';', 'id' => 'depthContainer'))); 18695c3174fSGerry Weißbach $form->addElement(form_makeTextField('depth', $this->getConf('depth'), $this->getLang('depth') . ':', 'depth')); 18795c3174fSGerry Weißbach $form->addElement(form_makeCloseTag("div")); 18895c3174fSGerry Weißbach 18995c3174fSGerry Weißbach $form->endFieldset(); 19095c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 19195c3174fSGerry Weißbach 19295c3174fSGerry Weißbach $form->startFieldset($this->getLang('selectYourOptions')); 19395c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('absolutePath', 1, $this->getLang('absolutePath') . ':', 'absolutePath')); 19495c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 195a0318c58SGerry Weißbach // The parameter needs lowercase 196a0318c58SGerry Weißbach $form->addElement(form_makeCheckboxField('exportbody', 1, $this->getLang('exportBody') . ':', 'exportbody')); 19795c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 198351a4959Si-net /// software $form->addElement(form_makeCheckboxField('exportLinkedPages', 1, $this->getLang('exportLinkedPages') . ':', 'exportLinkedPages', 'sendIfNotSet', array('checked' => 'checked'))); 1996c03fa62SGerry Weißbach $form->addElement(form_makeTag('br')); 20095c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('disableCache', 1, $this->getLang('disableCache') . ':', 'disableCache')); 20195c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 20295c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('addParams', 1, $this->getLang('addParams') . ':', 'addParams', null, array_merge(array('checked' => ($conf['userewrite'] != 1 ? 'checked' : ''))))); 20395c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 20495c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 20595c3174fSGerry Weißbach $form->addElement(form_makeListboxField('renderer', array_merge(array('', 'xhtml'), plugin_list('renderer')), '', $this->getLang('renderer') . ':', 'renderer', null, array_merge(array('class' => 'edit')))); 20695c3174fSGerry Weißbach 20795c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 20895c3174fSGerry Weißbach if ($templateSwitching) { 20995c3174fSGerry Weißbach $form->addElement(form_makeListboxField('template', $this->__getTemplates(), $conf['template'], $this->getLang('template') . ':', 'template', null, array_merge(array('class' => 'edit')))); 21095c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 21195c3174fSGerry Weißbach } else 21295c3174fSGerry Weißbach { 21395c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 21495c3174fSGerry Weißbach $form->addElement(form_makeOpenTag('p', array('style' => 'color: #a00;'))); 21595c3174fSGerry Weißbach $form->addElement('Can\'t create preload file in \'inc\' directory. Template switching is not available. Plugin disabling is not available.'); 21695c3174fSGerry Weißbach $form->addElement(form_makeCloseTag('p')); 21795c3174fSGerry Weißbach } 21895c3174fSGerry Weißbach 21995c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 22095c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('pdfExport', 1, $this->getLang('pdfExport') . ':', 'pdfExport', null, $pdfExport ? array() : array_merge(array('disabled' => 'disabled')))); 221a8c17ab5Si-net /// software 222a8c17ab5Si-net /// software // Hint for dw2pdf 223a8c17ab5Si-net /// software $this->addPluginHint( $form, $pdfExport, "the PDF export", "dw2pdf" ); 22495c3174fSGerry Weißbach 22595c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 22695c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('usenumberedheading', 1, $this->getLang('usenumberedheading') . ':', 'usenumberedheading', null, $usenumberedheading && $pdfExport ? array() : array_merge(array('disabled' => 'disabled')))); 22795c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 22895c3174fSGerry Weißbach 229a8c17ab5Si-net /// software // Hint for nodetailsxhtml 230a8c17ab5Si-net /// software $this->addPluginHint( $form, $usenumberedheading, "numbered headings", "nodetailsxhtml" ); 23195c3174fSGerry Weißbach 23295c3174fSGerry Weißbach $form->endFieldset(); 23395c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 23495c3174fSGerry Weißbach 23595c3174fSGerry Weißbach $form->startFieldset($this->getLang('helpCreationOptions')); 23695c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('eclipseDocZip', 1, $this->getLang('eclipseDocZip') . ':', 'eclipseDocZip')); 23795c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 23895c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('JavaHelpDocZip', 1, $this->getLang('JavaHelpDocZip') . ':', 'JavaHelpDocZip')); 23995c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 24095c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('useTocFile', 1, $this->getLang('useTocFile') . ':', 'useTocFile')); 24195c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 24295c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('emptyTocElem', 1, $this->getLang('emptyTocElem') . ':', 'emptyTocElem')); 24395c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 24495c3174fSGerry Weißbach if (!$translationAvailable) { 24595c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('TOCMapWithoutTranslation', 1, $this->getLang('TOCMapWithoutTranslation') . ':', 'TOCMapWithoutTranslation')); 24695c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 24713326eabSGerry Weißbach } else { 2480f428217SGerry Weißbach 2490f428217SGerry Weißbach if (!is_array($trans)) { 2500f428217SGerry Weißbach $trans = array($trans); 2510f428217SGerry Weißbach } 2520f428217SGerry Weißbach 2530f428217SGerry Weißbach $trans = array_unique(array_merge($trans, array($conf['lang']))); 2540f428217SGerry Weißbach $form->addElement(form_makeListboxField('defaultLang', $trans, $conf['lang'], $this->getLang('defaultLang') . ':', 'defaultLang')); 25513326eabSGerry Weißbach $form->addElement(form_makeTag('br')); 25695c3174fSGerry Weißbach } 25795c3174fSGerry Weißbach $form->endFieldset(); 25895c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 25995c3174fSGerry Weißbach 26095c3174fSGerry Weißbach if ($templateSwitching) 26195c3174fSGerry Weißbach { 26295c3174fSGerry Weißbach $form->startFieldset($this->getLang('disablePluginsOption')); 26395c3174fSGerry Weißbach 26495c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField("disableall", 1, 'Disable All:', "disableall", 'forceVisible')); 26595c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 26695c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 26795c3174fSGerry Weißbach 26895c3174fSGerry Weißbach list($allPlugins, $enabledPlugins) = $this->__getPluginList(); 26995c3174fSGerry Weißbach foreach ($allPlugins as $plugin) { 27095c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField("disableplugin[]", $plugin, $plugin . ':', "disableplugin_$plugin", null, (!in_array($plugin, $enabledPlugins) ? array('checked' => 'checked', 'disabled' => 'disabled') : array()))); 27195c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 27295c3174fSGerry Weißbach } 27395c3174fSGerry Weißbach 27495c3174fSGerry Weißbach $form->endFieldset(); 27595c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 27695c3174fSGerry Weißbach } 27795c3174fSGerry Weißbach 27895c3174fSGerry Weißbach $form->startFieldset( $this->getLang('customOptions') ); 27995c3174fSGerry Weißbach $form->addElement(form_makeOpenTag('p')); 28095c3174fSGerry Weißbach $form->addElement( $this->getLang('customOptionsDescription') ); 28195c3174fSGerry Weißbach $form->addElement(form_makeCloseTag('p')); 28295c3174fSGerry Weißbach 28395c3174fSGerry Weißbach $form->addElement(form_makeOpenTag('ul', array('id' => 'siteexport__customActions'))); 28495c3174fSGerry Weißbach $form->addElement(form_makeCloseTag('ul')); 28595c3174fSGerry Weißbach $form->addElement(form_makeTag('br', array('class'=>'clear'))); 28695c3174fSGerry Weißbach $form->addElement(form_makeButton('submit', 'addoption', $this->getLang('addCustomOption') , array('style' => 'float:right;') )); 28795c3174fSGerry Weißbach 28895c3174fSGerry Weißbach $form->endFieldset(); 28995c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 29095c3174fSGerry Weißbach 291fd385364SGerry Weißbach if ( !defined('DOKU_SITEEXPORT_MANAGER') ) { 29295c3174fSGerry Weißbach 293fd385364SGerry Weißbach 294fd385364SGerry Weißbach $form->startFieldset( $this->getLang('startProcess') ); 29595c3174fSGerry Weißbach $form->addElement(form_makeTextField('copyurl', "", $this->getLang('directDownloadLink') . ':', 'copyurl', null, array('readonly' => 'readonly') )); 29695c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 29795c3174fSGerry Weißbach $form->addElement(form_makeTextField('wgeturl', "", $this->getLang('wgetURLLink') . ':', 'wgeturl', null, array('readonly' => 'readonly') )); 29895c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 29995c3174fSGerry Weißbach $form->addElement(form_makeTextField('curlurl', "", $this->getLang('curlURLLink') . ':', 'curlurl', null, array('readonly' => 'readonly') )); 30095c3174fSGerry Weißbach $form->addElement(form_makeTag('br', array('class'=>'clear'))); 30195c3174fSGerry Weißbach $form->addElement(form_makeButton('submit', 'siteexport', $this->getLang('start') , array('style' => 'float:right;'))); 30295c3174fSGerry Weißbach $form->endFieldset(); 30395c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 30495c3174fSGerry Weißbach 305fd385364SGerry Weißbach $form->endFieldset(); 306fd385364SGerry Weißbach $form->addElement(form_makeTag('br')); 307fd385364SGerry Weißbach 30895c3174fSGerry Weißbach $form->startFieldset( $this->getLang('status') ); 30995c3174fSGerry Weißbach $form->addElement(form_makeOpenTag('span', array('id' => 'siteexport__out'))); 31095c3174fSGerry Weißbach 31195c3174fSGerry Weißbach $form->addElement(form_makeCloseTag('span')); 31295c3174fSGerry Weißbach $form->addElement(form_makeOpenTag('span', array('class' => 'siteexport__throbber'))); 313f0a70e11Si-net /// software 314f0a70e11Si-net /// software $throbber = DOKU_BASE.'lib/images/loading.gif'; 315f0a70e11Si-net /// software if ( !file_exists( $throbber) ) { 316f0a70e11Si-net /// software $throbber = DOKU_BASE.'lib/images/throbber.gif'; 317f0a70e11Si-net /// software } 318f0a70e11Si-net /// software 319f0a70e11Si-net /// software $form->addElement(form_makeTag('img', array('src' => $throbber, 'id' => 'siteexport__throbber'))); 32095c3174fSGerry Weißbach $form->addElement(form_makeCloseTag('span')); 32195c3174fSGerry Weißbach $form->endFieldset(); 32295c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 32395c3174fSGerry Weißbach 324fd385364SGerry Weißbach } else { 325fd385364SGerry Weißbach $form->startFieldset( $this->getLang('startProcess') ); 326fd385364SGerry Weißbach $form->addElement(form_makeButton('submit', 'siteexport', $this->getLang('useOptionsInEditor') , array('style' => 'width:100%;'))); 327fd385364SGerry Weißbach } 32895c3174fSGerry Weißbach 32995c3174fSGerry Weißbach $form->endFieldset(); 330fd385364SGerry Weißbach $form->addElement(form_makeTag('br')); 33195c3174fSGerry Weißbach 33295c3174fSGerry Weißbach $form->printForm(); 33395c3174fSGerry Weißbach } 334a8c17ab5Si-net /// software 335a8c17ab5Si-net /// software private function addPluginHint( &$form, $condition, $hint, $plugin ) { 336a8c17ab5Si-net /// software if ($condition) { return; } 337a8c17ab5Si-net /// software 338a8c17ab5Si-net /// software $form->addElement(form_makeOpenTag('p', array('style' => 'color: #a00;'))); 339a8c17ab5Si-net /// software $form->addElement('In order to use ' . $hint . ', please '); 340a8c17ab5Si-net /// software $form->addElement(form_makeOpenTag('a', array('href' => 'http://www.dokuwiki.org/plugin:' . $plugin, 'alt' => 'install plugin', 'target' => '_blank'))); 341a8c17ab5Si-net /// software $form->addElement('install the ' . $plugin . ' plugin.'); 342a8c17ab5Si-net /// software $form->addElement(form_makeCloseTag('a')); 343a8c17ab5Si-net /// software $form->addElement(form_makeCloseTag('p')); 344a8c17ab5Si-net /// software } 345a8c17ab5Si-net /// software 3467d101cc1SGerry Weißbach} 347