From 00a93173c6eef88c81a885b8a74f69e10cd911ca Mon Sep 17 00:00:00 2001 From: cigamit Date: Sun, 8 Nov 2015 14:53:29 -0600 Subject: [PATCH] Allow Admin to Specify Default Image Options Including Image Format, Height and Width --- include/global_form.php | 6 +++--- include/global_settings.php | 42 ++++++++++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/include/global_form.php b/include/global_form.php index 75a984363..8f44a90cc 100644 --- a/include/global_form.php +++ b/include/global_form.php @@ -377,14 +377,14 @@ $struct_graph = array( 'friendly_name' => 'Image Format (--imgformat)', 'method' => 'drop_array', 'array' => $image_types, - 'default' => '1', + 'default' => read_config_option('default_image_format'), 'description' => 'The type of graph that is generated; PNG, GIF or SVG. The selection of graph image type is very RRDtool dependent.' ), 'height' => array( 'friendly_name' => 'Height (--height)', 'method' => 'textbox', 'max_length' => '50', - 'default' => '120', + 'default' => read_config_option('default_graph_height'), 'description' => 'The height (in pixels) that the graph is.', 'size' => '7' ), @@ -392,7 +392,7 @@ $struct_graph = array( 'friendly_name' => 'Width (--width)', 'method' => 'textbox', 'max_length' => '50', - 'default' => '500', + 'default' => read_config_option('default_graph_width'), 'description' => 'The width (in pixels) that the graph is.', 'size' => '7' ), diff --git a/include/global_settings.php b/include/global_settings.php index 20d678910..913ce7abb 100644 --- a/include/global_settings.php +++ b/include/global_settings.php @@ -341,6 +341,41 @@ $settings = array( 'collapsible' => 'true', 'method' => 'spacer', ), + 'reindex_method' => array( + 'friendly_name' => 'Default Reindex Method for Data Queries', + 'description' => 'The default Reindex Method to use for all Data Queries.', + 'method' => 'drop_array', + 'default' => '1', + 'array' => $reindex_types, + ), + 'default_image_format' => array( + 'friendly_name' => 'Default Graph Template Image Format', + 'description' => 'The default Image Format to be used for all new Graph Templates.', + 'method' => 'drop_array', + 'default' => '1', + 'array' => $image_types, + ), + 'default_graph_width' => array( + 'friendly_name' => 'Default Graph Template Width', + 'description' => 'The default Graph Width to be used for all new Graph Templates.', + 'method' => 'textbox', + 'default' => '150', + 'size' => '5', + 'max_length' => '5' + ), + 'default_graph_height' => array( + 'friendly_name' => 'Default Graph Template Height', + 'description' => 'The default Graph Width to be used for all new Graph Templates.', + 'method' => 'textbox', + 'default' => '500', + 'size' => '5', + 'max_length' => '5' + ), + 'other1_header' => array( + 'friendly_name' => 'Other Settings', + 'collapsible' => 'true', + 'method' => 'spacer', + ), 'graph_auth_method' => array( 'friendly_name' => 'Graph Permission Method', 'description' => 'There are two methods for determining a Users Graph Permissions. The first is "Permissive". Under the "Permissive" setting, a User only needs access to either the Graph, Device or Graph Template to gain access to the Graphs that apply to them. Under "Restrictive", the User must have access to the Graph, the Device, and the Graph Template to gain access to the Graph.', @@ -348,13 +383,6 @@ $settings = array( 'default' => '1', 'array' => array('1' => 'Permissive', '2' => 'Restrictive') ), - 'reindex_method' => array( - 'friendly_name' => 'Reindex Method for Data Queries', - 'description' => 'The default reindex method to use for all Data Queries.', - 'method' => 'drop_array', - 'default' => '1', - 'array' => $reindex_types, - ), 'grds_creation_method' => array( 'method' => 'drop_array', 'friendly_name' => 'Graph/Data Source Creation Method',