From c57b2b7611f34a40b387f22450316df6114b74b2 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 9 Apr 2019 15:53:22 +0200 Subject: [PATCH] Fixed item position and changed visual_console_view name Former-commit-id: 985ca0cf474667284d60a025ffe1e4c0aa2e7d5a --- .../operation/visual_console/render_view.php | 11 +- .../operation/visual_console/view.php | 374 ++++++++++++++++++ .../visual_console/visual_console_view.php | 188 --------- 3 files changed, 380 insertions(+), 193 deletions(-) create mode 100644 pandora_console/operation/visual_console/view.php delete mode 100644 pandora_console/operation/visual_console/visual_console_view.php 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 '
'; + + echo ''; + + echo '
'; + // Floating menu - End + ui_require_jquery_file('countdown'); + + ?> + + + + diff --git a/pandora_console/operation/visual_console/visual_console_view.php b/pandora_console/operation/visual_console/visual_console_view.php deleted file mode 100644 index 636bc7f237..0000000000 --- a/pandora_console/operation/visual_console/visual_console_view.php +++ /dev/null @@ -1,188 +0,0 @@ -'.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')]).''; - -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')] - ).''; - $options['view2']['active'] = true; - 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); - -echo '
'; - -// 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); - } -} - -?> - -