Skip to content
Permalink
Browse files

Update tabs to spaces.

  • Loading branch information...
gamma committed May 15, 2017
1 parent 0e4b676 commit 2ba5ebc5206ab5c26247b8fea38fe9717721f73f
Showing with 41 additions and 41 deletions.
  1. +36 −36 action.php
  2. +5 −5 plugin.info.txt
@@ -16,58 +16,58 @@
class action_plugin_docsearchsitemap extends DokuWiki_Action_Plugin {
private $data = array();
private $data = array();
/**
* Register to the content display event to place the results under it.
*/
function register(Doku_Event_Handler $controller) {
$controller->register_hook('SITEMAP_GENERATE', 'BEFORE', $this, 'runSitemapper', array());
}
/**
* Register to the content display event to place the results under it.
*/
function register(Doku_Event_Handler $controller) {
$controller->register_hook('SITEMAP_GENERATE', 'BEFORE', $this, 'runSitemapper', array());
}
/**
* Builds a Google Sitemap of all public documents known to the indexer
*
* The map is placed in the root directory named sitemap.xml.gz - This
* file needs to be writable!
*
* @autohr Gerry Weissbach
* @link https://www.google.com/webmasters/sitemaps/docs/en/about.html
*/
function runSitemapper(&$event, $param){
global $conf;
// backup the config array
$cp = $conf;
/**
* Builds a Google Sitemap of all public documents known to the indexer
*
* The map is placed in the root directory named sitemap.xml.gz - This
* file needs to be writable!
*
* @autohr Gerry Weissbach
* @link https://www.google.com/webmasters/sitemaps/docs/en/about.html
*/
function runSitemapper(&$event, $param){
global $conf;
// backup the config array
$cp = $conf;
// change index/pages folder for DocSearch
$conf['indexdir'] = init_path($conf['savedir'] . '/docsearch/index');
$conf['datadir'] = init_path($conf['savedir'] . '/docsearch/pages');
$pages = idx_get_indexer()->getPages();
// build the sitemap
foreach($pages as $id){
// build the sitemap
foreach($pages as $id){
//skip hidden, non existing and restricted files
if(isHiddenPage($id)) continue;
if(auth_aclcheck($id,'','') < AUTH_READ) continue;
// $item = SitemapItem::createFromID($id);
$id = trim($id);
$date = @filemtime(mediaFN($id));
if(!$date) continue;
$item = new SitemapItem(ml($id, '', true, '', true), $date, $changefreq, $priority);
$id = trim($id);
$date = @filemtime(mediaFN($id));
if(!$date) continue;
$item = new SitemapItem(ml($id, '', true, '', true), $date, $changefreq, $priority);
if ($item !== null) {
$event->data['items'][] = $item;
$event->data['items'][] = $item;
}
}
}
$conf = $cp;
return true;
}
$conf = $cp;
return true;
}
}
?>
@@ -1,7 +1,7 @@
base docsearchsitemap
author Gerry Weissbach
email gweissbach@inetsoftware.de
date 2014-07-15
name DocSearch Sitemap
desc Create an additional Sitemap for documents found by the docsearch plugin
url https://github.com/i-net-software/dokuwiki-plugin-docsearchsitemap
email gweissbach@inetsoftware.de
date 2014-07-15
name DocSearch Sitemap
desc Create an additional Sitemap for documents found by the docsearch plugin
url https://github.com/i-net-software/dokuwiki-plugin-docsearchsitemap

0 comments on commit 2ba5ebc

Please sign in to comment.
You can’t perform that action at this time.