// Title // // '; //r($widget['widget_config']); //r(isset($widget['widget_config']['legend']) && $widget['widget_config']['legend'] === 'no'); $modal_args = [ 'id' => 'modal-edit_widget_' . $widget['widget_id'], 'title' => 'Configure Widget', //'hide' => TRUE, //'fade' => TRUE, //'role' => 'dialog', //'class' => 'modal-md', ]; $form = [ 'form_only' => TRUE, // Do not add modal open/close divs (it's generated outside) 'type' => 'horizontal', 'id' => 'edit_widget_' . $widget['widget_id'], 'userlevel' => 7, // Minimum user level for display form 'modal_args' => $modal_args, // !!! This generate modal specific form //'help' => 'This will completely delete the rule and all associations and history.', 'class' => '', // Clean default box class! //'url' => generate_url([ 'page' => 'syslog_rules' ]), 'onsubmit' => "return false", ]; $form['fieldset']['body'] = ['class' => 'modal-body']; // Required this class for modal body! $form['fieldset']['footer'] = ['class' => 'modal-footer']; // Required this class for modal footer! $form['row'][1]['widget-config-title'] = [ 'type' => 'text', 'fieldset' => 'body', 'name' => 'Title', 'placeholder' => 'Graph Title', 'class' => 'input-xlarge', 'attribs' => [ 'data-id' => $widget['widget_id'], 'data-field' => 'title', 'data-type' => 'text' ], 'value' => $widget['widget_config']['title'] ]; $form['row'][2]['widget-config-legend'] = [ 'type' => 'checkbox', 'fieldset' => 'body', 'name' => 'Show Legend', //'placeholder' => 'Yes, please delete this rule.', //'onchange' => "javascript: toggleAttrib('disabled', 'delete_button_".$la['la_id']."'); showDiv(!this.checked, 'warning_".$la['la_id']."_div');", 'attribs' => [ 'data-id' => $widget['widget_id'], 'data-field' => 'legend', 'data-type' => 'checkbox' ], 'value' => safe_empty($widget['widget_config']['legend']) ? 'yes' : $widget['widget_config']['legend'] //'legend' ]; $form['row'][8]['close'] = [ 'type' => 'submit', 'fieldset' => 'footer', 'div_class' => '', // Clean default form-action class! 'name' => 'Close', 'icon' => '', 'attribs' => [ 'data-dismiss' => 'modal', 'aria-hidden' => 'true' ] ]; echo generate_form_modal($form); unset($form); /* echo '
'; */ } else { print_message('To add a graph to this widget, navigate to the required graph and use the "Add To Dashboard" function on the graph page.'); echo '

Step 1. Locate Graph and click for Graph Browser.

'; echo ''; echo '

Step 2. Select Add to Dashboard in Graph Browser.

'; echo ''; } break; default: r($widget['widget_config']); } // EOF