aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Hiebel <leuhmanu@mageia.org>2014-05-02 21:16:35 +0000
committerManuel Hiebel <leuhmanu@mageia.org>2014-05-02 21:16:35 +0000
commitee958bc534fe7064c9f2191ca2f9a82eed82c93b (patch)
tree4e74e4aa3f09a3ea306dd96ce8fdb16c9499414a
parente4727d9e3b624c4358a488bcc7f28de355edb88d (diff)
downloadwww-ee958bc534fe7064c9f2191ca2f9a82eed82c93b.tar
www-ee958bc534fe7064c9f2191ca2f9a82eed82c93b.tar.gz
www-ee958bc534fe7064c9f2191ca2f9a82eed82c93b.tar.bz2
www-ee958bc534fe7064c9f2191ca2f9a82eed82c93b.tar.xz
www-ee958bc534fe7064c9f2191ca2f9a82eed82c93b.zip
add center style for nav
-rw-r--r--_nav/css/center.css62
-rw-r--r--_nav/css/index.php14
-rw-r--r--_nav/html/index.php1
-rw-r--r--_nav/lib.php8
4 files changed, 82 insertions, 3 deletions
diff --git a/_nav/css/center.css b/_nav/css/center.css
new file mode 100644
index 000000000..987d493fb
--- /dev/null
+++ b/_nav/css/center.css
@@ -0,0 +1,62 @@
+
+/*! mageia.org nav CSS CENTER PART */
+
+#lang_form { position:relative;left:0;top:0 }
+
+
+#mgnav {
+ background: #ffffff;
+ padding-bottom: 0px;
+}
+
+#nav {
+ margin: auto;
+}
+
+#nav a.mageia {
+ width: 112px;
+ background: #fff url(//nav.mageia.org/css/mageia-logo-nav-3.png) no-repeat 5px 12px;
+ color: transparent;
+ text-shadow: none;
+}
+
+.about #mgnav .about,
+.downloads #mgnav .downloads,
+.community #mgnav .community,
+.blog #mgnav .community,
+.section-index #mgnav .community, /*forum*/
+.mediawiki #mgnav .wiki,
+.support #mgnav .support,
+.contribute #mgnav .contribute,
+.donate #mgnav .donate,
+.bugs-mageia-org #mgnav .contribute,
+.contrib #mgnav .contrib,
+.you #mgnav .you,
+.contact #mgnav .contact,
+.doc #mgnav .doc
+{
+ background: #2383C2;
+ background: -webkit-linear-gradient(top, #3494D3 0%, #2383C2 50%);
+ background: -moz-linear-gradient(top, #3494D3 0%, #2383C2 50%);
+ background: -o-linear-gradient(top, #3494D3 0%, #2383C2 50%);
+ background: linear-gradient(top, #3494D3 0%, #2383C2 50%);
+}
+
+
+#mgnavtitle, /* deprecated */
+#mgnavt /* preferred */
+{
+ text-align: center;
+}
+
+
+/* allows to have a title + contextual sub menu */
+header#mgnavt { text-align: center; }
+#mgnavt ul { font-size: 12px; margin: 0 0 0 2em; padding: 0; display: inline; }
+#mgnavt ul li { display: inline; margin: 0 0.3em; padding: 0; }
+
+/*from all.css*/
+#mgnavsub ul {
+ margin: auto;
+ padding: 0px 0px 0px 0px;
+}
diff --git a/_nav/css/index.php b/_nav/css/index.php
index 66604b202..a7aafd6e2 100644
--- a/_nav/css/index.php
+++ b/_nav/css/index.php
@@ -19,4 +19,16 @@
header('Content-Type: text/css;charset=utf-8');
header(sprintf('Expires: %s', gmdate('r', strtotime('+1 day'))));
-echo str_replace('nav.mageia.org', $_SERVER['HTTP_HOST'], file_get_contents('all.css'));
+
+$style = isset($_GET['s']) ? trim($_GET['s']) : null;
+
+ if ( $style == 'Center' ){
+ echo str_replace('nav.mageia.org', $_SERVER['HTTP_HOST'], file_get_contents('source.css'));
+ echo str_replace('nav.mageia.org', $_SERVER['HTTP_HOST'], file_get_contents('center.css'));
+ echo "/*if lang_from missing, add some space*/ #nav li:last-child { padding-right:143px }";
+ }
+ else {
+ echo str_replace('nav.mageia.org', $_SERVER['HTTP_HOST'], file_get_contents('source.css'));
+ }
+
+
diff --git a/_nav/html/index.php b/_nav/html/index.php
index 8c8ac690c..0bde089bb 100644
--- a/_nav/html/index.php
+++ b/_nav/html/index.php
@@ -44,6 +44,7 @@ $wrap = isset($_GET['w']) ? true : false;
require 'conf.php';
include '../lib.php';
+require_once('../langs/php-mo.php');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET');
diff --git a/_nav/lib.php b/_nav/lib.php
index 1aa791998..76a55712a 100644
--- a/_nav/lib.php
+++ b/_nav/lib.php
@@ -155,7 +155,7 @@ class l10n
if (file_exists($po_file)) {
$dictionary = phpmo_parse_po_file($po_file);
-
+
foreach ($dictionary as $key => $value) {
if ($key != '') {
if ($value['msgstr'][0] != '') {
@@ -279,7 +279,11 @@ function _mgnav_html($wrap = false, $lang = 'en', $inject = null, $vhost = 'www.
*/
function _mgnav_style()
{
- return '<style>' . file_get_contents(__DIR__ . '/css/source.css') . '</style>';
+ if ( defined('ALIGNMENT') && constant('ALIGNMENT') == 'Center' ){
+ return '<style>' . file_get_contents(__DIR__ . '/css/source.css') . '</style><style>' . file_get_contents(__DIR__ . '/css/center.css') . '</style>';
+ } else {
+ return '<style>' . file_get_contents(__DIR__ . '/css/source.css') . '</style>';
+ }
}
/**