Skip to content

Commit

Permalink
Update tabs to spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
gamma committed May 15, 2017
1 parent 0e4b676 commit 2ba5ebc
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
72 changes: 36 additions & 36 deletions action.php
Expand Up @@ -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;
}
}

?>
10 changes: 5 additions & 5 deletions plugin.info.txt
@@ -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.