Skip to content

Commit ae1ff39

Browse files
committed
made it easier to specify which reference translations are publicly accessible and which aren't
1 parent d184ccb commit ae1ff39

3 files changed

Lines changed: 29 additions & 19 deletions

File tree

config.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
<?
2-
3-
ini_set('memory_limit', -1);
4-
/*** define paths to includes ***/define('BASEDIR', dirname(__FILE__).'/');define('TEMPLATEDIR', BASEDIR.'templates/');define('CONTENTDIR', BASEDIR.'content/');define('GENERATEDIR', BASEDIR.'generate/');define('DOMITDIR', GENERATEDIR.'domit/');define('GENLIBDIR', GENERATEDIR.'lib/');define('REFERENCEDIR', BASEDIR.'reference/');
5-
define('DISTDIR', BASEDIR.'distribution/');require_once(DOMITDIR.'xml_domit_include.php');require_once(GENLIBDIR.'xhtml.class.php');require_once(GENLIBDIR.'functions.inc.php');require_once(TEMPLATEDIR.'template.php');// Name, Encoding, Alphabetize, URL$domain = "http://localhost/reference/";$LANGUAGES = array( 'en' => array('English', 'utf-8', true, $domain)/*, 'zh' => array('Chinese Traditional', 'big5', false, $domain."zh/"), 'zh-cn' => array('Chinese Simplified', 'GB2312', false, $domain."zh-cn/"), 'fr' => array('French', 'utf-8', true, $domain."fr/"), 'id' => array('Indonesian', 'utf-8', false, $domain."id/"), 'it' => array('Italian', 'utf-8', true, $domain."it/"), 'jp' => array('Japanese', 'Shift_JIS', false, 'http://stage.itp.tsoa.nyu.edu/~tk403/proce55ing_reference_jp/'), 'kn' => array('Korean', 'utf-8', false, 'http://www.nabi.or.kr/processing/'), 'es' => array('Spanish', 'utf-8', true, $domain."es/"), 'tr' => array('Turkish', 'ISO-8859-9', true, $domain."tr/"), 'he' => array('Hebrew', 'Windows-1255', false, ''), 'ru' => array('Russian', 'ISO-8859-5', false, ''), 'pl' => array('Polish', 'ISO-8859-2', false, '')*/ );
6-
7-
// for reference index formatting
8-
$break_before = array('Shape', 'Color');?>
1+
<?ini_set('memory_limit', -1);/*** define paths to includes ***/define('BASEDIR', dirname(__FILE__).'/');define('TEMPLATEDIR', BASEDIR.'templates/');define('CONTENTDIR', BASEDIR.'content/');define('GENERATEDIR', BASEDIR.'generate/');define('DOMITDIR', GENERATEDIR.'domit/');define('GENLIBDIR', GENERATEDIR.'lib/');define('REFERENCEDIR', BASEDIR.'reference/');define('DISTDIR', BASEDIR.'distribution/');require_once(DOMITDIR.'xml_domit_include.php');require_once(GENLIBDIR.'xhtml.class.php');require_once(GENLIBDIR.'functions.inc.php');require_once(TEMPLATEDIR.'template.php');// Name, Encoding, Alphabetize, URL$domain = "http://processing.org/reference/";$LANGUAGES = array( 'en' => array('English', 'utf-8', true, $domain), 'zh' => array('Chinese Traditional', 'big5', false, $domain."zh/"), 'zh-cn' => array('Chinese Simplified', 'GB2312', false, $domain."zh-cn/"), 'fr' => array('French', 'utf-8', true, $domain."fr/"), 'id' => array('Indonesian', 'utf-8', false, $domain."id/"), 'it' => array('Italian', 'utf-8', true, $domain."it/"), 'jp' => array('Japanese', 'Shift_JIS', false, 'http://stage.itp.tsoa.nyu.edu/~tk403/proce55ing_reference_jp/'), 'kn' => array('Korean', 'utf-8', false, 'http://www.nabi.or.kr/processing/'), 'es' => array('Spanish', 'utf-8', true, $domain."es/"), 'tr' => array('Turkish', 'ISO-8859-9', true, $domain."tr/"), 'he' => array('Hebrew', 'Windows-1255', false, ''), 'ru' => array('Russian', 'ISO-8859-5', false, ''), 'pl' => array('Polish', 'ISO-8859-2', false, '') );// Langauges with finished references available to the public$FINISHED = array('en'); // for reference index formatting$break_before = array('Shape', 'Color');?>

generate/index.php

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,17 @@ function showloading()
4949
<ul>
5050
<li>Generate <a href="#" onclick="remote_link('cover.php');return false;">Cover</a></li>
5151
<li>Generate Reference:<br />
52-
<a href="#" onclick="remote_link('reference.php', 'lang=en');return false;">English</a>,
53-
<a href="#" onclick="remote_link('reference.php', 'lang=tr'); return false;">Turkish</a>,
54-
<a href="#" onclick="remote_link('reference.php', 'lang=zh'); return false;">Chinese Traditional</a>
52+
<form action="#" method="post" onsubmit="new Ajax.Updater('status', 'reference.php',
53+
{ asynchronous: true, parameters: Form.serialize(this), onLoading: showloading }); return false;">
54+
<select name="lang">
55+
<?
56+
foreach ($LANGUAGES as $code => $array) {
57+
echo "\t\t\t\t<option value=\"$code\">$array[0]</option>\n";
58+
}
59+
?>
60+
</select>
61+
<input type="submit" value="Generate" />
62+
</form>
5563
</li>
5664
<li>Generate One Reference file:
5765
<form action="#" method="post" onsubmit="new Ajax.Updater('status', 'reference_one.php',
@@ -68,9 +76,17 @@ function showloading()
6876
</form>
6977
</li>
7078
<li>Generate Reference Indices:<br />
71-
<a href="#" onclick="remote_link('reference_index.php', 'lang=en'); return false;">English</a>,
72-
<a href="#" onclick="remote_link('reference_index.php', 'lang=tr'); return false;">Turkish</a>,
73-
<a href="#" onclick="remote_link('reference_index.php', 'lang=zh'); return false;">Chinese Traditional</a>
79+
<form action="#" method="post" onsubmit="new Ajax.Updater('status', 'reference_index.php',
80+
{ asynchronous: true, parameters: Form.serialize(this), onLoading: showloading }); return false;">
81+
<select name="lang">
82+
<?
83+
foreach ($LANGUAGES as $code => $array) {
84+
echo "\t\t\t\t<option value=\"$code\">$array[0]</option>\n";
85+
}
86+
?>
87+
</select>
88+
<input type="submit" value="Generate" />
89+
</form>
7490
</li>
7591
<li>Copy <a href="#" onclick="remote_link('reference_media.php'); return false;">Reference Media files to public directory</a></li>
7692
<li>Generate Library References:<br />

templates/template.nav.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,14 @@ function reference_nav($current = '')
126126
function language_nav($current)
127127
{
128128
global $LANGUAGES;
129-
if (count($LANGUAGES) < 2) { return ''; }
129+
global $FINISHED;
130+
if (count($FINISHED) < 2) { return ''; }
130131

131132
$html = "\t".'Language: <select name="nav" size="1" class="refnav" onChange="javascript:gogo(this)">'."\n";
132-
foreach ($LANGUAGES as $short => $array) {
133-
if ($array[3] != '' ) {
134-
$sel = ($current == $short) ? ' selected="selected"' : '';
135-
$html .= "\t\t<option value=\"$array[3]\"$sel>$array[0]</option>\n";
133+
foreach ($FINISHED as $code) {
134+
if ($LANGUAGES[$code][3] != '' ) {
135+
$sel = ($current == $code) ? ' selected="selected"' : '';
136+
$html .= "\t\t<option value=\"{$LANGUAGES[$code][3]}\"$sel>{$LANGUAGES[$code][0]}</option>\n";
136137
}
137138
}
138139
$html .= "\t</select>\n";

0 commit comments

Comments
 (0)