/**
 * prints a form for selecting a locale
 * The POST handling is by getUserLocale() called in functions.php
 *
 */
function printLanguageSelector($class = '')
{
    global $_zp_languages;
    if (isset($_POST['dynamic-locale'])) {
        $locale = sanitize($_POST['dynamic-locale'], 0);
        if (getOption('locale') != $locale) {
            echo '<div class="errorbox">';
            echo '<h2>' . sprintf(gettext('<em>%s</em> is not available.'), $_zp_languages[$locale]) . ' ' . sprintf(gettext('The locale %s is not supported on your server.') . '<br />' . gettext('See the troubleshooting guide on zenphoto.org for details.'), $locale);
            echo '</h2>';
            echo '</div>';
        }
    }
    if (!empty($class)) {
        $class = " class='{$class}'";
    }
    echo "\n<div{$class}>\n";
    echo '<form action="#" method="post">' . "\n";
    echo '<input type="hidden" name="oldlocale" value="' . getOption('locale') . '" />';
    echo '<select id="dynamic-locale" name="dynamic-locale" onchange="this.form.submit()">' . "\n";
    generateLanguageOptionList(false);
    echo "</select>\n";
    echo "</form>\n";
    echo "</div>\n";
}
            echo htmlspecialchars(getOption('mod_rewrite_image_suffix'));
            ?>
" /></td>
			<td><?php 
            echo gettext("If <em>mod_rewrite</em> is checked above, zenphoto will appended\tthis to the end (helps search engines). Examples: <em>.html, .php,\t/view</em>, etc.");
            ?>
</td>
		</tr>
		<tr>
			<td><?php 
            echo gettext("Language:");
            ?>
</td>
			<td><select id="locale" name="locale">
				<?php 
            generateLanguageOptionList(true);
            ?>
			</select>
			<input type="checkbox" name="multi_lingual" value="1"	<?php 
            echo checked('1', getOption('multi_lingual'));
            ?>
 />
			<?php 
            echo gettext('Multi-lingual');
            ?>
			</td>
			<td>
			<?php 
            echo gettext("The language to display text in. (Set to <em>HTTP Accept Language</em> to use the language preference specified by the viewer's browser.)");
            echo ' ' . gettext("Set <em>Multi-lingual</em> to enable multiple languages for database fields.");
            echo ' ' . gettext("<strong>Note:</strong> if you have created multi-language strings, uncheck this option, then save anything, you will lose your strings.");
Example #3
0
<div class="error"><?php 
    echo gettext("The zp-config.php file does not exist. You should run setup.php to check your configuration and create this file.");
    ?>
</div>

<?php 
}
?>
</div>
<?php 
if ($noxlate > 0 && !isset($_GET['create']) && !isset($_GET['update'])) {
    echo "\n<div>\n";
    echo '<form action="#' . '" method="post">' . "\n";
    echo '<input type="hidden" name="oldlocale" value="' . getOption('locale') . '" />';
    if ($debug) {
        echo '<input type="hidden" name="debug" />';
    }
    echo gettext("Select a language:") . ' ';
    echo '<select id="dynamic-locale" name="dynamic-locale" onchange="this.form.submit()">' . "\n";
    generateLanguageOptionList(false);
    echo "</select>\n";
    echo "</form>\n";
    echo "</div>\n";
}
printAdminFooter();
?>
</div>
</body>
</html>