mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
dynamic toggle in wizard input printForm
This commit is contained in:
parent
3c87efe113
commit
0d3817d64d
@ -442,25 +442,31 @@ function quickShellSettings()
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => __('Gotty user').ui_print_help_tip(
|
'toggle' => true,
|
||||||
__('Optional, set a user to access gotty service'),
|
'toggle_name' => 'Advanced',
|
||||||
true
|
'block_content' => [
|
||||||
),
|
[
|
||||||
'arguments' => [
|
'label' => __('Gotty user').ui_print_help_tip(
|
||||||
'type' => 'text',
|
__('Optional, set a user to access gotty service'),
|
||||||
'name' => 'gotty_user',
|
true
|
||||||
'value' => $config['gotty_user'],
|
),
|
||||||
],
|
'arguments' => [
|
||||||
],
|
'type' => 'text',
|
||||||
[
|
'name' => 'gotty_user',
|
||||||
'label' => __('Gotty password').ui_print_help_tip(
|
'value' => $config['gotty_user'],
|
||||||
__('Optional, set a password to access gotty service'),
|
],
|
||||||
true
|
],
|
||||||
),
|
[
|
||||||
'arguments' => [
|
'label' => __('Gotty password').ui_print_help_tip(
|
||||||
'type' => 'password',
|
__('Optional, set a password to access gotty service'),
|
||||||
'name' => 'gotty_pass',
|
true
|
||||||
'value' => io_output_password($config['gotty_pass']),
|
),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'password',
|
||||||
|
'name' => 'gotty_pass',
|
||||||
|
'value' => io_output_password($config['gotty_pass']),
|
||||||
|
],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -458,6 +458,7 @@ class Wizard
|
|||||||
|
|
||||||
if (is_array($input['block_content']) === true) {
|
if (is_array($input['block_content']) === true) {
|
||||||
$direct = (bool) $input['direct'];
|
$direct = (bool) $input['direct'];
|
||||||
|
$toggle = (bool) $input['toggle'];
|
||||||
|
|
||||||
// Print independent block of inputs.
|
// Print independent block of inputs.
|
||||||
$output .= '<li id="li-'.$input['block_id'].'" class="'.$class.'">';
|
$output .= '<li id="li-'.$input['block_id'].'" class="'.$class.'">';
|
||||||
@ -471,14 +472,37 @@ class Wizard
|
|||||||
$output .= '<ul class="wizard '.$input['block_class'].'">';
|
$output .= '<ul class="wizard '.$input['block_class'].'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($input['block_content'] as $input) {
|
$html = '';
|
||||||
$output .= $this->printBlock(
|
|
||||||
$input,
|
foreach ($input['block_content'] as $in) {
|
||||||
|
$html .= $this->printBlock(
|
||||||
|
$in,
|
||||||
$return,
|
$return,
|
||||||
(bool) $direct
|
(bool) $direct
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($toggle === true) {
|
||||||
|
$output .= ui_print_toggle(
|
||||||
|
[
|
||||||
|
'name' => (isset($input['toggle_name']) ? $input['toggle_name'] : 'toggle_'.uniqid()),
|
||||||
|
'content' => $html,
|
||||||
|
'title' => $input['toggle_title'],
|
||||||
|
'id' => $input['toggle_id'],
|
||||||
|
'hidden_default' => $input['toggle_hidden_default'],
|
||||||
|
'return' => (isset($input['toggle_return']) ? $input['toggle_return'] : true),
|
||||||
|
'toggle_class' => $input['toggle_toggle_class'],
|
||||||
|
'main_class' => $input['toggle_main_class'],
|
||||||
|
'container_class' => $input['toggle_container_class'],
|
||||||
|
'img_a' => $input['toggle_img_a'],
|
||||||
|
'img_b' => $input['toggle_img_b'],
|
||||||
|
'clean' => (isset($input['toggle_clean']) ? $input['toggle_clean'] : true),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$output .= $html;
|
||||||
|
}
|
||||||
|
|
||||||
// Close block.
|
// Close block.
|
||||||
if (!$direct) {
|
if (!$direct) {
|
||||||
$output .= '</ul>';
|
$output .= '</ul>';
|
||||||
|
@ -3667,6 +3667,7 @@ function ui_print_event_priority(
|
|||||||
* @param string $main_class Main object class.
|
* @param string $main_class Main object class.
|
||||||
* @param string $img_a Image (closed).
|
* @param string $img_a Image (closed).
|
||||||
* @param string $img_b Image (opened).
|
* @param string $img_b Image (opened).
|
||||||
|
* @param string $clean Do not encapsulate with class boxes, clean print.
|
||||||
*
|
*
|
||||||
* @return string HTML.
|
* @return string HTML.
|
||||||
*/
|
*/
|
||||||
@ -3681,7 +3682,8 @@ function ui_toggle(
|
|||||||
$container_class='white-box-content',
|
$container_class='white-box-content',
|
||||||
$main_class='box-shadow white_table_graph',
|
$main_class='box-shadow white_table_graph',
|
||||||
$img_a='images/arrow_down_green.png',
|
$img_a='images/arrow_down_green.png',
|
||||||
$img_b='images/arrow_right_green.png'
|
$img_b='images/arrow_right_green.png',
|
||||||
|
$clean=false
|
||||||
) {
|
) {
|
||||||
// Generate unique Id.
|
// Generate unique Id.
|
||||||
$uniqid = uniqid('');
|
$uniqid = uniqid('');
|
||||||
@ -3697,9 +3699,17 @@ function ui_toggle(
|
|||||||
$original = $img_a;
|
$original = $img_a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$header_class = '';
|
||||||
|
if ($clean === false) {
|
||||||
|
$header_class = 'white_table_graph_header';
|
||||||
|
} else {
|
||||||
|
$main_class = '';
|
||||||
|
$container_class = 'white-box-content-clean';
|
||||||
|
}
|
||||||
|
|
||||||
// Link to toggle.
|
// Link to toggle.
|
||||||
$output = '<div class="'.$main_class.'" id="'.$id.'">';
|
$output = '<div class="'.$main_class.'" id="'.$id.'">';
|
||||||
$output .= '<div class="white_table_graph_header" style="cursor: pointer;" id="tgl_ctrl_'.$uniqid.'">'.html_print_image(
|
$output .= '<div class="'.$header_class.'" style="cursor: pointer;" id="tgl_ctrl_'.$uniqid.'">'.html_print_image(
|
||||||
$original,
|
$original,
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -3767,7 +3777,8 @@ function ui_print_toggle($data)
|
|||||||
(isset($data['container_class']) === true) ? $data['container_class'] : 'white-box-content',
|
(isset($data['container_class']) === true) ? $data['container_class'] : 'white-box-content',
|
||||||
(isset($data['main_class']) === true) ? $data['main_class'] : 'box-shadow white_table_graph',
|
(isset($data['main_class']) === true) ? $data['main_class'] : 'box-shadow white_table_graph',
|
||||||
(isset($data['img_a']) === true) ? $data['img_a'] : 'images/arrow_down_green.png',
|
(isset($data['img_a']) === true) ? $data['img_a'] : 'images/arrow_down_green.png',
|
||||||
(isset($data['img_b']) === true) ? $data['img_b'] : 'images/arrow_right_green.png'
|
(isset($data['img_b']) === true) ? $data['img_b'] : 'images/arrow_right_green.png',
|
||||||
|
(isset($data['clean']) === true) ? $data['clean'] : false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5700,6 +5700,10 @@ div#status_pie {
|
|||||||
padding: 1em;
|
padding: 1em;
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
}
|
}
|
||||||
|
.white-box-content-clean {
|
||||||
|
padding-left: 2em;
|
||||||
|
padding-top: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
.white_table_graph_content {
|
.white_table_graph_content {
|
||||||
border: 1px solid #e2e2e2;
|
border: 1px solid #e2e2e2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user