# HG changeset patch # User Matti Hamalainen # Date 1409146599 -10800 # Node ID b9ebc24f27fd13e44d462d2cee343b2fd8958de4 # Parent 0f451151b9f1e76d0502a9d55e324cff36d90150 Move some code around a bit, to make mobile mode integration easier. diff -r 0f451151b9f1 -r b9ebc24f27fd index.php --- a/index.php Wed Aug 27 16:32:37 2014 +0300 +++ b/index.php Wed Aug 27 16:36:39 2014 +0300 @@ -359,9 +359,14 @@ -// Check given parameters +// +// Main code begins +// +// Check given parameters: // Language must be the first setting to be validated, // so that the translation support works properly. +// + if (isset($_GET["lang"])) { $tmp = strtolower($_GET["lang"]); @@ -457,14 +462,11 @@ } -// -// Main code starts -// - // Read classfile if (($classes = lukReadClassFile($classIDFile, &$timestamp)) === false) stError(stQM("classListNotFound")); + // Read class data $dataFile = $cachePath.$luokka.".data"; if (!file_exists($dataFile)) @@ -482,6 +484,8 @@ // Set some variables $pageTitle = $haveData ? $luokka." / ".join("; ", $classInfo["info"]) : $luokka; + +// Create references to mobile device (Apple touch) icons $extra = ""; foreach (array(57 => FALSE, 76 => TRUE, 114 => TRUE, 120 => TRUE, 152 => TRUE) as $iconSize => $addSize) { @@ -490,8 +494,44 @@ "href=\"img/icon-".$iconSize."-precomposed.png\" />\n"; } + +// Start printing the page cmPrintPageHeader($pageTitle, $extra); + +// Info box +if (!$mobileMode) +{ + echo + "
\n". + "
OAMK Lukkari v".$pageVersion."
\n". + "
".cmQM("Style").": "; + + foreach ($pageCSSAlts as $name => $id) + { + echo + "".$name.""; + } + + echo + "
\n". + "
"; + + foreach ($pageLanguages as $id) + { + echo + "".$id.""; + } + + echo "
\n"; +} + +echo "
\n"; + + +// Additional controls echo "
\n". " \n". @@ -556,35 +596,6 @@ //"
".cmQM("beta", $pageVersion)."
\n". "\n"; -if (!$mobileMode) -{ - echo - "
\n". - "
OAMK Lukkari v".$pageVersion."
\n". - "
".cmQM("Style").": "; - - foreach ($pageCSSAlts as $name => $id) - { - echo - "".$name.""; - } - - echo - "
\n". - "
"; - - foreach ($pageLanguages as $id) - { - echo - "".$id.""; - } - - echo "
\n"; -} - -echo "
\n"; cmPrintPageFooter();