</div> <?php } ?> <?php // DokuWiki badges require_once 'tpl_badges.php'; // Footer hook tpl_includeFile('footer.html'); // Footer DokuWiki page require_once 'tpl_footer.php'; // Cookie-Law banner require_once 'tpl_cookielaw.php'; // Provide DokuWiki housekeeping, required in all templates tpl_indexerWebBug(); ?> <a href="#dokuwiki__top" class="back-to-top hidden-print btn btn-default btn-sm" title="<?php echo $lang['skip_to_content']; ?> " accesskey="t"><i class="fa fa-chevron-up"></i></a> <div id="screen__mode"><?php /* helper to detect CSS media query in script.js */ ?> <span class="visible-xs-block"></span> <span class="visible-sm-block"></span> <span class="visible-md-block"></span> <span class="visible-lg-block"></span> </div>
/** * Build thanks message, trigger indexing and rendering of new pages. * * @param string $thanks * @return string html of thanks message or when redirect the first page id of created pages */ protected function buildThankYouPage($thanks) { global $ID; $backupID = $ID; $html = "<p>{$thanks}</p>"; // Build result tree $pages = array_keys($this->targetpages); usort($pages, array($this, '_sorttargetpages')); $data = array(); $last_folder = array(); foreach ($pages as $ID) { $lvl = substr_count($ID, ':'); for ($n = 0; $n < $lvl; ++$n) { if (!isset($last_folder[$n]) || strpos($ID, $last_folder[$n]['id']) !== 0) { $last_folder[$n] = array('id' => substr($ID, 0, strpos($ID, ':', ($n > 0 ? strlen($last_folder[$n - 1]['id']) : 0) + 1) + 1), 'level' => $n + 1, 'open' => 1); $data[] = $last_folder[$n]; } } $data[] = array('id' => $ID, 'level' => 1 + substr_count($ID, ':'), 'type' => 'f'); } $html .= html_buildlist($data, 'idx', array($this, 'html_list_index'), 'html_li_index'); // Add indexer bugs for every just-created page $html .= '<div class="no">'; ob_start(); foreach ($pages as $ID) { // indexerWebBug uses ID and INFO[exists], but the bureaucracy form // page always exists, as does the just-saved page, so INFO[exists] // is correct in any case tpl_indexerWebBug(); // the iframe will trigger real rendering of the pages to make sure // any used plugins are initialized (eg. the do plugin) echo '<iframe src="' . wl($ID, array('do' => 'export_html')) . '" width="1" height="1" style="visibility:hidden"></iframe>'; } $html .= ob_get_contents(); ob_end_clean(); $html .= '</div>'; $ID = $backupID; return $html; }
function run($data, $thanks, $argv) { global $ID; global $conf; global $USERINFO; list($tpl, $pagename, $sep) = $argv; if (is_null($sep)) { $sep = $conf['sepchar']; } $runas = $this->getConf('runas'); $patterns = array(); $values = array(); $templates = array(); // run through fields foreach ($data as $opt) { $label = $opt->getParam('label'); $value = $opt->getParam('value'); // prepare replacements if (!is_null($label)) { $patterns[$label] = '/(@@|##)' . preg_quote($label, '/') . '(?:\\|([^|]*?))' . (is_null($value) ? '' : '?') . '\\1/si'; $values[$label] = is_null($value) ? '$2' : $value; $patterns[$label . '|'] = '/(@@|##)' . preg_quote($label, '/') . '(?:\\|(.*?))(?:\\|(.*?))\\1/si'; $values[$label . '|'] = is_null($value) ? '$2' : '$3'; } // handle pagenames $pname = $opt->getParam('pagename'); if (!is_null($pname)) { $pagename .= $sep . $pname; } if (!is_null($opt->getParam('page_tpl')) && !is_null($opt->getParam('page_tgt'))) { $page_tpl = $this->replace($patterns, $values, $opt->getParam('page_tpl')); if (auth_aclcheck($page_tpl, $runas ? $runas : $_SERVER['REMOTE_USER'], $USERINFO['grps']) >= AUTH_READ) { $templates[$opt->getParam('page_tgt')] = rawWiki($page_tpl); } } } $pagename = $this->replace($patterns, $values, $pagename); // check pagename $pagename = cleanID($pagename); if ($pagename === '') { throw new Exception($this->getLang('e_pagename')); } $_templates = array(); foreach ($templates as $k => $v) { $_templates[cleanID("{$pagename}:{$k}")] = $v; } $templates = $_templates; // get templates if ($tpl == '_') { // use namespace template if (!isset($templates[$pagename])) { $templates[$pagename] = pageTemplate(array($pagename)); } } elseif ($tpl !== '!') { // Namespace link require_once DOKU_INC . 'inc/search.php'; if ($runas) { // Hack user credentials. global $USERINFO; $backup = array($_SERVER['REMOTE_USER'], $USERINFO['grps']); $_SERVER['REMOTE_USER'] = $runas; $USERINFO['grps'] = array(); } $t_pages = array(); search($t_pages, $conf['datadir'], 'search_universal', array('depth' => 0, 'listfiles' => true), str_replace(':', '/', getNS($tpl))); foreach ($t_pages as $t_page) { $t_name = cleanID($t_page['id']); $p_name = preg_replace('/^' . preg_quote_cb(cleanID($tpl)) . '($|:)/', $pagename . '$1', $t_name); if ($p_name === $t_name) { // When using a single-page template, ignore other pages // in the same namespace. continue; } if (!isset($templates[$p_name])) { // load page data and do default pattern replacements like // namespace templates do $data = array('id' => $p_name, 'tpl' => rawWiki($t_name), 'doreplace' => true); parsePageTemplate($data); $templates[$p_name] = $data['tpl']; } } if ($runas) { /* Restore user credentials. */ global $USERINFO; list($_SERVER['REMOTE_USER'], $USERINFO['grps']) = $backup; } } if (empty($templates)) { throw new Exception(sprintf($this->getLang('e_template'), $tpl)); } // check all target pagenames foreach (array_keys($templates) as $pname) { // prevent overriding already existing pages if (page_exists($pname)) { throw new Exception(sprintf($this->getLang('e_pageexists'), html_wikilink($pname))); } // check auth if ($runas) { $auth = auth_aclcheck($pname, $runas, array()); } else { $auth = auth_quickaclcheck($pname); } if ($auth < AUTH_CREATE) { throw new Exception($this->getLang('e_denied')); } } foreach ($templates as $pname => $template) { // set NSBASE var to make certain dataplugin constructs easier $patterns['__nsbase__'] = '/@NSBASE@/'; $values['__nsbase__'] = noNS(getNS($pname)); // save page saveWikiText($pname, $this->replace($patterns, $values, $template, false), sprintf($this->getLang('summary'), $ID)); } $ret = "<p>{$thanks}</p>"; // Build result tree $pages = array_keys($templates); usort($pages, array($this, '_sort')); $oldid = $ID; $data = array(); $last_folder = array(); foreach ($pages as $ID) { $lvl = substr_count($ID, ':'); for ($n = 0; $n < $lvl; ++$n) { if (!isset($last_folder[$n]) || strpos($ID, $last_folder[$n]['id']) !== 0) { $last_folder[$n] = array('id' => substr($ID, 0, strpos($ID, ':', ($n > 0 ? strlen($last_folder[$n - 1]['id']) : 0) + 1) + 1), 'level' => $n + 1, 'open' => 1); $data[] = $last_folder[$n]; } } $data[] = array('id' => $ID, 'level' => 1 + substr_count($ID, ':'), 'type' => 'f'); } $ret .= html_buildlist($data, 'idx', array($this, 'html_list_index'), 'html_li_index'); // Add indexer bugs for every just-created page $ret .= '<div class="no">'; ob_start(); foreach ($pages as $ID) { // indexerWebBug uses ID and INFO[exists], but the bureaucracy form // page always exists, as does the just-saved page, so INFO[exists] // is correct in any case tpl_indexerWebBug(); // the iframe will trigger real rendering of the pages to make sure // any used plugins are initialized (eg. the do plugin) echo '<iframe src="' . wl($ID, array('do' => 'export_html')) . '" width="1" height="1" style="visibility:hidden"></iframe>'; } $ret .= ob_get_contents(); ob_end_clean(); $ID = $oldid; $ret .= '</div>'; return $ret; }
<?php /*old includehook*/ @include(dirname(__FILE__).'/pagefooter.html')?> <div class="bar" id="bar__bottom"> <div class="bar-left" id="bar__bottomleft"> <?php tpl_button('edit')?> <?php tpl_button('history')?> <?php tpl_button('revert')?> </div> <div class="bar-right" id="bar__bottomright"> <?php tpl_button('subscribe')?> <?php tpl_button('media')?> <?php tpl_button('admin')?> <?php tpl_button('profile')?> <?php tpl_button('login')?> <?php tpl_button('index')?> <?php tpl_button('top')?>  </div> <div class="clearer"></div> </div> </div> <?php tpl_license(false);?> </div> <?php /*old includehook*/ @include(dirname(__FILE__).'/footer.html')?> <div class="no"><?php /* provide DokuWiki housekeeping, required in all templates */ tpl_indexerWebBug()?></div> </body> </html>
</div><!-- /content-inner-inner --> </div><!-- /content-inner --> </div><!-- /content-region-inner --> </div><!-- /content-region --> </div><!-- /content-group-inner --> </div><!-- /content-group --> </div><!-- /main-content-inner --> </div><!-- /main-content --> </div><!-- /main-group-inner --> </div><!-- /main-group --> </div><!-- /main-inner --> </div><!-- /main --> </div> <div class="footer-message-wrapper full-width" id="footer-message-wrapper"> <div class="footer-message row grid16-16" id="footer-message"> <div class="footer-message-inner inner clearfix" id="footer-message-inner"> <div id="dokuwiki__footer"> <div class="doc"><?php tpl_pageinfo() // 'Last modified' etc ?></div> <?php tpl_license('button'); // content license, parameters: img=*badge|button|0, imgonly=*0|1, return=*0|1 ?> </div> <?php _tpl_include('footer.html'); ?> <?php tpl_indexerWebBug(); // provide DokuWiki housekeeping, required in all templates ?> </div><!-- /footer-message-inner --> </div><!-- /footer-message --> </div> </div> </div> </body> </html>