From 0a860198ad45d536a51f310cd94d9757de3acd9f Mon Sep 17 00:00:00 2001 From: Claire Revillet Date: Fri, 10 Jan 2014 23:06:05 +0000 Subject: - add new section for mga4 - modification of the doc_list function to show links for epub and pdf files (optional) --- en/doc/index.php | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) (limited to 'en/doc') diff --git a/en/doc/index.php b/en/doc/index.php index 0e9dad056..0cc61853a 100644 --- a/en/doc/index.php +++ b/en/doc/index.php @@ -3,7 +3,7 @@ define('HLANG', true); require '../../langs.php'; _lang_load($locale, 'documentation'); -function doc_list($languages, $link) +function doc_list($languages, $link, $epub_link = null, $pdf_link = null) { global $locale; global $langs; @@ -13,23 +13,36 @@ function doc_list($languages, $link) $your_language_present = FALSE; $other_languages_present = FALSE; foreach ($languages as $lng) { - // hopefully temporary exception for pt-br as convention for lang-abbrev in /langs.inc.php is different as link in doc.mageia.org + // hopefully temporary exception for pt-br and sv as convention for lang-abbrev in /langs.inc.php is different as link in doc.mageia.org if ($lng == 'pt_br') { $lng_name = $langs['pt-br']; } else { - $lng_name = $langs[$lng]; + // hopefully temporary exception for sv which does not exist yet in www.mageia.org + if ($lng == 'sv') { + $lng_name = 'Swedish'; + } else { + $lng_name = $langs[$lng]; + } } if ($locale == $lng) { $your_language_present = TRUE; - $your_language = sprintf($link . '

', $lng, $lng_name); + if (is_null($epub_link) or is_null($pdf_link)) { + $your_language = sprintf($link . '

', $lng, $lng_name); + } else { + $your_language = sprintf($link . ' ( ' . $epub_link . ', ' . $pdf_link . ')

', $lng, $lng_name, $lng, $lng); + } } else { $other_languages_present = TRUE; - $others .= sprintf($link . '
', $lng, $lng_name); + if (is_null($epub_link) or is_null($pdf_link)) { + $others .= sprintf($link . '
', $lng, $lng_name); + } else { + $others .= sprintf($link . ' ( ' . $epub_link . ', ' . $pdf_link . ')
', $lng, $lng_name, $lng, $lng); + } } } if ($your_language_present) { - $text_your_language = _t('Documentation in your language:'); + $text_your_language = _t('Documentation in your language:') . '
'; if ($other_languages_present) { $text_others = _t('There are also:') . '
'; } @@ -59,6 +72,26 @@ function doc_list($languages, $link)


here)')?>


+

Mageia 4

+
+

+

%s', + 'EPUB', + 'PDF'); + ?>

+
+
+

+

%s', + 'EPUB', + 'PDF'); + ?>

+
+

Mageia 3

-- cgit v1.2.1