mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
Admin tools
This commit is contained in:
parent
d0c8794361
commit
2a97b26cfe
@ -21,13 +21,23 @@ function extension_db_status()
|
|||||||
$db_name = get_parameter('db_name', '');
|
$db_name = get_parameter('db_name', '');
|
||||||
$db_status_execute = (bool) get_parameter('db_status_execute', false);
|
$db_status_execute = (bool) get_parameter('db_status_execute', false);
|
||||||
|
|
||||||
ui_print_page_header(
|
ui_print_standard_header(
|
||||||
__('DB Schema check'),
|
__('DB Schema check'),
|
||||||
'images/extensions.png',
|
'images/extensions.png',
|
||||||
false,
|
false,
|
||||||
'db_status_tab',
|
'db_status_tab',
|
||||||
true,
|
true,
|
||||||
''
|
[],
|
||||||
|
[
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => __('Admin tools'),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => __('Run test'),
|
||||||
|
],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!is_user_admin($config['id_user'])) {
|
if (!is_user_admin($config['id_user'])) {
|
||||||
@ -46,38 +56,86 @@ function extension_db_status()
|
|||||||
__('At the moment the checks is for MySQL/MariaDB.')
|
__('At the moment the checks is for MySQL/MariaDB.')
|
||||||
);
|
);
|
||||||
|
|
||||||
echo "<form method='post'>";
|
echo "<form method='post' class='max_floating_element_size'>";
|
||||||
|
|
||||||
echo '<fieldset>';
|
echo '<fieldset>';
|
||||||
echo '<legend>'.__('DB settings').'</legend>';
|
echo '<legend>'.__('DB settings').'</legend>';
|
||||||
$table = new stdClass();
|
$table = new stdClass();
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
$row = [];
|
$row = [];
|
||||||
$row[] = __('DB User with privileges');
|
$row[] = html_print_label_input_block(
|
||||||
$row[] = html_print_input_text('db_user', $db_user, '', 50, 255, true);
|
__('DB User with privileges'),
|
||||||
$row[] = __('DB Password for this user');
|
html_print_input_text(
|
||||||
$row[] = html_print_input_password('db_password', $db_password, '', 50, 255, true);
|
'db_user',
|
||||||
|
$db_user,
|
||||||
|
'',
|
||||||
|
50,
|
||||||
|
255,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'w100p mrgn_top_10px'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$row[] = html_print_label_input_block(
|
||||||
|
__('DB Password for this user'),
|
||||||
|
html_print_input_password(
|
||||||
|
'db_password',
|
||||||
|
$db_password,
|
||||||
|
'',
|
||||||
|
50,
|
||||||
|
255,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'w100p mrgn_top_10px'
|
||||||
|
)
|
||||||
|
);
|
||||||
$table->data[] = $row;
|
$table->data[] = $row;
|
||||||
$row = [];
|
$row = [];
|
||||||
$row[] = __('DB Hostname');
|
$row[] = html_print_label_input_block(
|
||||||
$row[] = html_print_input_text('db_host', $db_host, '', 50, 255, true);
|
__('DB Hostname'),
|
||||||
$row[] = __('DB Name (temporal for testing)');
|
html_print_input_text(
|
||||||
$row[] = html_print_input_text('db_name', $db_name, '', 50, 255, true);
|
'db_host',
|
||||||
|
$db_host,
|
||||||
|
'',
|
||||||
|
50,
|
||||||
|
255,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'w100p mrgn_top_10px'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$row[] = html_print_label_input_block(
|
||||||
|
__('DB Name (temporal for testing)'),
|
||||||
|
html_print_input_text(
|
||||||
|
'db_name',
|
||||||
|
$db_name,
|
||||||
|
'',
|
||||||
|
50,
|
||||||
|
255,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'w100p mrgn_top_10px'
|
||||||
|
)
|
||||||
|
);
|
||||||
$table->data[] = $row;
|
$table->data[] = $row;
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
echo '</fieldset>';
|
echo '</fieldset>';
|
||||||
|
|
||||||
html_print_div(
|
html_print_action_buttons(
|
||||||
[
|
html_print_submit_button(
|
||||||
'class' => 'action-buttons',
|
__('Execute Test'),
|
||||||
'content' => html_print_submit_button(
|
'submit',
|
||||||
__('Execute Test'),
|
false,
|
||||||
'submit',
|
[ 'icon' => 'cog' ],
|
||||||
false,
|
true
|
||||||
[ 'icon' => 'cog' ],
|
)
|
||||||
true
|
|
||||||
),
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
html_print_input_hidden('db_status_execute', 1);
|
html_print_input_hidden('db_status_execute', 1);
|
||||||
|
@ -132,47 +132,37 @@ function dbmgr_extension_main()
|
|||||||
echo $warning_message;
|
echo $warning_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui_print_warning_message(
|
||||||
|
__(
|
||||||
|
"This is an advanced extension to interface with %s database directly from WEB console
|
||||||
|
using native SQL sentences. Please note that <b>you can damage</b> your %s installation
|
||||||
|
if you don't know </b>exactly</b> what are you are doing,
|
||||||
|
this means that you can severily damage your setup using this extension.
|
||||||
|
This extension is intended to be used <b>only by experienced users</b>
|
||||||
|
with a depth knowledge of %s internals.",
|
||||||
|
get_product_name(),
|
||||||
|
get_product_name(),
|
||||||
|
get_product_name()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
echo "<form method='post' action=''>";
|
echo "<form method='post' action=''>";
|
||||||
|
|
||||||
$table = new stdClass();
|
$table = new stdClass();
|
||||||
$table->id = 'db_interface';
|
$table->id = 'db_interface';
|
||||||
$table->class = 'databox';
|
$table->class = 'databox no_border filter-table-adv';
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
$table->head = [];
|
|
||||||
$table->colspan = [];
|
$table->colspan = [];
|
||||||
$table->rowstyle = [];
|
$table->style[0] = 'width: 30%;';
|
||||||
|
$table->style[1] = 'width: 70%;';
|
||||||
|
|
||||||
$table->colspan[0][0] = 2;
|
|
||||||
$table->colspan[1][0] = 2;
|
$table->colspan[1][0] = 2;
|
||||||
$table->rowspan[2][0] = 3;
|
|
||||||
|
|
||||||
$table->rowclass[0] = 'notify';
|
$data[0][0] = "<b>Some samples of usage:</b> <blockquote><em>SHOW STATUS;<br />DESCRIBE tagente<br />SELECT * FROM tserver<br />UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'</em></blockquote>";
|
||||||
$table->rowclass[3] = 'pdd_5px';
|
$data[0][0] = html_print_label_input_block(
|
||||||
$table->rowclass[3] = 'flex-content-right';
|
__('Some samples of usage:'),
|
||||||
$table->rowclass[4] = 'flex-content-right';
|
"<blockquote><em>SHOW STATUS;<br />DESCRIBE tagente<br />SELECT * FROM tserver<br />UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'</em></blockquote>"
|
||||||
|
|
||||||
$data[0][0] = __(
|
|
||||||
"This is an advanced extension to interface with %s database directly from WEB console
|
|
||||||
using native SQL sentences. Please note that <b>you can damage</b> your %s installation
|
|
||||||
if you don't know </b>exactly</b> what are you are doing,
|
|
||||||
this means that you can severily damage your setup using this extension.
|
|
||||||
This extension is intended to be used <b>only by experienced users</b>
|
|
||||||
with a depth knowledge of %s internals.",
|
|
||||||
get_product_name(),
|
|
||||||
get_product_name(),
|
|
||||||
get_product_name()
|
|
||||||
);
|
|
||||||
|
|
||||||
$data[1][0] = "Some samples of usage: <blockquote><em>SHOW STATUS;<br />DESCRIBE tagente<br />SELECT * FROM tserver<br />UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'</em></blockquote>";
|
|
||||||
|
|
||||||
$data[2][0] = html_print_textarea(
|
|
||||||
'sql',
|
|
||||||
5,
|
|
||||||
50,
|
|
||||||
html_entity_decode($sql, ENT_QUOTES),
|
|
||||||
'',
|
|
||||||
true
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
@ -191,35 +181,57 @@ function dbmgr_extension_main()
|
|||||||
$servers = [];
|
$servers = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[3][2] = html_print_input(
|
$data[0][1] = html_print_label_input_block(
|
||||||
[
|
__('Select query target'),
|
||||||
'name' => 'node_id',
|
html_print_select(
|
||||||
'type' => 'select',
|
$servers,
|
||||||
'fields' => $servers,
|
'node_id',
|
||||||
'selected' => $node_id,
|
$node_id,
|
||||||
'nothing' => __('This metaconsole'),
|
'',
|
||||||
'nothing_value' => -1,
|
__('This metaconsole'),
|
||||||
'return' => true,
|
-1,
|
||||||
'label' => _('Select query target'),
|
true,
|
||||||
]
|
false,
|
||||||
|
false,
|
||||||
|
'w40p',
|
||||||
|
false,
|
||||||
|
'width: 40%;'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[4][2] = html_print_div(
|
$data[1][0] = html_print_textarea(
|
||||||
[
|
'sql',
|
||||||
'class' => 'action-buttons',
|
3,
|
||||||
'content' => html_print_submit_button(
|
50,
|
||||||
__('Execute SQL'),
|
html_entity_decode($sql, ENT_QUOTES),
|
||||||
'',
|
'placeholder="'.__('Type your query here...').'"',
|
||||||
false,
|
true,
|
||||||
[ 'icon' => 'cog' ],
|
'w100p'
|
||||||
true
|
);
|
||||||
),
|
|
||||||
]
|
$execute_button = html_print_submit_button(
|
||||||
|
__('Execute SQL'),
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
[ 'icon' => 'cog' ],
|
||||||
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data = $data;
|
$table->data = $data;
|
||||||
html_print_table($table);
|
// html_print_table($table);
|
||||||
|
html_print_action_buttons($execute_button);
|
||||||
|
ui_toggle(
|
||||||
|
html_print_table($table, true),
|
||||||
|
'<span class="subsection_header_title">'.__('SQL query').'</span>',
|
||||||
|
__('SQL query'),
|
||||||
|
'query',
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'white-box-content no_border',
|
||||||
|
'box-flat white_table_graph fixed_filter_bar'
|
||||||
|
);
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
||||||
// Processing SQL Code.
|
// Processing SQL Code.
|
||||||
@ -227,10 +239,6 @@ function dbmgr_extension_main()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<br />';
|
|
||||||
echo '<hr />';
|
|
||||||
echo '<br />';
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (\is_metaconsole() === true && $node_id !== -1) {
|
if (\is_metaconsole() === true && $node_id !== -1) {
|
||||||
$node = new Node($node_id);
|
$node = new Node($node_id);
|
||||||
|
@ -24,7 +24,6 @@ table.dbmanager th {
|
|||||||
}
|
}
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
min-height: 50px;
|
width: 100% !important;
|
||||||
height: 50px;
|
max-width: 100% !important;
|
||||||
width: 95%;
|
|
||||||
}
|
}
|
||||||
|
@ -25,13 +25,28 @@ function extension_uploader_extensions()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_print_page_header(
|
// Header.
|
||||||
__('Uploader extension'),
|
ui_print_standard_header(
|
||||||
|
__('Extensions'),
|
||||||
'images/extensions.png',
|
'images/extensions.png',
|
||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
true,
|
true,
|
||||||
''
|
[],
|
||||||
|
[
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => __('Admin tools'),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => __('Extension manager'),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => __('Uploader extension'),
|
||||||
|
],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$upload = (bool) get_parameter('upload', 0);
|
$upload = (bool) get_parameter('upload', 0);
|
||||||
@ -77,20 +92,52 @@ function extension_uploader_extensions()
|
|||||||
$table = new stdClass();
|
$table = new stdClass();
|
||||||
|
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->class = 'databox filters';
|
$table->class = 'databox filters filter-table-adv';
|
||||||
|
$table->size[0] = '20%';
|
||||||
|
$table->size[1] = '20%';
|
||||||
|
$table->size[2] = '60%';
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
$table->data[0][0] = __('Upload extension');
|
|
||||||
$table->data[0][1] = html_print_input_file('extension', true).ui_print_help_tip(__('Upload the extension as a zip file.'), true);
|
$table->data[0][0] = html_print_label_input_block(
|
||||||
|
__('Upload extension').ui_print_help_tip(__('Upload the extension as a zip file.'), true),
|
||||||
|
html_print_input_file(
|
||||||
|
'extension',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'required' => true,
|
||||||
|
'accept' => '.zip',
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if (enterprise_installed()) {
|
if (enterprise_installed()) {
|
||||||
$table->data[0][2] = __('Upload enterprise extension').' '.html_print_checkbox('upload_enterprise', 1, false, true);
|
$table->data[0][1] = html_print_label_input_block(
|
||||||
|
__('Upload enterprise extension'),
|
||||||
|
html_print_checkbox(
|
||||||
|
'upload_enterprise',
|
||||||
|
1,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$table->data[0][1] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$table->data[0][2] = '';
|
||||||
|
|
||||||
echo "<form method='post' enctype='multipart/form-data'>";
|
echo "<form method='post' enctype='multipart/form-data'>";
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
echo "<div class='right' style='width: ".$table->width."'>";
|
|
||||||
html_print_input_hidden('upload', 1);
|
html_print_input_hidden('upload', 1);
|
||||||
html_print_submit_button(__('Upload'), 'submit', false, 'class="sub add"');
|
html_print_action_buttons(
|
||||||
echo '</div>';
|
html_print_submit_button(
|
||||||
|
__('Upload'),
|
||||||
|
'submit',
|
||||||
|
false,
|
||||||
|
['icon' => 'wand'],
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,8 +24,29 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header
|
// Header.
|
||||||
ui_print_page_header(__('Extensions').' » '.__('Defined extensions'), 'images/extensions.png', false, '', true, '');
|
ui_print_standard_header(
|
||||||
|
__('Extensions'),
|
||||||
|
'images/extensions.png',
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
[],
|
||||||
|
[
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => __('Admin tools'),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => __('Extension manager'),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => __('Defined extensions'),
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
if (count($config['extensions']) == 0) {
|
if (count($config['extensions']) == 0) {
|
||||||
$extensions = extensions_get_extension_info();
|
$extensions = extensions_get_extension_info();
|
||||||
@ -132,7 +153,7 @@ if ($disabled != '') {
|
|||||||
$extensions = extensions_get_extension_info();
|
$extensions = extensions_get_extension_info();
|
||||||
|
|
||||||
$table = new StdClass;
|
$table = new StdClass;
|
||||||
$table->width = '98%';
|
$table->width = '100%';
|
||||||
|
|
||||||
$table->head = [];
|
$table->head = [];
|
||||||
$table->head[] = __('File');
|
$table->head[] = __('File');
|
||||||
@ -146,7 +167,7 @@ $table->head[] = __('Login Function');
|
|||||||
$table->head[] = __('Agent operation tab');
|
$table->head[] = __('Agent operation tab');
|
||||||
$table->head[] = __('Agent godmode tab');
|
$table->head[] = __('Agent godmode tab');
|
||||||
$table->head[] = __('Operation');
|
$table->head[] = __('Operation');
|
||||||
$table->width = '100%';
|
|
||||||
$table->class = 'info_table';
|
$table->class = 'info_table';
|
||||||
|
|
||||||
$table->align = [];
|
$table->align = [];
|
||||||
@ -254,9 +275,39 @@ foreach ($extensions as $file => $extension) {
|
|||||||
if ($file != 'update_manager.php') {
|
if ($file != 'update_manager.php') {
|
||||||
$table->cellclass[][10] = 'table_action_buttons';
|
$table->cellclass[][10] = 'table_action_buttons';
|
||||||
if (!$extension['enabled']) {
|
if (!$extension['enabled']) {
|
||||||
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.disabled.png', true, ['class' => 'filter_none']).'</a>'.' <a title="'.__('Enable').'" href="index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file.'" class="mn">'.html_print_image('images/lightbulb_off.png', true, ['class' => 'filter_none']).'</a>';
|
$data[] = html_print_menu_button(
|
||||||
|
[
|
||||||
|
'href' => 'index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file,
|
||||||
|
'image' => 'images/cross.disabled.png',
|
||||||
|
'title' => __('Delete'),
|
||||||
|
'onClick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
|
||||||
|
],
|
||||||
|
true
|
||||||
|
).html_print_menu_button(
|
||||||
|
[
|
||||||
|
'href' => 'index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file,
|
||||||
|
'image' => 'images/lightbulb_off.png',
|
||||||
|
'title' => __('Delete'),
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>'.' <a title="'.__('Disable').'" href="index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&disabled='.$file.'" class="mn">'.html_print_image('images/lightbulb.png', true).'</a>';
|
$data[] = html_print_menu_button(
|
||||||
|
[
|
||||||
|
'href' => 'index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file,
|
||||||
|
'image' => 'images/cross.png',
|
||||||
|
'title' => __('Delete'),
|
||||||
|
'onClick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
|
||||||
|
],
|
||||||
|
true
|
||||||
|
).html_print_menu_button(
|
||||||
|
[
|
||||||
|
'href' => 'index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&disabled='.$file,
|
||||||
|
'image' => 'images/lightbulb.png',
|
||||||
|
'title' => __('Delete'),
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$data[] = '';
|
$data[] = '';
|
||||||
|
@ -80,7 +80,7 @@ if (empty($directory) === true) {
|
|||||||
|
|
||||||
$real_directory = realpath($config['homedir'].'/'.$directory);
|
$real_directory = realpath($config['homedir'].'/'.$directory);
|
||||||
|
|
||||||
echo '<h4>'.__('Index of %s', io_safe_input($directory)).'</h4>';
|
echo '<h4 class="mrgn_0px">'.__('Index of %s', io_safe_input($directory)).'</h4>';
|
||||||
|
|
||||||
$upload_file = (bool) get_parameter('upload_file');
|
$upload_file = (bool) get_parameter('upload_file');
|
||||||
$create_text_file = (bool) get_parameter('create_text_file');
|
$create_text_file = (bool) get_parameter('create_text_file');
|
||||||
|
@ -170,46 +170,118 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
|
|||||||
$table->id = 'news';
|
$table->id = 'news';
|
||||||
$table->cellpadding = 4;
|
$table->cellpadding = 4;
|
||||||
$table->cellspacing = 4;
|
$table->cellspacing = 4;
|
||||||
$table->class = 'databox filters';
|
$table->class = 'databox filters filter-table-adv';
|
||||||
$table->head = [];
|
$table->head = [];
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
$table->style[0] = 'font-weight: bold;';
|
$table->size[0] = '33%';
|
||||||
$table->style[1] = 'font-weight: bold;';
|
$table->size[1] = '33%';
|
||||||
$table->style[2] = 'font-weight: bold;';
|
$table->colspan[2][0] = 2;
|
||||||
$table->style[3] = 'font-weight: bold;';
|
$table->rowclass[2] = 'w100p';
|
||||||
$table->style[4] = 'font-weight: bold;';
|
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[0] = __('Subject').'<br>';
|
$data[0] = html_print_label_input_block(
|
||||||
$data[0] .= '<input type="text" class="text_input" name="subject" size="35" value="'.$subject.'" >';
|
__('Subject'),
|
||||||
|
html_print_input_text(
|
||||||
|
'subject',
|
||||||
|
$subject,
|
||||||
|
'',
|
||||||
|
35,
|
||||||
|
255,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$data[1] = __('Group').'<br>';
|
$data[1] = html_print_label_input_block(
|
||||||
$data[1] .= '<div class="w250px">';
|
__('Group'),
|
||||||
$data[1] .= html_print_select_groups($config['id_user'], 'ER', users_can_manage_group_all(), 'id_group', $id_group, '', '', 0, true, false, false, '');
|
html_print_select_groups(
|
||||||
$data[1] .= '</div>';
|
$config['id_user'],
|
||||||
|
'ER',
|
||||||
|
users_can_manage_group_all(),
|
||||||
|
'id_group',
|
||||||
|
$id_group,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'w100p',
|
||||||
|
false,
|
||||||
|
'width: 100%;'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$table->data[] = $data;
|
||||||
|
|
||||||
$data[2] = __('Modal screen').'<br>';
|
$data = [];
|
||||||
$data[2] .= html_print_checkbox_extended('modal', 1, $modal, false, '', 'class="mrgn_top_5 mrg_btt_7"', true);
|
$data[0] = html_print_label_input_block(
|
||||||
|
__('Modal screen'),
|
||||||
|
html_print_checkbox_extended(
|
||||||
|
'modal',
|
||||||
|
1,
|
||||||
|
$modal,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'class="w100p"',
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$data[3] = __('Expire').'<br>';
|
$data[1] = '<div style="display: inline-flex; flex-direction: row;">'.html_print_label_input_block(
|
||||||
$data[3] .= html_print_checkbox_extended('expire', 1, $expire, false, '', 'class="mrgn_top_5 mrg_btt_7"', true);
|
__('Expire'),
|
||||||
|
html_print_checkbox_extended(
|
||||||
$data[4] = __('Expiration').'<br>';
|
'expire',
|
||||||
$data[4] .= html_print_input_text('expire_date', $expire_date, '', 12, 10, true).' ';
|
1,
|
||||||
$data[4] .= html_print_input_text('expire_time', $expire_time, '', 10, 7, true).' ';
|
$expire,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'class="w100p"',
|
||||||
|
true
|
||||||
|
),
|
||||||
|
['div_class' => 'display-grid']
|
||||||
|
);
|
||||||
|
$data[1] .= html_print_label_input_block(
|
||||||
|
__('Expiration'),
|
||||||
|
'<div>'.html_print_input_text(
|
||||||
|
'expire_date',
|
||||||
|
$expire_date,
|
||||||
|
'',
|
||||||
|
12,
|
||||||
|
10,
|
||||||
|
true
|
||||||
|
).' '.html_print_input_text(
|
||||||
|
'expire_time',
|
||||||
|
$expire_time,
|
||||||
|
'',
|
||||||
|
10,
|
||||||
|
7,
|
||||||
|
true
|
||||||
|
).'</div>',
|
||||||
|
[
|
||||||
|
'div_class' => 'display-grid mrgn_lft_20px',
|
||||||
|
'div_id' => 'news-0-4',
|
||||||
|
]
|
||||||
|
).'</div>';
|
||||||
|
|
||||||
$table->rowclass[] = '';
|
$table->rowclass[] = '';
|
||||||
$table->data[] = $data;
|
$table->data[] = $data;
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[0] = __('Text').'<br>';
|
$data[0] = html_print_label_input_block(
|
||||||
$data[0] .= html_print_textarea('text', 25, 15, $text, '', true);
|
__('Text'),
|
||||||
$table->rowclass[] = '';
|
html_print_textarea(
|
||||||
$table->colspan[1][0] = 5;
|
'text',
|
||||||
|
25,
|
||||||
|
100,
|
||||||
|
$text,
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
'w100p'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$table->data[] = $data;
|
$table->data[] = $data;
|
||||||
|
|
||||||
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/news">';
|
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/news" class="max_floating_element_size">';
|
||||||
if ($creation_mode == 1) {
|
if ($creation_mode == 1) {
|
||||||
echo "<input type='hidden' name='create' value='1'>";
|
echo "<input type='hidden' name='create' value='1'>";
|
||||||
} else {
|
} else {
|
||||||
@ -228,11 +300,25 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
|
|||||||
echo "<table width='".$table->width."'>";
|
echo "<table width='".$table->width."'>";
|
||||||
echo "<tr><td align='right'>";
|
echo "<tr><td align='right'>";
|
||||||
if (isset($_GET['form_add'])) {
|
if (isset($_GET['form_add'])) {
|
||||||
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('Create')."'>";
|
$submit_button = html_print_submit_button(
|
||||||
|
__('Create'),
|
||||||
|
'crtbutton',
|
||||||
|
false,
|
||||||
|
['icon' => 'wand'],
|
||||||
|
true
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
echo "<input name='crtbutton' type='submit' class='sub upd' value='".__('Update')."'>";
|
$submit_button = html_print_submit_button(
|
||||||
|
__('Update'),
|
||||||
|
'crtbutton',
|
||||||
|
false,
|
||||||
|
['icon' => 'wand'],
|
||||||
|
true
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html_print_action_buttons($submit_button);
|
||||||
|
|
||||||
echo '</form></td></tr></table>';
|
echo '</form></td></tr></table>';
|
||||||
} else {
|
} else {
|
||||||
$rows = db_get_all_rows_in_table('tnews', 'timestamp');
|
$rows = db_get_all_rows_in_table('tnews', 'timestamp');
|
||||||
@ -293,11 +379,17 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
|
|||||||
echo '</table>';
|
echo '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<table width='100%'>";
|
|
||||||
echo "<tr><td align='right'>";
|
|
||||||
echo "<form method='post' action='index.php?sec=gsetup&sec2=godmode/setup/news&form_add=1'>";
|
echo "<form method='post' action='index.php?sec=gsetup&sec2=godmode/setup/news&form_add=1'>";
|
||||||
echo "<input type='submit' class='sub next' name='form_add' value='".__('Add')."'>";
|
html_print_action_buttons(
|
||||||
echo '</form></table>';
|
html_print_submit_button(
|
||||||
|
__('Add'),
|
||||||
|
'form_add',
|
||||||
|
false,
|
||||||
|
['icon' => 'wand'],
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
echo '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -791,6 +791,10 @@ if ($save_filter_modal) {
|
|||||||
$table->rowid[1] = 'save_filter_row1';
|
$table->rowid[1] = 'save_filter_row1';
|
||||||
$table->size[0] = '50%';
|
$table->size[0] = '50%';
|
||||||
$table->size[1] = '50%';
|
$table->size[1] = '50%';
|
||||||
|
$table->rowclass[1] = 'flex';
|
||||||
|
$table->rowclass[2] = 'flex';
|
||||||
|
$table->rowclass[3] = 'flex';
|
||||||
|
$table->rowclass[4] = 'flex';
|
||||||
$data[0] = '<b>'.__('Filter name').'</b>'.$jump;
|
$data[0] = '<b>'.__('Filter name').'</b>'.$jump;
|
||||||
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true);
|
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true);
|
||||||
if (is_metaconsole()) {
|
if (is_metaconsole()) {
|
||||||
|
@ -239,38 +239,53 @@ class EventSound extends HTML
|
|||||||
ui_require_css_file('discovery');
|
ui_require_css_file('discovery');
|
||||||
|
|
||||||
if ($tab === 'add') {
|
if ($tab === 'add') {
|
||||||
echo '<form method="post" enctype="multipart/form-data" action="index.php?sec=eventos&sec2=godmode/events/configuration_sounds&tab=add&action=create">';
|
echo '<form method="post" enctype="multipart/form-data" action="index.php?sec=eventos&sec2=godmode/events/configuration_sounds&tab=add&action=create"
|
||||||
|
class="max_floating_element_size">';
|
||||||
$table = new stdClass();
|
$table = new stdClass();
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
|
|
||||||
$table->class = 'databox filters';
|
$table->class = 'databox filters filter-table-adv';
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
$table->data[0][0] = __('Name:');
|
$table->size[0] = '50%';
|
||||||
|
$table->size[1] = '50%';
|
||||||
|
|
||||||
$table->data[0][1] = html_print_input_text(
|
$table->data[0][0] = html_print_label_input_block(
|
||||||
'name',
|
__('Name:'),
|
||||||
'',
|
html_print_input_text(
|
||||||
'',
|
'name',
|
||||||
80,
|
'',
|
||||||
100,
|
'',
|
||||||
true,
|
80,
|
||||||
false,
|
100,
|
||||||
true
|
true,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[1][0] = __('WAV Sound');
|
$table->data[0][1] = html_print_label_input_block(
|
||||||
$table->data[1][1] = html_print_input_file('file', true, ['required' => true]);
|
__('WAV Sound'),
|
||||||
|
html_print_input_file(
|
||||||
|
'file',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'required' => true,
|
||||||
|
'accept' => 'audio/*',
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
|
|
||||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
html_print_action_buttons(
|
||||||
html_print_submit_button(
|
html_print_submit_button(
|
||||||
__('Create'),
|
__('Create'),
|
||||||
'save_sound',
|
'save_sound',
|
||||||
false,
|
false,
|
||||||
'class="sub wand"'
|
['icon' => 'wand'],
|
||||||
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
echo '</div>';
|
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
||||||
// Load own javascript file.
|
// Load own javascript file.
|
||||||
@ -305,7 +320,7 @@ class EventSound extends HTML
|
|||||||
[
|
[
|
||||||
'id' => $this->tableId,
|
'id' => $this->tableId,
|
||||||
'class' => 'info_table',
|
'class' => 'info_table',
|
||||||
'style' => 'width: 100%',
|
'style' => 'width: 99%',
|
||||||
'columns' => $columns,
|
'columns' => $columns,
|
||||||
'column_names' => $column_names,
|
'column_names' => $column_names,
|
||||||
'ajax_url' => $this->ajaxController,
|
'ajax_url' => $this->ajaxController,
|
||||||
@ -321,7 +336,7 @@ class EventSound extends HTML
|
|||||||
[
|
[
|
||||||
'label' => __('Free search').ui_print_help_tip(__('Search filter by Name or Sound fields content'), true),
|
'label' => __('Free search').ui_print_help_tip(__('Search filter by Name or Sound fields content'), true),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'class' => 'w200px',
|
'class' => 'w70p',
|
||||||
'id' => 'filter_text',
|
'id' => 'filter_text',
|
||||||
'name' => 'filter_text',
|
'name' => 'filter_text',
|
||||||
],
|
],
|
||||||
@ -333,12 +348,13 @@ class EventSound extends HTML
|
|||||||
'0' => __('No'),
|
'0' => __('No'),
|
||||||
'1' => __('Yes'),
|
'1' => __('Yes'),
|
||||||
],
|
],
|
||||||
'class' => 'w100px',
|
'class' => 'w100p',
|
||||||
'id' => 'active',
|
'id' => 'active',
|
||||||
'name' => 'active',
|
'name' => 'active',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar ',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@ -350,6 +366,7 @@ class EventSound extends HTML
|
|||||||
close_meta_frame();
|
close_meta_frame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html_print_action_buttons('');
|
||||||
// Load own javascript file.
|
// Load own javascript file.
|
||||||
echo $this->loadJS();
|
echo $this->loadJS();
|
||||||
}
|
}
|
||||||
|
@ -4773,6 +4773,10 @@ function html_print_input_file($name, $return=false, $options=false)
|
|||||||
if (isset($options['style']) === true) {
|
if (isset($options['style']) === true) {
|
||||||
$output .= ' style="'.$options['style'].'"';
|
$output .= ' style="'.$options['style'].'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($options['accept']) === true) {
|
||||||
|
$output .= ' accept="'.$options['accept'].'"';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close input.
|
// Close input.
|
||||||
|
@ -11452,6 +11452,7 @@ form#satellite_conf_edit > fieldset.full-column {
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 24px;
|
background-size: 24px;
|
||||||
background-image: url("../../images/enable.svg");
|
background-image: url("../../images/enable.svg");
|
||||||
|
padding-right: 45px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.orientation-report {
|
.orientation-report {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user