Mercurial > SimpleWebPresenter
diff filters.inc @ 35:aec57ed6f5f6
Remove globals from activeNav function.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Thu, 04 Oct 2012 21:18:40 +0200 |
| parents | ca76d31b7d48 |
| children | da1726860524 |
line wrap: on
line diff
--- a/filters.inc Thu Oct 04 21:05:49 2012 +0200 +++ b/filters.inc Thu Oct 04 21:18:40 2012 +0200 @@ -1,8 +1,8 @@ <?php function activeNav($input, $options) { - $name = $GLOBALS['name']; - $lang = $GLOBALS['lang']; + $name = $options->getName(); + $lang = $options->getLang(); $pattern = "/<li id=\"${name}\"\s?([^>]*)>/is"; $replacement = "<li id=\"${name}\" class=\"active\" $1>"; $output = preg_replace($pattern, $replacement, $input); @@ -13,8 +13,7 @@ $opt = 'array('; $start = True; - foreach($options->getUrlParams() as $param) { - $value = $GLOBALS[$param]; + foreach($options->getUrlParams() as $param => $value) { if ($start) { $start = False; $opt .= "\"${param}\" => \"${value}\"";
