$i = strpos($po, 'Project-Id-Version:'); if ($i !== false) { $j = strpos($po, '\\n', $i); if ($j !== false) { $pversion = strtolower(substr($po, $i + 19, $j - $i - 19)); $vers = explode('.', trim(str_replace('zenphoto', '', $pversion))); while (count($vers) < 3) { $vers[] = 0; } $version = (int) $vers[0] . '.' . (int) $vers[1] . '.' . (int) $vers[2]; } } if (is_null(getOption('disallow_' . $dirname)) && $version < $zpversion) { setOptionDefault('disallow_' . $dirname, 1); } if (setupLocale($dirname)) { purgeOption('unsupported_' . $dirname); } else { setOption('unsupported_' . $dirname, 1); } } } //The following should be done LAST so it catches anything done above //set plugin default options by instantiating the options interface $plugins = getPluginFiles('*.php'); ?> <p> <?php $plugins = array_keys($plugins); natcasesort($plugins); echo gettext('Plugin setup:') . '<br />';
function setupLanguageSelector() { global $xsrftoken; $languages = generateLanguageList(); if (isset($_REQUEST['locale'])) { $locale = sanitize($_REQUEST['locale']); if (getOption('locale') != $locale || getOption('unsupported_' . $locale)) { ?> <div class="errorbox"> <h2> <?php printf(gettext('<em>%s</em> is not available.'), html_encode($languages[$locale])); ?> <?php printf(gettext('The locale %s is not supported on your server.'), html_encode($locale)); ?> <br /> <?php echo gettext('See the <a href="http://www.zenphoto.org/news/troubleshooting-zenphoto#24">troubleshooting guide</a> on zenphoto.org for details.'); ?> </h2> </div> <?php } } ?> <ul class="sflags"> <?php $_languages = generateLanguageList(); krsort($_languages, SORT_LOCALE_STRING); $currentValue = getOption('locale'); foreach ($_languages as $text => $lang) { if (setupLocale($lang)) { ?> <li<?php if ($lang == $currentValue) { echo ' class="currentLanguage"'; } ?> > <?php if ($lang != $currentValue) { ?> <a href="javascript:launchScript('',['locale=<?php echo $lang; ?> ']);" > <?php } if (file_exists(SERVERPATH . '/' . ZENFOLDER . '/locale/' . $lang . '/flag.png')) { $flag = WEBPATH . '/' . ZENFOLDER . '/locale/' . $lang . '/flag.png'; } else { $flag = WEBPATH . '/' . ZENFOLDER . '/locale/missing_flag.png'; } ?> <img src="<?php echo $flag; ?> " alt="<?php echo $text; ?> " title="<?php echo $text; ?> " /> <?php if ($lang != $currentValue) { ?> </a> <?php } ?> </li> <?php } } ?> </ul> <?php }