Permalink
Browse files

fix for spcecifying namespaces (new seperator is the pipe symbol)

en: corrected language string
  • Loading branch information...
1 parent 7f10b01 commit 13304842fbb3ef96ddb0ddf0a9d38c0580adf5ee @lupo49 lupo49 committed Apr 13, 2011
Showing with 10 additions and 11 deletions.
  1. +1 −1 lang/en/settings.php
  2. +9 −10 syntax.php
View
2 lang/en/settings.php
@@ -8,6 +8,6 @@
// for the configuration manager
$lang['minimum_word_length'] = 'Minimum word-length for words in the cloud';
-$lang['tag_blacklist'] = 'Tags, die nicht auf Seiten angezeigt werden sollen (Komma separiert)';
+$lang['tag_blacklist'] = 'Tags, which shouldn\'t be displayed on pages (Comma seperated)';
//Setup VIM: ex: et ts=2 :
View
19 syntax.php
@@ -50,8 +50,8 @@ function handle($match, $state, $pos, &$handler) {
list($num, $ns) = explode('>', $num, 2);
if (!is_numeric($num)) $num = 50;
- if(!is_null($ns)) $namespaces = explode(':', $ns);
-
+ if(!is_null($ns)) $namespaces = explode('|', $ns);
+
return array($type, $num, $namespaces);
}
@@ -198,15 +198,14 @@ function _getTagCloud($num, &$min, &$max, $namespaces = NULL, &$tag) {
$blacklist = explode(',', $blacklist);
$blacklist = str_replace(' ', '', $blacklist); // remove spaces
}
- if(!empty($blacklist) && in_array($key, $blacklist)) continue;
-
+ if(!empty($blacklist) && in_array($key, $blacklist)) continue;
+
// check if page is in wanted namespace and (explicit check for root namespace, specified with a dot)
- // condition: ( (no ns given) && ( (page not in given namespace) or (page not in root namespace) )
- if( !is_null($namespaces) && ( (!is_null($namespaces) && !in_array(getNS($value[0]), $namespaces) ) ||
- ( !(getNS($value[0])) && !in_array('.', $namespaces) ) ) ) {
- // discard tag page if namespace of page isn't desired
- continue;
- }
+ // condition: ( (no ns given) && ( (page not in given namespace and page is not in rootns) )
+ if( !is_null($namespaces) && ((!is_null($namespaces) && !in_array(getNS($value[0]), $namespaces) && getNS($value[0]) )) ) continue;
+
+ // page not in root namespace
+ if( !is_null($namespaces) && (!(getNS($value[0])) && !in_array('.', $namespaces)) ) continue;
if (!is_array($value) || empty($value) || (!trim($value[0]))) {
continue;

0 comments on commit 1330484

Please sign in to comment.