Mercurial > SimpleWebPresenter
comparison filters.inc @ 97:ba11b1c1b881
Add baseUrl to activeNav filter.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Thu, 18 Oct 2012 22:39:21 +0200 |
| parents | c7de7a4641d7 |
| children | ef487503dded |
comparison
equal
deleted
inserted
replaced
| 96:c7de7a4641d7 | 97:ba11b1c1b881 |
|---|---|
| 24 $pattern = '/<li id="([^"]+)"\s?([^>]*)>(.*?)<\/li>/is'; | 24 $pattern = '/<li id="([^"]+)"\s?([^>]*)>(.*?)<\/li>/is'; |
| 25 $replacement = "<li id=\"\$1\" \$2><a href=\"%URL-$1%\">\$3</a></li>"; | 25 $replacement = "<li id=\"\$1\" \$2><a href=\"%URL-$1%\">\$3</a></li>"; |
| 26 | 26 |
| 27 $opt = repMapString($options->getUrlParams()); | 27 $opt = repMapString($options->getUrlParams()); |
| 28 | 28 |
| 29 $baseUrl = $options->getBaseUrl(); | |
| 30 | |
| 29 $output = preg_replace_callback($pattern, | 31 $output = preg_replace_callback($pattern, |
| 30 create_function( | 32 create_function( |
| 31 '$matches', | 33 '$matches', |
| 32 'return "<li id=\"$matches[1]\" $matches[2]><a href=\"" . genUrl(' . $opt . ', array("name" => $matches[1]), array("lang") ) . "\">$matches[3]</a></li>";' | 34 'return "<li id=\"$matches[1]\" $matches[2]><a href=\"' . $baseUrl . '" . genUrl(' . $opt . ', array("name" => $matches[1]), array("lang", "name") ) . "\">$matches[3]</a></li>";' |
| 33 ), | 35 ), |
| 34 $output); | 36 $output); |
| 35 | 37 |
| 36 return $output; | 38 return $output; |
| 37 } | 39 } |
