aboutsummaryrefslogtreecommitdiffstats
path: root/en/doc
diff options
context:
space:
mode:
authorFilip Komar <filip@mageia.org>2014-01-20 23:00:37 +0000
committerFilip Komar <filip@mageia.org>2014-01-20 23:00:37 +0000
commit1579e289972d200578cd9f528ee7a7ba30acce49 (patch)
tree169eaada06e0717027506fbbde377d2674dc11e9 /en/doc
parent4497dc1385c4c9c9925b1660a157fdd51342cd67 (diff)
downloadwww-1579e289972d200578cd9f528ee7a7ba30acce49.tar
www-1579e289972d200578cd9f528ee7a7ba30acce49.tar.gz
www-1579e289972d200578cd9f528ee7a7ba30acce49.tar.bz2
www-1579e289972d200578cd9f528ee7a7ba30acce49.tar.xz
www-1579e289972d200578cd9f528ee7a7ba30acce49.zip
moved function and languages out of layout pages
Diffstat (limited to 'en/doc')
-rw-r--r--en/doc/archive.php37
-rw-r--r--en/doc/doc.php63
-rw-r--r--en/doc/index.php58
3 files changed, 66 insertions, 92 deletions
diff --git a/en/doc/archive.php b/en/doc/archive.php
index 3e1f111a3..f0c66e2ec 100644
--- a/en/doc/archive.php
+++ b/en/doc/archive.php
@@ -3,41 +3,7 @@ define('HLANG', true);
require '../../langs.php';
_lang_load($locale, 'documentation');
-function doc_list($languages, $link)
-{
- global $locale;
- global $langs;
- $your_language = '';
- $others = '';
- $text_others = '';
- $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
- if ($lng == 'pt_br') {
- $lng_name = $langs['pt-br'];
- } else {
- $lng_name = $langs[$lng];
- }
-
- if ($locale == $lng) {
- $your_language_present = TRUE;
- $your_language = sprintf($link . '<br/><br/>', $lng, $lng_name);
- } else {
- $other_languages_present = TRUE;
- $others .= sprintf($link . '<br/>', $lng, $lng_name);
- }
- }
- if ($your_language_present) {
- $text_your_language = _t('Documentation in your language:');
- if ($other_languages_present) {
- $text_others = _t('There are also:') . '<br/>';
- }
- } else {
- $text_your_language = _t('Please help <a href="../community/">us</a> translate it in your language.') . '<br/>';
- }
- echo $text_your_language . $your_language . $text_others . $others;
-}
+require 'doc.php';
?><!DOCTYPE html>
<html lang="<?php echo $locale; ?>" dir="ltr">
@@ -63,7 +29,6 @@ function doc_list($languages, $link)
<div style="float: left; margin: 2em;">
<h4><?php _e('Installer')?></h4>
<p><?php
- $mga2_installer = array('de','el','en','eo','fr','nl','pt_br','uk');
doc_list($mga2_installer, '<a href="//doc.mageia.org/installer/2/%s/content/index.html">%s</a>');
?></p>
</div>
diff --git a/en/doc/doc.php b/en/doc/doc.php
new file mode 100644
index 000000000..31481288d
--- /dev/null
+++ b/en/doc/doc.php
@@ -0,0 +1,63 @@
+<?php
+
+$mga4_installer = array('ca','cs','de','el','en','eo','es','et','fr','id','nl','pl','pt_br','ro','ru','sv','tr','uk');
+$mga4_control_center = array('de','en','et','fr','id','nl','ru','tr','uk');
+
+$mga3_installer = array('de','el','en','es','et','fr','nl','pt_br','ru','uk');
+$mga3_control_center = array('en','et','fr');
+
+$mga2_installer = array('de','el','en','eo','fr','nl','pt_br','uk');
+
+function doc_list($languages, $link, $epub_link = null, $pdf_link = null)
+{
+ global $locale;
+ global $langs;
+ $your_language = '';
+ $others = '';
+ $text_others = '';
+ $your_language_present = FALSE;
+ $other_languages_present = FALSE;
+ foreach ($languages as $lng) {
+ // 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 {
+ // 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;
+ if (is_null($epub_link) or is_null($pdf_link)) {
+ $your_language = sprintf($lng_name . ' ~> ' . $link . '<br/><br/>', $lng, $lng_name);
+ } else {
+ $your_language = sprintf($lng_name . ' ~> ' . $link .
+ ' <span style="font-size: 07pt;">( available downloads: ' .
+ $epub_link . ', ' . $pdf_link . ')</span><br/><br/>',
+ $lng, $lng, $lng);
+ }
+ } else {
+ $other_languages_present = TRUE;
+ if (is_null($epub_link) or is_null($pdf_link)) {
+ $others .= sprintf($lng_name . ' ~> ' . $link . '<br/>', $lng, $lng_name);
+ } else {
+ $others .= sprintf($lng_name . ' ~> ' . $link .
+ ' <span style="font-size: 07pt;">( ' . $epub_link .
+ ', ' . $pdf_link . ')</span><br/>', $lng, $lng, $lng);
+ }
+ }
+ }
+ if ($your_language_present) {
+ $text_your_language = _t('<span style="font-weight:bold">Documentation in your language:</span>') . '<br/>';
+ if ($other_languages_present) {
+ $text_others = _t('<span style="font-weight:bold">There are also:</span>') . '<br/>';
+ }
+ } else {
+ $text_your_language = _t('Please help <a href="../community/">us</a> translate it in your language.') . '<br/>';
+ }
+ echo $text_your_language . $your_language . $text_others . $others;
+}
diff --git a/en/doc/index.php b/en/doc/index.php
index fb90d5358..25ffbfaf7 100644
--- a/en/doc/index.php
+++ b/en/doc/index.php
@@ -3,59 +3,9 @@ define('HLANG', true);
require '../../langs.php';
_lang_load($locale, 'documentation');
-function doc_list($languages, $link, $epub_link = null, $pdf_link = null)
-{
- global $locale;
- global $langs;
- $your_language = '';
- $others = '';
- $text_others = '';
- $your_language_present = FALSE;
- $other_languages_present = FALSE;
- foreach ($languages as $lng) {
- // 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 {
- // 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;
- if (is_null($epub_link) or is_null($pdf_link)) {
- $your_language = sprintf($lng_name . ' ~> ' . $link . '<br/><br/>', $lng, $lng_name);
- } else {
- $your_language = sprintf($lng_name . ' ~> ' . $link .
- ' <span style="font-size: 07pt;">( available downloads: ' .
- $epub_link . ', ' . $pdf_link . ')</span><br/><br/>',
- $lng, $lng, $lng);
- }
- } else {
- $other_languages_present = TRUE;
- if (is_null($epub_link) or is_null($pdf_link)) {
- $others .= sprintf($lng_name . ' ~> ' . $link . '<br/>', $lng, $lng_name);
- } else {
- $others .= sprintf($lng_name . ' ~> ' . $link .
- ' <span style="font-size: 07pt;">( ' . $epub_link .
- ', ' . $pdf_link . ')</span><br/>', $lng, $lng, $lng);
- }
- }
- }
- if ($your_language_present) {
- $text_your_language = _t('<span style="font-weight:bold">Documentation in your language:</span>') . '<br/>';
- if ($other_languages_present) {
- $text_others = _t('<span style="font-weight:bold">There are also:</span>') . '<br/>';
- }
- } else {
- $text_your_language = _t('Please help <a href="../community/">us</a> translate it in your language.') . '<br/>';
- }
- echo $text_your_language . $your_language . $text_others . $others;
-}
+require 'doc.php';
+
?><!DOCTYPE html>
<html lang="<?php echo $locale; ?>" dir="ltr">
@@ -83,7 +33,6 @@ function doc_list($languages, $link, $epub_link = null, $pdf_link = null)
<div style="float: left; margin: 2em;">
<h4><?php _e('Installer')?></h4>
<p style="margin-left: 2em;"><?php
- $mga4_installer = array('ca','cs','de','el','en','eo','es','et','fr','id','nl','pl','pt_br','ro','ru','sv','tr','uk');
doc_list($mga4_installer, '<a href="//doc.mageia.org/installer/4/%s/content/index.html">HTML</a>',
'<a href="//doc.mageia.org/installer/4/%s/content/index.html">EPUB</a>',
'<a href="//doc.mageia.org/installer/4/%s/content/index.html">PDF</a>');
@@ -92,7 +41,6 @@ function doc_list($languages, $link, $epub_link = null, $pdf_link = null)
<div style="float: right; margin: 2em;">
<h4><?php _e('Control Center')?></h4>
<p style="margin-left: 2em;"><?php
- $mga4_control_center = array('de','en','et','fr','id','nl','ru','tr','uk');
doc_list($mga4_control_center, '<a href="//doc.mageia.org/mcc/4/%s/content/index.html">HTML</a>',
'<a href="//doc.mageia.org/mcc/4/%s/content/index.html">EPUB</a>',
'<a href="//doc.mageia.org/mcc/4/%s/content/index.html">PDF</a>');
@@ -103,14 +51,12 @@ function doc_list($languages, $link, $epub_link = null, $pdf_link = null)
<div style="float: left; margin: 2em;">
<h4><?php _e('Installer')?></h4>
<p style="margin-left: 2em;"><?php
- $mga3_installer = array('de','el','en','es','et','fr','nl','pt_br','ru','uk');
doc_list($mga3_installer, '<a href="//doc.mageia.org/installer/3/%s/content/index.html">HTML</a>');
?></p>
</div>
<div style="float: right; margin: 2em;">
<h4><?php _e('Control Center')?></h4>
<p style="margin-left: 2em;"><?php
- $mga3_control_center = array('en','et','fr');
doc_list($mga3_control_center, '<a href="//doc.mageia.org/mcc/3/%s/content/index.html">HTML</a>');
?></p>
</div>