From e61f06813908c2ea0e9b964382d267f16ebdbb15 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 19 Apr 2011 14:36:33 +0000 Subject: [PATCH] 2011-04-19 Miguel de Dios * godmode/setup/setup_visuals.php: change the text field fonts to select box. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++++ .../godmode/setup/setup_visuals.php | 23 ++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c57ec46ce7..ccc76563bc 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-04-19 Miguel de Dios + + * godmode/setup/setup_visuals.php: change the text field fonts to + select box. + 2011-04-19 Miguel de Dios * include/functions_graph.php, include/fgraph.php, diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index ac1bc22283..bdd98a63f6 100644 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -78,7 +78,12 @@ $table->data[9][1] = print_select ($iconsets, 'status_images_set', $config["stat $table->data[10][0] = __('Font path'); -$table->data[10][1] = print_input_text ('fontpath', $config["fontpath"], '', 50, 255, true); + +$fonts = load_fonts(); + +$table->data[10][1] = print_select($fonts, 'fontpath', $config["fontpath"], '', '', 0, true); + +//$table->data[10][1] = print_input_text ('fontpath', $config["fontpath"], '', 50, 255, true); $table->data[11][0] = __('Flash charts'); $table->data[11][1] = __('Yes').' '.print_radio_button ('flash_charts', 1, '', $config["flash_charts"], true).'  '; @@ -99,6 +104,22 @@ echo ''; ui_require_css_file ("color-picker"); ui_require_jquery_file ("colorpicker"); + +function load_fonts() { + global $config; + + $dir = scandir($config['homedir'] . '/include/fonts/'); + + $fonts = array(); + + foreach ($dir as $file) { + if (strstr($file, '.ttf') !== false) { + $fonts[$config['homedir'] . '/include/fonts/' . $file] = $file; + } + } + + return $fonts; +} ?>