Dynamic content for downloads

This commit is contained in:
Silvan Calarco 2015-01-09 13:45:16 +01:00
parent baf87075d3
commit 10d4c864a2
6 changed files with 130 additions and 2884 deletions

View File

@ -27,26 +27,46 @@ function openmamba_download_link($milestone, $medium, $currarch, $ext, $mlword,
$displaymilestone = "$milestone"; $displaymilestone = "$milestone";
} }
$currreleasetag=$releaseTag[$medium.'-'.$milestone.'-'.$lang.'-'.$currarch]; $currreleasetag=$releaseTag[$medium.'-'.$milestone.'-'.$lang.'-'.$currarch];
$ret = '';
if ("$currreleasetag" != "") { if ("$currreleasetag" != "") {
echo "<table style='border:0;margin:0;margin-bottom:5px;'><tr><td style='vertical-align:middle;padding:4px;border:0;margin:0;width:20px;align:center;'><img src=/wp-content/themes/openmamba/download.png /></td>"; $ret .= "<table style='border:0;margin:0;margin-bottom:5px;'><tr><td style='vertical-align:middle;padding:4px;border:0;margin:0;width:20px;align:center;'><img src=/wp-content/themes/openmamba/download.png /></td>";
echo "<td style='border:0;margin:0;padding:4px;'><h5 style='margin:1px;'><a href=\"/media/$milestone/$medium/$lang/openmamba-$medium-$lang-$currreleasetag.$currarch$ext\">"; $ret .= "<td style='border:0;margin:0;padding:4px;'><h5 style='margin:1px;'><a href=\"/media/$milestone/$medium/$lang/openmamba-$medium-$lang-$currreleasetag.$currarch$ext\">";
echo "openmamba $displaymilestone $medium "; $ret .= "openmamba $displaymilestone $medium ";
echo _e('for','responsive')." $currarch ($mlword)</a>&nbsp;</h5>"; $ret .= __('for','responsive')." $currarch ($mlword)</a>&nbsp;</h5>";
echo "<i>"; $ret .= "<i>";
echo _e('File size:','responsive').' '.$sizeMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch].'B; '; $ret .= __('File size:','responsive').' '.$sizeMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch].'B; ';
echo _e('Date','responsive').': '.substr($builddateMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch], $ret .= __('Date','responsive').': '.substr($builddateMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch],
0, strpos($builddateMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch], ' ')); 0, strpos($builddateMedium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch], ' '));
echo "; Md5: " . $md5Medium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch]; $ret .= "; Md5: " . $md5Medium[$medium.'-'.$currreleasetag.'-'.$lang.'-'.$currarch];
echo "</i></td></tr></table>"; $ret .= "</i></td></tr></table>";
} else { } else {
echo "<table style='border:0;margin:0;margin-bottom:5px;'><tr><td style='vertical-align:middle;padding:4px;border:0;margin:0;width:20px;align:center;'><img src=/wp-content/themes/openmamba/download.png /></td>"; $ret .= "<table style='border:0;margin:0;margin-bottom:5px;'><tr><td style='vertical-align:middle;padding:4px;border:0;margin:0;width:20px;align:center;'><img src=/wp-content/themes/openmamba/download.png /></td>";
echo "<td style='border:0;margin:0;padding:4px;'><h5 style='margin:1px;'>"; $ret .= "<td style='border:0;margin:0;padding:4px;'><h5 style='margin:1px;'>";
echo "openmamba $displaymilestone $medium "; $ret .= "openmamba $displaymilestone $medium ";
echo _e('for','responsive')." $currarch ($mlword)&nbsp;</h5>"; $ret .= __('for','responsive')." $currarch ($mlword)&nbsp;</h5>";
echo "<i><font color=red>"; $ret .= "<i><font color=red>";
echo _e('Sorry, download is temporary unavailable. If the problem persists please report the problem.','responsive'); $ret .= __('Sorry, download is temporary unavailable. If the problem persists please report the problem.','responsive');
echo "</font></i></td></tr></table>"; $ret .= "</font></i></td></tr></table>";
} }
return $ret;
}
function openmamba_infofile($mediaprefix, $milestone, $fallbackmilestone, $medium, $outputlang, $filename) {
if (file_exists("$mediaprefix/$milestone/$medium/info/$filename.$outputlang.html.inc")) {
$script_file = "$mediaprefix/$milestone/$medium/info/$filename.$outputlang.html.inc";
} else if (file_exists("$mediaprefix/$fallbackmilestone/$medium/info/$filename.$outputlang.html.inc")) {
$script_file = "$mediaprefix/$fallbackmilestone/$medium/info/$filename.$outputlang.html.inc";
}
$ret = '';
if ($script_file) {
$file = fopen($script_file, "r");
while (!feof($file)) {
$b=fread($file,1024);
$ret .= $b;
}
fclose($file);
}
return $ret;
} }
function openmamba_download_func( $atts ) { function openmamba_download_func( $atts ) {
@ -74,40 +94,54 @@ function openmamba_download_func( $atts ) {
$outputlang = get_bloginfo("language"); $outputlang = get_bloginfo("language");
if ("$outputlang" != "it") { if ("$outputlang" != "it") {
$outputlang = "en"; $outputlang = "en";
$forword = "for";
$mlword = "multilanguage"; $mlword = "multilanguage";
} else { } else {
$forword = "per";
$mlword = "multilingue"; $mlword = "multilingue";
} }
print "<h3>openmamba $medium $displaymilestone</h3>"; $ret = "<h3>openmamba $medium $displaymilestone</h3>";
if (file_exists("$mediaprefix/$milestone/$medium/info/description.$outputlang.html.inc")) { $ret .= do_shortcode(
$script_file = "$mediaprefix/$milestone/$medium/info/description.$outputlang.html.inc"; openmamba_infofile($mediaprefix,$milestone,$fallbackmilestone,$medium,$outputlang,"description"));
} else if (file_exists("$mediaprefix/$fallbackmilestone/$medium/info/description.$outputlang.html.inc")) {
$script_file = "$mediaprefix/$fallbackmilestone/$medium/info/description.$outputlang.html.inc"; $ret .= "<br><br>";
} if ($a['multilang']) {
if ($script_file) { reset($archname);
$file = fopen($script_file, "r"); while (list(, $currarch) = each($archname)) {
while (!feof($file)) { if (strpos(";".$a['archs'].";",$currarch) == false) continue;
$b=fread($file,1024); $ret .= openmamba_download_link($milestone,$medium,$currarch,$ext,$mlword,"en");
print $b;
} }
fclose($file); } else {
} reset($archname);
reset($archname); $langs = array('it' => 'italiano','en' => 'english','es' => 'español');
while (list(, $currarch) = each($archname)) { while (list(, $currarch) = each($archname)) {
if (strpos(";".$a['archs'].";",$currarch) == false) continue; if (strpos(";".$a['archs'].";",$currarch) == false) continue;
if ($a['multilang']) { $ret .= openmamba_download_link($milestone,$medium,$currarch,$ext,$langs[$outputlang],$outputlang);
openmamba_download_link($milestone,$medium,$currarch,$ext,$mlword,"en");
} else {
openmamba_download_link($milestone,$medium,$currarch,$ext,"italiano","it");
openmamba_download_link($milestone,$medium,$currarch,$ext,"english","en");
openmamba_download_link($milestone,$medium,$currarch,$ext,"español","es");
} }
foreach ($langs as $l => $lang) {
if ($l == $outputlang) continue;
reset($archname);
while (list(, $currarch) = each($archname)) {
if (strpos(";".$a['archs'].";",$currarch) == false) continue;
$out .= openmamba_download_link($milestone,$medium,$currarch,$ext,$lang,$l);
}
}
$ret .= do_shortcode("[expand title=\"". __("More languages...",responsive) . "\"]". $out ."[/expand]");
} }
echo "<hr>";
return; $ret .= do_shortcode("&nbsp;&nbsp;&nbsp;[expand title=\"".__("Features",responsive)."\"]".
openmamba_infofile($mediaprefix,$milestone,$fallbackmilestone,$medium,$outputlang,"features").
"[/expand]");
$ret .= do_shortcode("&nbsp;&nbsp;&nbsp;[expand title=\"".__("Requirements",responsive)."\"]".
openmamba_infofile($mediaprefix,$milestone,$fallbackmilestone,$medium,$outputlang,"requirements").
"[/expand]");
$ret .= do_shortcode("&nbsp;&nbsp;&nbsp;[expand title=\"".__("Preparation",responsive)."\"]".
openmamba_infofile($mediaprefix,$milestone,$fallbackmilestone,$medium,$outputlang,"howto").
"[/expand]");
$ret .= "<hr>";
return $ret;
} }
add_shortcode('openmamba_download', 'openmamba_download_func'); add_shortcode('openmamba_download', 'openmamba_download_func');

Binary file not shown.

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Responsive Theme\n" "Project-Id-Version: Responsive Theme\n"
"Report-Msgid-Bugs-To: bugs@openmamba.org\n" "Report-Msgid-Bugs-To: bugs@openmamba.org\n"
"POT-Creation-Date: 2014-12-29 14:26+0100\n" "POT-Creation-Date: 2015-01-04 16:16+0100\n"
"PO-Revision-Date: 2014-12-08 16:25+0100\n" "PO-Revision-Date: 2014-12-08 16:25+0100\n"
"Last-Translator: Silvan Calarco <silvan.calarco@mambasoft.it>\n" "Last-Translator: Silvan Calarco <silvan.calarco@mambasoft.it>\n"
"Language-Team: Italian, Italy\n" "Language-Team: Italian, Italy\n"
@ -24,24 +24,41 @@ msgstr "Leggi di più &#8250;"
msgid "Pages:" msgid "Pages:"
msgstr "Pagine:" msgstr "Pagine:"
#: ../functions.php:34 ../functions.php:45 #: ../functions.php:35 ../functions.php:46
msgid "for" msgid "for"
msgstr "per" msgstr "per"
#: ../functions.php:36 #: ../functions.php:37
msgid "File size:" msgid "File size:"
msgstr "Dimensione file:" msgstr "Dimensione file:"
#: ../functions.php:37 #: ../functions.php:38
msgid "Date" msgid "Date"
msgstr "Data" msgstr "Data"
#: ../functions.php:47 #: ../functions.php:48
msgid "" msgid ""
"Sorry, download is temporary unavailable. If the problem persists please " "Sorry, download is temporary unavailable. If the problem persists please "
"report the problem." "report the problem."
msgstr "Il download non è temporaneamente disponibile. Se il problema persiste " msgstr ""
"ti ringraziamo se ci puoi segnalare il problema." "Il download non è temporaneamente disponibile. Se il problema persiste ti "
"ringraziamo se ci puoi segnalare il problema."
#: ../functions.php:106
msgid "Features"
msgstr "Caratteristiche"
#: ../functions.php:110
msgid "Requirements"
msgstr "Requisiti"
#: ../functions.php:114
msgid "Preparation"
msgstr "Preparazione"
#: ../functions.php:140
msgid "More languages..."
msgstr "Altre lingue..."
#: ../header-webbuild.php:87 #: ../header-webbuild.php:87
msgid "&darr; Skip to Main Content" msgid "&darr; Skip to Main Content"
@ -59,3 +76,7 @@ msgstr "Registrati"
#, php-format #, php-format
msgid "Howdy, %1$s" msgid "Howdy, %1$s"
msgstr "Salve, %1$s" msgstr "Salve, %1$s"
#: ../sidebar-top.php:40
msgid "Logout"
msgstr "Esci"

3
languages/update-po.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
xgettext --default-domain=responsive --language=PHP --keyword=__ --keyword=_e --sort-by-file --copyright-holder="Silvan Calarco" --package-name=openmamba --package-version=1.0 --msgid-bugs-address="bugs@openmamba.org" ../*.php
msgmerge it.po responsive.po -o it.po

View File

@ -183,3 +183,26 @@ a.mytoplink:active {
outline: 0; outline: 0;
text-decoration: none; text-decoration: none;
} }
/* Disable focus rectangle in Collape-O-Matic */
.collapseomatic:focus {
outline: 0;
}
.collapseomatic_content {
background-color: #CDE1CA;
margin-bottom: 0px;
}
.collapseomatic_content ul {
margin-bottom: 0px;
}
.collapseomatic_content p {
margin-bottom: 0px;
}
.collapseomatic_content div {
margin-bottom: 0px;
}

File diff suppressed because it is too large Load Diff