' . $panelHeaderContent . ' ' . $pageNum . ' pages
';
}
if ($parameters['debug']) {
$miniMapHeader .= ''
. $miniMapHeader
. $miniMapList
. '
';
break;
}
return true;
}
return false;
}
/**
* Return all pages and/of sub-namespaces (subdirectory) of a namespace (ie directory)
* Adapted from feed.php
*
* @param $namespace The container of the pages
* @param string $sort 'natural' to use natural order sorting (default); 'date' to sort by filemtime
* @param $listdirs - Add the directory to the list of files
* @return array An array of the pages for the namespace
*/
function getNamespaceChildren($namespace, $sort = 'natural', $listdirs = false)
{
require_once(DOKU_INC . 'inc/search.php');
global $conf;
$ns = ':' . cleanID($namespace);
// ns as a path
$ns = utf8_encodeFN(str_replace(':', '/', $ns));
$data = array();
// Options of the callback function search_universal
// in the search.php file
$search_opts = array(
'depth' => 1,
'pagesonly' => true,
'listfiles' => true,
'listdirs' => $listdirs,
'firsthead' => true
);
// search_universal is a function in inc/search.php that accepts the $search_opts parameters
search($data, $conf['datadir'], 'search_universal', $search_opts, $ns, $lvl = 1, $sort);
return $data;
}
/**
* Return the id of the start page of a namespace
*
* @param $id an id of a namespace (directory)
* @return string the id of the home page
*/
function getNamespaceStartId($id)
{
global $conf;
$id = $id . ":";
if (page_exists($id . $conf['start'])) {
// start page inside namespace
$homePageId = $id . $conf['start'];
} elseif (page_exists($id . noNS(cleanID($id)))) {
// page named like the NS inside the NS
$homePageId = $id . noNS(cleanID($id));
} elseif (page_exists($id)) {
// page like namespace exists
$homePageId = substr($id, 0, -1);
} else {
// fall back to default
$homePageId = $id . $conf['start'];
}
return $homePageId;
}
/**
* @param $get_called_class
* @return string
*/
public static function getTagName($get_called_class)
{
list(/* $t */, /* $p */, $c) = explode('_', $get_called_class, 3);
return (isset($c) ? $c : '');
}
/**
* @return string - the tag
*/
public static function getTag()
{
return self::getTagName(get_called_class());
}
}