Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1040 → Rev 1041

/trunk/TODO
110,7 → 110,6
- Let the JavaScript value "oidplus_menu_width" being modified by a design plugin and/or the database config.
A plugin can already do this by using htmlHeaderUpdate() and creating an inline JavaScript to modify the global variable "oidplus_menu_width"
- At a lot of forms, if you press "enter", the "form" will not be submitted (e.g. "create ra" plugin), cannot reproduce?
- Default language selection: Either always en-US, or automatical selection depending on browser language, or depending on admin setting (e.g. german companies offer a german repository by default)?
- system log plugin: Only show 100 events and let the user switch pages. To avoid that you load a page with 10000+ log entries!
- Alpine Linux SVN update: I get the error "svn: warning: W000013: Can't open file '/root/.subversion/servers': Permission denied", although "whoami" is "apache"! (Maybe because the initial checkout was done by root?!)
- AutoUpdate via cron?
/trunk/doc/config_values.txt
302,6 → 302,14
hashes are bound to that pepper. If you change the pepper,
then ALL passwords of RAs become INVALID!
 
OIDplus::baseConfig()->setValue('DEFAULT_LANGUAGE', 'enus');
Default language of the system. This is the language
a new visitor will see if no "lang=" parameter is used
and no cookie is set.
Must be a valid language in the plugins directory.
Currently available:
enus = English USA (default)
dede = German Germany
 
----------------------------------------------------
(4) LDAP FIELDS (see document ldap_installation.txt)
/trunk/includes/classes/OIDplus.class.php
34,8 → 34,6
 
protected static $html = true;
 
/*public*/ const DEFAULT_LANGUAGE = 'enus'; // the language of the source code
 
/*public*/ const PATH_RELATIVE = 1; // e.g. "../"
/*public*/ const PATH_ABSOLUTE = 2; // e.g. "http://www.example.com/oidplus/"
/*public*/ const PATH_ABSOLUTE_CANONICAL = 3; // e.g. "http://www.example.org/oidplus/" (if baseconfig CANONICAL_SYSTEM_URL is set)
1648,6 → 1646,23
return $langs;
}
 
public static function getDefaultLang() {
static $thrownOnce = false; // avoid endless loop inside OIDplusConfigInitializationException
 
$lang = self::$baseConfig->getValue('DEFAULT_LANGUAGE', 'enus');
 
if (!in_array($lang,self::getAvailableLangs())) {
if (!$thrownOnce) {
$thrownOnce = true;
throw new OIDplusConfigInitializationException(_L('DEFAULT_LANGUAGE points to an invalid language plugin (Consider setting to "enus" = "English USA").'));
} else {
return 'enus';
}
}
 
return $lang;
}
 
public static function getCurrentLang() {
if (isset($_GET['lang'])) {
$lang = $_GET['lang'];
1656,7 → 1671,7
} else if (isset($_COOKIE['LANGUAGE'])) {
$lang = $_COOKIE['LANGUAGE'];
} else {
$lang = self::DEFAULT_LANGUAGE;
$lang = self::getDefaultLang();
}
$lang = substr(preg_replace('@[^a-z]@ismU', '', $lang),0,4); // sanitize
return $lang;
/trunk/includes/classes/OIDplusGui.class.php
72,7 → 72,7
foreach (OIDplus::getAllPluginManifests('language') as $pluginManifest) {
$flag = $pluginManifest->getLanguageFlag();
$code = $pluginManifest->getLanguageCode();
if ($code != OIDplus::DEFAULT_LANGUAGE) $non_default_languages++;
if ($code != OIDplus::getDefaultLang()) $non_default_languages++;
if ($code == OIDplus::getCurrentLang()) {
$class = 'lng_flag';
} else {
/trunk/includes/classes/OIDplusMenuUtils.class.php
39,7 → 39,7
if ($static_node_id == $x['id']) echo '<b>';
if (isset($x['indent'])) echo str_repeat('&nbsp;', $x['indent']*5);
$cur_lang = OIDplus::getCurrentLang();
if ($cur_lang != OIDplus::DEFAULT_LANGUAGE) {
if ($cur_lang != OIDplus::getDefaultLang()) {
echo '<a href="?lang='.$cur_lang.'&amp;goto='.urlencode($x['id']).'">';
} else {
echo '<a href="?goto='.urlencode($x['id']).'">';
/trunk/oidplus.min.js.php
57,7 → 57,7
 
# ---
 
$files[] = 'var DEFAULT_LANGUAGE = '.json_encode(OIDplus::DEFAULT_LANGUAGE).';';
$files[] = 'var DEFAULT_LANGUAGE = '.json_encode(OIDplus::getDefaultLang()).';';
 
OIDplus::registerAllPlugins('language', 'OIDplusLanguagePlugin', null);
$translation_array = OIDplus::getTranslationArray();
/trunk/plugins/viathinksoft/publicPages/500_resources/show_icon.php
44,7 → 44,7
}
 
if (!isset($_REQUEST['lang'])) {
$lang = 'enus';
$lang = '';
} else {
$lang = $_REQUEST['lang'];
}
62,7 → 62,7
 
if (($mode == 'leaf_url_icon16') || ($mode == 'leaf_doc_icon16') || ($mode == 'folder_icon16')) {
 
if (file_exists($icon_candidate = getIconCandidate($file, 'png', 'tree', $lang))) {
if (!empty($lang) && file_exists($icon_candidate = getIconCandidate($file, 'png', 'tree', $lang))) {
httpOutWithETag(file_get_contents($icon_candidate), 'image/png', basename($icon_candidate));
} else if (file_exists($icon_candidate = getIconCandidate($file, 'png', 'tree', ''))) {
httpOutWithETag(file_get_contents($icon_candidate), 'image/png', basename($icon_candidate));
74,7 → 74,7
 
} else if (($mode == 'leaf_url_icon') || ($mode == 'leaf_doc_icon') || ($mode == 'folder_icon')) {
 
if (file_exists($icon_candidate = getIconCandidate($file, 'png', 'big', $lang))) {
if (!empty($lang) && file_exists($icon_candidate = getIconCandidate($file, 'png', 'big', $lang))) {
httpOutWithETag(file_get_contents($icon_candidate), 'image/png', basename($icon_candidate));
} else if (file_exists($icon_candidate = getIconCandidate($file, 'png', 'big', ''))) {
httpOutWithETag(file_get_contents($icon_candidate), 'image/png', basename($icon_candidate));
/trunk/setup/setup.min.js.php
31,7 → 31,7
$files[] = __DIR__ . '/../vendor/emn178/js-sha3/src/sha3.js'; // https://github.com/emn178/js-sha3
$files[] = __DIR__ . '/../vendor/components/jquery/jquery.js';
 
$files[] = 'var DEFAULT_LANGUAGE = '.json_encode(OIDplus::DEFAULT_LANGUAGE).';';
$files[] = 'var DEFAULT_LANGUAGE = '.json_encode(OIDplus::getDefaultLang()).';';
 
OIDplus::registerAllPlugins('language', 'OIDplusLanguagePlugin', null);
$translation_array = OIDplus::getTranslationArray();
/trunk/sitemap.php
27,7 → 27,7
 
$non_default_languages = array();
foreach (OIDplus::getAvailableLangs() as $code) {
if ($code == OIDplus::DEFAULT_LANGUAGE) continue;
if ($code == OIDplus::getDefaultLang()) continue;
$non_default_languages[] = $code;
}