Fix for accepting non-English charsets by removing unnecessary UTF encodings

This commit is contained in:
Gautham Warrier 2014-08-11 23:33:30 +05:30
parent 0296104118
commit 2d622e40c0
2 changed files with 8 additions and 7 deletions

View File

@ -178,7 +178,7 @@ EOT;
$entry = new Directory_Entry($path, $new_parents);
if ($mode === Daux::STATIC_MODE) $entry->uri .= '.html';
}
if ($entry instanceof Directory_Entry) $node->value[$entry->uri] = $entry;
if ($entry instanceof Directory_Entry) $node->value[$entry->uri] = $entry;
}
$node->sort();
$node->first_page = $node->get_first_page();

View File

@ -11,22 +11,23 @@
private function build_navigation($tree, $path, $current_url, $base_page, $mode) {
$nav = '';
foreach ($tree->value as $url => $node) {
foreach ($tree->value as $node) {
$url = $node->uri;
if ($node->type === \TodayMade\Daux\Directory_Entry::FILE_TYPE) {
if ($node->value === 'index') continue;
$nav .= '<li';
$link = ($path === '') ? $url : $path . '/' . $url;
if ($current_url === $link) $nav .= ' class="active"';
$nav .= '><a href="' . utf8_encode($base_page . $link) . '">' . utf8_encode($node->title) . '</a></li>';
$nav .= '><a href="' . $base_page . $link . '">' . $node->title . '</a></li>';
} else {
$nav .= '<li';
$link = ($path === '') ? $url : $path . '/' . $url;
if (strpos($current_url, $link) === 0) $nav .= ' class="open"';
$nav .= ">";
if ($mode === \TodayMade\Daux\Daux::STATIC_MODE) $link .= "/index.html";
if ($node->index_page) $nav .= '<a href="' . utf8_encode($base_page . $link) . '" class="folder">' .
utf8_encode($node->title) . '</a>';
else $nav .= '<a href="#" class="aj-nav folder">' . utf8_encode($node->title) . '</a>';
if ($node->index_page) $nav .= '<a href="' . $base_page . $link . '" class="folder">' .
$node->title . '</a>';
else $nav .= '<a href="#" class="aj-nav folder">' . $node->title . '</a>';
$nav .= '<ul class="nav nav-list">';
$new_path = ($path === '') ? $url : $path . '/' . $url;
$nav .= $this->build_navigation($node, $new_path, $current_url, $base_page, $mode);
@ -46,7 +47,7 @@
if ($page['filename'] === 'index' || $page['filename'] === '_index') {
if ($page['title'] != '') $title = substr($title, 0, -1 * strlen($separator));
} else $title .= '<a href="' . $base_page . $page['request'] . '">' . $page['title'] . '</a>';
return utf8_encode($title);
return $title;
}
private function get_separator($separator) {