Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
Hide all the translation namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Schumacher committed Feb 3, 2015
1 parent 8d4bb76 commit 48eb47d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion syntax.php
Expand Up @@ -130,7 +130,7 @@ function render($mode, &$renderer, $data)

private function RenderNodes(DokuWikiNameSpace $node)
{
global $INFO;
global $INFO,$conf;
$this->depth++;
$output = '';
foreach ($node->getNodes() as $node) {
Expand All @@ -139,6 +139,12 @@ private function RenderNodes(DokuWikiNameSpace $node)
continue;
if (preg_match($this->exclusion_mask,$node->getFullID()))
continue;
// check if the translation plugin is active and if so, hide all the translation namespaces
if (!plugin_isdisabled('translation')) {
$translations = $this->getTranslations();
if (in_array($node->getName(),$translations))
continue;
}
$title = (strlen($node->getMetaData('title')) > 0 ? $node->getMetaData('title') : $node->getName());
$access = auth_quickaclcheck($node->getFullID());
if ($node instanceof DokuWikiPage) {
Expand Down Expand Up @@ -174,4 +180,17 @@ private function RenderNodes(DokuWikiNameSpace $node)
}
return $output;
}

/**
* @param $conf
* @return array|string
*/
private function getTranslations()
{
global $conf;
$translations = strtolower(str_replace(',', ' ', $conf['plugin']['translation']['translations']));
$translations = array_unique(array_filter(explode(' ', $translations)));
sort($translations);
return $translations;
}
}

0 comments on commit 48eb47d

Please sign in to comment.