diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index a9c0e1ca71..08b528c64a 100755 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -13,6 +13,12 @@ // GNU General Public License for more details. global $config; +$legacy = (bool) get_parameter('legacy', false); +if ($legacy === false) { + include_once $config['homedir'].'/operation/visual_console/view.php'; + return; +} + // Login check require_once $config['homedir'].'/include/functions_visual_map.php'; @@ -169,11 +175,6 @@ $options['view']['active'] = true; if (!is_metaconsole()) { if (!$config['pure']) { $options['pure']['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).''; - $options['view2']['text'] = ''.html_print_image( - 'images/operation.png', - true, - ['title' => __('Beta View')] - ).''; ui_print_page_header($layout_name, 'images/visual_console.png', false, '', false, $options); } diff --git a/pandora_console/operation/visual_console/view.php b/pandora_console/operation/visual_console/view.php new file mode 100644 index 0000000000..4881086c7d --- /dev/null +++ b/pandora_console/operation/visual_console/view.php @@ -0,0 +1,374 @@ +'.html_print_image( + 'images/visual_console.png', + true, + ['title' => __('Visual consoles list')] +).''; + +if ($vconsole_write || $vconsole_manage) { + $url_base = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action='; + + $hash = md5($config['dbpass'].$id_layout.$config['id_user']); + + $options['public_link']['text'] = ''.html_print_image( + 'images/camera_mc.png', + true, + ['title' => __('Show link to public Visual Console')] + ).''; + $options['public_link']['active'] = false; + + $options['data']['text'] = ''.html_print_image( + 'images/op_reporting.png', + true, + ['title' => __('Main data')] + ).''; + $options['list_elements']['text'] = ''.html_print_image( + 'images/list.png', + true, + ['title' => __('List elements')] + ).''; + + if (enterprise_installed()) { + $options['wizard_services']['text'] = ''.html_print_image( + 'images/wand_services.png', + true, + ['title' => __('Services wizard')] + ).''; + } + + $options['wizard']['text'] = ''.html_print_image( + 'images/wand.png', + true, + ['title' => __('Wizard')] + ).''; + $options['editor']['text'] = ''.html_print_image( + 'images/builder.png', + true, + ['title' => __('Builder')] + ).''; +} + +$options['view']['text'] = ''.html_print_image('images/operation.png', true, ['title' => __('View')]).''; +$options['view']['active'] = true; +if (!is_metaconsole()) { + if (!$config['pure']) { + $options['pure']['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).''; + ui_print_page_header($layout_name, 'images/visual_console.png', false, '', false, $options); + } + + // Set the hidden value for the javascript. + html_print_input_hidden('metaconsole', 0); +} else { + // Set the hidden value for the javascript. + html_print_input_hidden('metaconsole', 1); +} + +use Models\VisualConsole\Container as VisualConsole; + +$visualConsole = VisualConsole::fromArray($layout); +$visualConsoleItems = VisualConsole::getItemsFromDB($id_layout); + +// TODO: Extract to a function. +$vcClientPath = 'include/visual-console-client'; +$dir = $config['homedir'].'/'.$vcClientPath; +if (is_dir($dir)) { + $dh = opendir($dir); + if ($dh) { + while (($file = readdir($dh)) !== false) { + if ($file === '.' || $file === '..') { + continue; + } + + preg_match('/.*.js$/', $file, $match, PREG_OFFSET_CAPTURE); + if (empty($match) === false) { + $url = ui_get_full_url(false, false, false, false).$vcClientPath.'/'.$match[0][0]; + echo ''; + continue; + } + + preg_match('/.*.css$/', $file, $match, PREG_OFFSET_CAPTURE); + if (empty($match) === false) { + $url = ui_get_full_url(false, false, false, false).$vcClientPath.'/'.$match[0][0]; + echo ''; + } + } + + closedir($dh); + } +} + +echo '
'; + +if ($config['pure']) { + // Floating menu - Start + echo '