Private GIT

Skip to content
Snippets Groups Projects
Commit 58c50066 authored by Sylvestre Ho's avatar Sylvestre Ho
Browse files

refs #5538; + engine xml file

parent 1d77232e
No related branches found
No related tags found
No related merge requests found
<?php
/*
* Copyright 2005-2014 MERETHIS
* Centreon is developped by : Julien Mathis and Romain Le Merlus under
* GPL Licence 2.0.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation ; either version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see <http://www.gnu.org/licenses>.
*
* Linking this program statically or dynamically with other modules is making a
* combined work based on this program. Thus, the terms and conditions of the GNU
* General Public License cover the whole combination.
*
* As a special exception, the copyright holders of this program give MERETHIS
* permission to link this program with independent modules to produce an executable,
* regardless of the license terms of these independent modules, and to copy and
* distribute the resulting executable under terms of MERETHIS choice, provided that
* MERETHIS also meet, for each linked independent module, the terms and conditions
* of the license of that module. An independent module is a module which is not
* derived from this program. If you modify this program, you may extend this
* exception to your version of the program, but you are not obliged to do so. If you
* do not wish to do so, delete this exception statement from your version.
*
* For more information : contact@centreon.com
*
*/
namespace Centreon\Internal\Form\Custom;
/**
* Html Checkobox element
* Checkbox with no label
*
* @author Sylvestre Ho <sho@merethis.com>
* @package Centreon
* @subpackage Core
*/
class Singlecheckbox extends Customobject
{
/**
* Return the HTML ouput of the checkbox field
*
* @param array $element
* @return array
*/
public static function renderHtmlInput(array $element)
{
(isset($element['html']) ? $value = $element['html'] : $value = '');
if (!isset($element['id']) || (isset($element['id']) && empty($element['id']))) {
$element['id'] = $element['name'];
}
$htmlSelected = '';
if ($value) {
$htmlSelected = 'checked=checked';
}
$inputHtml = '<label class="label-controller" for="'. $element['id'] . $i . '">&nbsp;' .
'<input id="' . $element['id'] . $i . '" ' .
'type="checkbox" name="' . $element['name'] . '" ' .
'value=1 ' . $htmlSelected . ' />' . $key .
'</label>&nbsp;&nbsp;';
return array(
'html' => $inputHtml,
'js' => ''
);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<forms>
<form name="engine_form">
<route>/engine/update</route>
<redirect>0</redirect>
<redirect_route></redirect_route>
<section name="Engine">
<block name="General information">
<field name="accept_passive_host_checks" label="Accept passive host checks" default_value="1" advanced="1" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="accept_passive_service_checks" label="Accept passive service checks" default_value="1" advanced="1" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="check_host_freshness" label="Check host freshness" default_value="0" advanced="1" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="check_service_freshness" label="Check service freshness" default_value="1" advanced="1" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="debug_file" label="Debug file" default_value="" advanced="1" type="text" parent_field="" mandatory="0">
<help></help>
</field>
<field name="debug_level" label="Debug level" default_value="0" advanced="1" type="text" parent_field="" mandatory="0">
<help></help>
</field>
<field name="debug_verbosity" label="Debug file" default_value="" advanced="1" type="radio" parent_field="" mandatory="0">
<attributes>
<choices>
<Basic>0</Basic>
<Detailed>1</Detailed>
<HighlyDetailed>2</HighlyDetailed>
</choices>
</attributes>
<help></help>
</field>
<field name="enable_event_handlers" label="Enable event handlers" default_value="1" advanced="0" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="enable_failure_prediction" label="Enable failure prediction" default_value="1" advanced="0" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="enable_flap_detection" label="Enable flap detection" default_value="0" advanced="0" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="enable_notifications" label="Enable notifications" default_value="1" advanced="0" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="enable_predictive_host_dependency_checks" label="Enable predictive host dependency checks" default_value="1" advanced="0" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="enable_predictive_service_dependency_checks" label="Enable predictive service dependency checks" default_value="1" advanced="0" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="event_broker_options" label="Event broker options" default_value="-1" advanced="0" type="text" parent_field="" mandatory="0">
<help></help>
</field>
<field name="event_handler_timeout" label="Event handler timeout" default_value="30" advanced="0" type="text" parent_field="" mandatory="0">
<help></help>
</field>
<field name="execute_host_checks" label="Execute host checks" default_value="1" advanced="0" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="execute_service_checks" label="Execute service checks" default_value="1" advanced="0" type="singlecheckbox" parent_field="" mandatory="0">
<help></help>
</field>
<field name="global_host_event_handler" label="Global host event handler" default_value="" advanced="1" type="select" parent_field="" mandatory="0">
<attributes>
<object_type>object</object_type>
<defaultValuesRoute>/configuration/command/formlist</defaultValuesRoute>
<listValuesRoute>/engine/[i:id]/globalHostEventHandler</listValuesRoute>
<multiple>false</multiple>
</attributes>
<help></help>
</field>
<field name="global_service_event_handler" label="Global service event handler" default_value="" advanced="1" type="select" parent_field="" mandatory="0">
<attributes>
<object_type>object</object_type>
<defaultValuesRoute>/configuration/command/formlist</defaultValuesRoute>
<listValuesRoute>/engine/[i:id]/globalServiceEventHandler</listValuesRoute>
<multiple>false</multiple>
</attributes>
<help></help>
</field>
<field name="high_host_flap_threshold" label="High host flap threshold" default_value="30" advanced="0" type="text" parent_field="" mandatory="0">
<help></help>
</field>
<field name="high_service_flap_threshold" label="High service flap threshold" default_value="30" advanced="0" type="text" parent_field="" mandatory="0">
<help></help>
</field>
<field name="host_check_timeout" label="Host check timeout" default_value="30" advanced="0" type="text" parent_field="" mandatory="0">
<help></help>
</field>
<field name="host_freshness_check_interval" label="Host check timeout" default_value="30" advanced="0" type="text" parent_field="" mandatory="0">
<help></help>
</field>
</block>
</section>
</form>
</forms>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment