Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: anwiki/_override/global/global/global.tpl.php

Issue 9148089: Less hacky implementation of the language selection (Closed)
Patch Set: Created Jan. 9, 2013, 1:31 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « anwiki/_override/contentclasses/contentclass_menu/contentclass_menu.tpl.php ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: anwiki/_override/global/global/global.tpl.php
===================================================================
--- a/anwiki/_override/global/global/global.tpl.php
+++ b/anwiki/_override/global/global/global.tpl.php
@@ -13,35 +13,19 @@ class AnwTemplateOverride_global extends
</head>
<body>
$sBody
</body>
</html>
EOF;
- $HTML = $this->moveLanguageSelection($HTML);
return $this->moveMetaTagsToHead($HTML);
}
- private function moveLanguageSelection($HTML)
- {
- $pattern = '/{{#LANGUAGESELECTION}}(.*){{\/LANGUAGESELECTION}}/s';
- preg_match($pattern, $HTML, $matches);
- if (count($matches) > 1)
- {
- $HTML = preg_replace($pattern, "", $HTML);
- $languageSelection = $matches[1];
- }
- else
- $languageSelection = "";
- $HTML = preg_replace('/<li>\s*<a\b.*?>LANGUAGESELECTION<\/a>\s*<\/li>/', $languageSelection, $HTML);
- return $HTML;
- }
-
private function moveMetaTagsToHead($HTML)
{
do
{
$HTML = preg_replace('/(<\/head>.*<body\b.*)(<meta\b[^>]*\/>\s*)/is', '$2$1', $HTML, 1, $count);
} while ($count);
return $HTML;
}
« no previous file with comments | « anwiki/_override/contentclasses/contentclass_menu/contentclass_menu.tpl.php ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld