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 */ 21*a8c17ab5Si-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 26*a8c17ab5Si-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 */ 36*a8c17ab5Si-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 */ 71*a8c17ab5Si-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 84*a8c17ab5Si-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*a8c17ab5Si-net /// software public function __getOrderedListOfPagesForID($ID, $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 99fd385364SGerry Weißbach $sites = $values = array(); 100fd385364SGerry Weißbach $page = null; 101fd385364SGerry Weißbach search($sites, $conf['datadir'], 'search_allpages', array(), $functions->getNamespaceFromID($ID, $page)); 102fd385364SGerry Weißbach foreach( $sites as $site ) { 103fd385364SGerry Weißbach 1040571ece2SScrutinizer Auto-Fixer if ( $ID == $site['id'] ) { 1050571ece2SScrutinizer Auto-Fixer continue; 1060571ece2SScrutinizer Auto-Fixer } 107fd385364SGerry Weißbach $sortIdentifier = intval(p_get_metadata($site['id'], 'mergecompare')); 1086792d0cfSGerry Weißbach array_push($values, array(':' . $site['id'], $functions->getSiteTitle($site['id']), $sortIdentifier)); 109fd385364SGerry Weißbach } 110fd385364SGerry Weißbach 1111e1afed6SGerry Weißbach if ( $start != null ) { 11279f984a1SGerry Weißbach 113fd385364SGerry Weißbach // filter using the newerThanPage indicator 1141e1afed6SGerry Weißbach $sortIdentifier = intval(p_get_metadata($start, 'mergecompare')); 11579f984a1SGerry Weißbach $values = array_filter($values, array(new helper_plugin_siteexport_page_remove($sortIdentifier), '_page_remove')); 116fd385364SGerry Weißbach } 117fd385364SGerry Weißbach 118fd385364SGerry Weißbach usort($values, array($this, '_page_sort')); 119fd385364SGerry Weißbach 120fd385364SGerry Weißbach return $values; 121fd385364SGerry Weißbach } 122fd385364SGerry Weißbach 123*a8c17ab5Si-net /// software public function __getOrderedListOfPagesForStartEnd($ID, $start, $end) 1241e1afed6SGerry Weißbach { 1251e1afed6SGerry Weißbach $values = $this->__getOrderedListOfPagesForID($ID); 1261e1afed6SGerry Weißbach 1271e1afed6SGerry Weißbach // filter using the newerThanPage indicator 1281e1afed6SGerry Weißbach $values = array_filter($values, array(new helper_plugin_siteexport_page_remove(intval($start), intval($end)), '_page_remove')); 1291e1afed6SGerry Weißbach 1301e1afed6SGerry Weißbach usort($values, array($this, '_page_sort')); 1311e1afed6SGerry Weißbach return $values; 1321e1afed6SGerry Weißbach } 1331e1afed6SGerry Weißbach 134*a8c17ab5Si-net /// software public function __siteexport_addpage() { 13595c3174fSGerry Weißbach 13695c3174fSGerry Weißbach global $ID, $conf; 13795c3174fSGerry Weißbach 13895c3174fSGerry Weißbach $templateSwitching = false; 13995c3174fSGerry Weißbach $pdfExport = false; 14095c3174fSGerry Weißbach $translationAvailable = false; 14195c3174fSGerry Weißbach $usenumberedheading = true; 142*a8c17ab5Si-net /// software $trans = array(); 14395c3174fSGerry Weißbach 144996c253aSGerry Weißbach $preload = plugin_load('preload', 'siteexport'); 145996c253aSGerry Weißbach if ($preload && $preload->__create_preload_function()) { 14695c3174fSGerry Weißbach $templateSwitching = true; 14795c3174fSGerry Weißbach } 14895c3174fSGerry Weißbach 149996c253aSGerry Weißbach $dw2pdf = plugin_load('action', 'dw2pdf'); 150996c253aSGerry Weißbach if ($dw2pdf) { 15195c3174fSGerry Weißbach $pdfExport = true; 15295c3174fSGerry Weißbach } 15395c3174fSGerry Weißbach 1546f1c90e9SGerry Weißbach $translation = plugin_load('helper', 'autotranslation'); 155996c253aSGerry Weißbach if ($translation) { 15695c3174fSGerry Weißbach $translationAvailable = true; 157*a8c17ab5Si-net /// software $trans = $translation->translations; 15895c3174fSGerry Weißbach } 15995c3174fSGerry Weißbach 160fd385364SGerry Weißbach print $this->locale_xhtml((defined('DOKU_SITEEXPORT_MANAGER') ? 'manager' : '') . 'intro'); 16195c3174fSGerry Weißbach 16295c3174fSGerry Weißbach $form = new Doku_Form('siteexport', null, 'post'); 16395c3174fSGerry Weißbach $form->startFieldset($this->getLang('startingNamespace')); 16495c3174fSGerry Weißbach 16595c3174fSGerry Weißbach $form->addElement(form_makeTextField('ns', $ID, $this->getLang('ns') . ':', 'ns')); 16695c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 16795c3174fSGerry Weißbach $form->addElement(form_makeTextField('ens', $ID, $this->getLang('ens') . ':', 'ens')); 16895c3174fSGerry Weißbach 16995c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 17095c3174fSGerry 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')))); 17195c3174fSGerry Weißbach 17295c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 17395c3174fSGerry Weißbach $form->addElement(form_makeOpenTag("div", array('style' => 'display:' . ($_REQUEST['depthType'] == "2" ? "block" : "none") . ';', 'id' => 'depthContainer'))); 17495c3174fSGerry Weißbach $form->addElement(form_makeTextField('depth', $this->getConf('depth'), $this->getLang('depth') . ':', 'depth')); 17595c3174fSGerry Weißbach $form->addElement(form_makeCloseTag("div")); 17695c3174fSGerry Weißbach 17795c3174fSGerry Weißbach $form->endFieldset(); 17895c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 17995c3174fSGerry Weißbach 18095c3174fSGerry Weißbach $form->startFieldset($this->getLang('selectYourOptions')); 18195c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('absolutePath', 1, $this->getLang('absolutePath') . ':', 'absolutePath')); 18295c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 183a0318c58SGerry Weißbach // The parameter needs lowercase 184a0318c58SGerry Weißbach $form->addElement(form_makeCheckboxField('exportbody', 1, $this->getLang('exportBody') . ':', 'exportbody')); 18595c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 18651503e2dSGerry Weißbach $form->addElement(form_makeCheckboxField('exportLinkedPages', 1, $this->getLang('exportLinkedPages') . ':', 'exportLinkedPages', null, array('checked' => 'checked'))); 1876c03fa62SGerry Weißbach $form->addElement(form_makeTag('br')); 18895c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('disableCache', 1, $this->getLang('disableCache') . ':', 'disableCache')); 18995c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 19095c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('addParams', 1, $this->getLang('addParams') . ':', 'addParams', null, array_merge(array('checked' => ($conf['userewrite'] != 1 ? 'checked' : ''))))); 19195c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 19295c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 19395c3174fSGerry Weißbach $form->addElement(form_makeListboxField('renderer', array_merge(array('', 'xhtml'), plugin_list('renderer')), '', $this->getLang('renderer') . ':', 'renderer', null, array_merge(array('class' => 'edit')))); 19495c3174fSGerry Weißbach 19595c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 19695c3174fSGerry Weißbach if ($templateSwitching) { 19795c3174fSGerry Weißbach $form->addElement(form_makeListboxField('template', $this->__getTemplates(), $conf['template'], $this->getLang('template') . ':', 'template', null, array_merge(array('class' => 'edit')))); 19895c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 19995c3174fSGerry Weißbach } else 20095c3174fSGerry Weißbach { 20195c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 20295c3174fSGerry Weißbach $form->addElement(form_makeOpenTag('p', array('style' => 'color: #a00;'))); 20395c3174fSGerry Weißbach $form->addElement('Can\'t create preload file in \'inc\' directory. Template switching is not available. Plugin disabling is not available.'); 20495c3174fSGerry Weißbach $form->addElement(form_makeCloseTag('p')); 20595c3174fSGerry Weißbach } 20695c3174fSGerry Weißbach 20795c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 20895c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('pdfExport', 1, $this->getLang('pdfExport') . ':', 'pdfExport', null, $pdfExport ? array() : array_merge(array('disabled' => 'disabled')))); 209*a8c17ab5Si-net /// software 210*a8c17ab5Si-net /// software // Hint for dw2pdf 211*a8c17ab5Si-net /// software $this->addPluginHint( $form, $pdfExport, "the PDF export", "dw2pdf" ); 21295c3174fSGerry Weißbach 21395c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 21495c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('usenumberedheading', 1, $this->getLang('usenumberedheading') . ':', 'usenumberedheading', null, $usenumberedheading && $pdfExport ? array() : array_merge(array('disabled' => 'disabled')))); 21595c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 21695c3174fSGerry Weißbach 217*a8c17ab5Si-net /// software // Hint for nodetailsxhtml 218*a8c17ab5Si-net /// software $this->addPluginHint( $form, $usenumberedheading, "numbered headings", "nodetailsxhtml" ); 21995c3174fSGerry Weißbach 22095c3174fSGerry Weißbach $form->endFieldset(); 22195c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 22295c3174fSGerry Weißbach 22395c3174fSGerry Weißbach $form->startFieldset($this->getLang('helpCreationOptions')); 22495c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('eclipseDocZip', 1, $this->getLang('eclipseDocZip') . ':', 'eclipseDocZip')); 22595c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 22695c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('JavaHelpDocZip', 1, $this->getLang('JavaHelpDocZip') . ':', 'JavaHelpDocZip')); 22795c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 22895c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('useTocFile', 1, $this->getLang('useTocFile') . ':', 'useTocFile')); 22995c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 23095c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('emptyTocElem', 1, $this->getLang('emptyTocElem') . ':', 'emptyTocElem')); 23195c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 23295c3174fSGerry Weißbach if (!$translationAvailable) { 23395c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField('TOCMapWithoutTranslation', 1, $this->getLang('TOCMapWithoutTranslation') . ':', 'TOCMapWithoutTranslation')); 23495c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 23513326eabSGerry Weißbach } else { 2360f428217SGerry Weißbach 2370f428217SGerry Weißbach if (!is_array($trans)) { 2380f428217SGerry Weißbach $trans = array($trans); 2390f428217SGerry Weißbach } 2400f428217SGerry Weißbach 2410f428217SGerry Weißbach $trans = array_unique(array_merge($trans, array($conf['lang']))); 2420f428217SGerry Weißbach $form->addElement(form_makeListboxField('defaultLang', $trans, $conf['lang'], $this->getLang('defaultLang') . ':', 'defaultLang')); 24313326eabSGerry Weißbach $form->addElement(form_makeTag('br')); 24495c3174fSGerry Weißbach } 24595c3174fSGerry Weißbach $form->endFieldset(); 24695c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 24795c3174fSGerry Weißbach 24895c3174fSGerry Weißbach if ($templateSwitching) 24995c3174fSGerry Weißbach { 25095c3174fSGerry Weißbach $form->startFieldset($this->getLang('disablePluginsOption')); 25195c3174fSGerry Weißbach 25295c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField("disableall", 1, 'Disable All:', "disableall", 'forceVisible')); 25395c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 25495c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 25595c3174fSGerry Weißbach 25695c3174fSGerry Weißbach list($allPlugins, $enabledPlugins) = $this->__getPluginList(); 25795c3174fSGerry Weißbach foreach ($allPlugins as $plugin) { 25895c3174fSGerry Weißbach $form->addElement(form_makeCheckboxField("disableplugin[]", $plugin, $plugin . ':', "disableplugin_$plugin", null, (!in_array($plugin, $enabledPlugins) ? array('checked' => 'checked', 'disabled' => 'disabled') : array()))); 25995c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 26095c3174fSGerry Weißbach } 26195c3174fSGerry Weißbach 26295c3174fSGerry Weißbach $form->endFieldset(); 26395c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 26495c3174fSGerry Weißbach } 26595c3174fSGerry Weißbach 26695c3174fSGerry Weißbach $form->startFieldset( $this->getLang('customOptions') ); 26795c3174fSGerry Weißbach $form->addElement(form_makeOpenTag('p')); 26895c3174fSGerry Weißbach $form->addElement( $this->getLang('customOptionsDescription') ); 26995c3174fSGerry Weißbach $form->addElement(form_makeCloseTag('p')); 27095c3174fSGerry Weißbach 27195c3174fSGerry Weißbach $form->addElement(form_makeOpenTag('ul', array('id' => 'siteexport__customActions'))); 27295c3174fSGerry Weißbach $form->addElement(form_makeCloseTag('ul')); 27395c3174fSGerry Weißbach $form->addElement(form_makeTag('br', array('class'=>'clear'))); 27495c3174fSGerry Weißbach $form->addElement(form_makeButton('submit', 'addoption', $this->getLang('addCustomOption') , array('style' => 'float:right;') )); 27595c3174fSGerry Weißbach 27695c3174fSGerry Weißbach $form->endFieldset(); 27795c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 27895c3174fSGerry Weißbach 279fd385364SGerry Weißbach if ( !defined('DOKU_SITEEXPORT_MANAGER') ) { 28095c3174fSGerry Weißbach 281fd385364SGerry Weißbach 282fd385364SGerry Weißbach $form->startFieldset( $this->getLang('startProcess') ); 28395c3174fSGerry Weißbach $form->addElement(form_makeTextField('copyurl', "", $this->getLang('directDownloadLink') . ':', 'copyurl', null, array('readonly' => 'readonly') )); 28495c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 28595c3174fSGerry Weißbach $form->addElement(form_makeTextField('wgeturl', "", $this->getLang('wgetURLLink') . ':', 'wgeturl', null, array('readonly' => 'readonly') )); 28695c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 28795c3174fSGerry Weißbach $form->addElement(form_makeTextField('curlurl', "", $this->getLang('curlURLLink') . ':', 'curlurl', null, array('readonly' => 'readonly') )); 28895c3174fSGerry Weißbach $form->addElement(form_makeTag('br', array('class'=>'clear'))); 28995c3174fSGerry Weißbach $form->addElement(form_makeButton('submit', 'siteexport', $this->getLang('start') , array('style' => 'float:right;'))); 29095c3174fSGerry Weißbach $form->endFieldset(); 29195c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 29295c3174fSGerry Weißbach 293fd385364SGerry Weißbach $form->endFieldset(); 294fd385364SGerry Weißbach $form->addElement(form_makeTag('br')); 295fd385364SGerry Weißbach 29695c3174fSGerry Weißbach $form->startFieldset( $this->getLang('status') ); 29795c3174fSGerry Weißbach $form->addElement(form_makeOpenTag('span', array('id' => 'siteexport__out'))); 29895c3174fSGerry Weißbach 29995c3174fSGerry Weißbach $form->addElement(form_makeCloseTag('span')); 30095c3174fSGerry Weißbach $form->addElement(form_makeOpenTag('span', array('class' => 'siteexport__throbber'))); 30195c3174fSGerry Weißbach $form->addElement(form_makeTag('img', array('src' => DOKU_BASE.'lib/images/loading.gif', 'id' => 'siteexport__throbber'))); 30295c3174fSGerry Weißbach $form->addElement(form_makeCloseTag('span')); 30395c3174fSGerry Weißbach $form->endFieldset(); 30495c3174fSGerry Weißbach $form->addElement(form_makeTag('br')); 30595c3174fSGerry Weißbach 306fd385364SGerry Weißbach } else { 307fd385364SGerry Weißbach $form->startFieldset( $this->getLang('startProcess') ); 308fd385364SGerry Weißbach $form->addElement(form_makeButton('submit', 'siteexport', $this->getLang('useOptionsInEditor') , array('style' => 'width:100%;'))); 309fd385364SGerry Weißbach } 31095c3174fSGerry Weißbach 31195c3174fSGerry Weißbach $form->endFieldset(); 312fd385364SGerry Weißbach $form->addElement(form_makeTag('br')); 31395c3174fSGerry Weißbach 31495c3174fSGerry Weißbach $form->printForm(); 31595c3174fSGerry Weißbach } 316*a8c17ab5Si-net /// software 317*a8c17ab5Si-net /// software private function addPluginHint( &$form, $condition, $hint, $plugin ) { 318*a8c17ab5Si-net /// software if ($condition) { return; } 319*a8c17ab5Si-net /// software 320*a8c17ab5Si-net /// software $form->addElement(form_makeOpenTag('p', array('style' => 'color: #a00;'))); 321*a8c17ab5Si-net /// software $form->addElement('In order to use ' . $hint . ', please '); 322*a8c17ab5Si-net /// software $form->addElement(form_makeOpenTag('a', array('href' => 'http://www.dokuwiki.org/plugin:' . $plugin, 'alt' => 'install plugin', 'target' => '_blank'))); 323*a8c17ab5Si-net /// software $form->addElement('install the ' . $plugin . ' plugin.'); 324*a8c17ab5Si-net /// software $form->addElement(form_makeCloseTag('a')); 325*a8c17ab5Si-net /// software $form->addElement(form_makeCloseTag('p')); 326*a8c17ab5Si-net /// software } 327*a8c17ab5Si-net /// software 3287d101cc1SGerry Weißbach} 329