query('SELECT * FROM `Config` ORDER BY `Id` ASC'); if (!$result) { echo mysql_error(); } else { while ($row = dbFetchNext($result)) { $config[$row['Name']] = $row; if ( !($configCat = &$configCats[$row['Category']]) ) { $configCats[$row['Category']] = array(); } $configCats[$row['Category']][$row['Name']] = &$config[$row['Name']]; } } if ($tab == 'web') { $configCats[$tab]['ZM_WEB_HOMEVIEW']['Hint'] = [ 'console'=>translate('Console'), 'events'=>'Events', 'map' => 'Map', 'montage'=>'Montage', 'montagereview'=>'Montage Review', 'watch' => 'Watch', ]; } else if ($tab == 'system') { // $configCats[$tab]['ZM_LANG_DEFAULT']['Hint'] = join('|', getLanguages()); if (defined('ZM_FORCE_SKIN_DEFAULT')) $configCats[$tab]['ZM_SKIN_DEFAULT']['Hint'] = ZM_FORCE_SKIN_DEFAULT; else $configCats[$tab]['ZM_SKIN_DEFAULT']['Hint'] = join('|', array_map('basename', glob('skins/*',GLOB_ONLYDIR))); if (defined('ZM_FORCE_CSS_DEFAULT')) $configCats[$tab]['ZM_CSS_DEFAULT']['Hint'] = ZM_FORCE_CSS_DEFAULT; else $configCats[$tab]['ZM_CSS_DEFAULT']['Hint'] = join('|', array_map ( 'basename', glob('skins/'.ZM_SKIN_DEFAULT.'/css/*',GLOB_ONLYDIR) )); $configCats[$tab]['ZM_BANDWIDTH_DEFAULT']['Hint'] = $bandwidth_options; // create new multidim array for languages (code1|translation) $languagecodess=join('|', getLanguages()); $languagecodelist=explode('|',$languagecodess); $languageslist = array(); foreach ($languagecodelist as $language){ $languageslist[$language] = translate($language); } $configCats[$tab]['ZM_LANG_DEFAULT']['Hint'] = $languageslist; function timezone_list() { static $timezones = null; if ($timezones === null) { $timezones = []; $offsets = []; $now = new DateTime('now', new DateTimeZone('UTC')); foreach (DateTimeZone::listIdentifiers() as $timezone) { $now->setTimezone(new DateTimeZone($timezone)); $offsets[] = $offset = $now->getOffset(); $timezones[$timezone] = '(' . format_GMT_offset($offset) . ') ' . format_timezone_name($timezone); } array_multisort($offsets, $timezones); } return $timezones; } function format_GMT_offset($offset) { $hours = intval($offset / 3600); $minutes = abs(intval($offset % 3600 / 60)); return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : ''); } function format_timezone_name($name) { $name = str_replace('/', ', ', $name); $name = str_replace('_', ' ', $name); $name = str_replace('St ', 'St. ', $name); return $name; } $configCats[$tab]['ZM_TIMEZONE']['Hint'] = array(''=> translate('TZUnset')) + timezone_list(); $configCats[$tab]['ZM_LOCALE_DEFAULT']['Hint'] = array(''=> translate('System Default')); $locales = ResourceBundle::getLocales(''); if ($locales) { foreach ( $locales as $locale) { $configCats[$tab]['ZM_LOCALE_DEFAULT']['Hint'][$locale] = $locale; } } } # end if tab == system ?>
'; } else { foreach ($configCats[$tab] as $name=>$value) { $shortName = preg_replace( '/^ZM_/', '', $name ); $optionPromptText = !empty($OLANG[$shortName])?$OLANG[$shortName]['Prompt']:$value['Prompt']; $optionCanEdit = $canEdit && !$value['System']; ?>
'.PHP_EOL; } else if (is_array($value['Hint'])) { $attributes = ['id'=>$name, 'class'=>'form-control-sm chosen']; if (!$optionCanEdit) $attributes['disabled']='disabled'; echo htmlSelect("newConfig[$name]", $value['Hint'], $value['Value'], $attributes); } else if (preg_match('/\|/', $value['Hint'])) { $options = explode('|', $value['Hint']); if (count($options) > 3) { $html_options = array(); foreach ($options as $option) { if (preg_match('/^([^=]+)=(.+)$/', $option, $matches)) { $html_options[$matches[2]] = $matches[1]; } else { $html_options[$option] = $option; } } $attributes = ['id'=>$name, 'class'=>'form-control-sm chosen']; if (!$optionCanEdit) $attributes['disabled']='disabled'; echo htmlSelect("newConfig[$name]", $html_options, $value['Value'], $attributes); } else { foreach ($options as $option) { if (preg_match('/^([^=]+)=(.+)$/', $option)) { $optionLabel = $matches[1]; $optionValue = $matches[2]; } else { $optionLabel = $optionValue = $option; } ?> 3 } else if ( $value['Type'] == 'text' ) { echo ''.PHP_EOL; } else if ( $value['Type'] == 'integer' ) { echo ''.PHP_EOL; } else if ( $value['Type'] == 'hexadecimal' ) { echo ''.PHP_EOL; } else if ( $value['Type'] == 'decimal' ) { echo ''.PHP_EOL; } else if ( $value['Type'] == 'password' ) { echo ''.PHP_EOL; echo 'visibility'; } else { echo ''.PHP_EOL; } if ($value['Value'] != constant($name)) { echo '

Note: This value has been overriden via configuration files in '.ZM_CONFIG. ' or ' . ZM_CONFIG_SUBDIR.'.
The overriden value is: '.constant($name).'

'.PHP_EOL; } ?>