diff --git a/pandora_console/images/clippy/clippy.png b/pandora_console/images/clippy/clippy.png new file mode 100644 index 0000000000..be3e9d8c64 Binary files /dev/null and b/pandora_console/images/clippy/clippy.png differ diff --git a/pandora_console/images/clippy/easter_egg_00.png b/pandora_console/images/clippy/easter_egg_00.png new file mode 100644 index 0000000000..e9132ebc27 Binary files /dev/null and b/pandora_console/images/clippy/easter_egg_00.png differ diff --git a/pandora_console/images/clippy/easter_egg_01.png b/pandora_console/images/clippy/easter_egg_01.png new file mode 100644 index 0000000000..4a5418e6ee Binary files /dev/null and b/pandora_console/images/clippy/easter_egg_01.png differ diff --git a/pandora_console/images/clippy/easter_egg_02.png b/pandora_console/images/clippy/easter_egg_02.png new file mode 100644 index 0000000000..7c8739f856 Binary files /dev/null and b/pandora_console/images/clippy/easter_egg_02.png differ diff --git a/pandora_console/images/clippy/easter_egg_03.png b/pandora_console/images/clippy/easter_egg_03.png new file mode 100644 index 0000000000..ca94c0c2b1 Binary files /dev/null and b/pandora_console/images/clippy/easter_egg_03.png differ diff --git a/pandora_console/images/clippy/easter_egg_04.png b/pandora_console/images/clippy/easter_egg_04.png new file mode 100644 index 0000000000..aa3963672f Binary files /dev/null and b/pandora_console/images/clippy/easter_egg_04.png differ diff --git a/pandora_console/images/pandorin.png b/pandora_console/images/pandorin.png deleted file mode 100644 index 73124eab68..0000000000 Binary files a/pandora_console/images/pandorin.png and /dev/null differ diff --git a/pandora_console/include/help/clippy/homepage.php b/pandora_console/include/help/clippy/homepage.php index c0aa6d7e1a..2681ab75ad 100644 --- a/pandora_console/include/help/clippy/homepage.php +++ b/pandora_console/include/help/clippy/homepage.php @@ -23,6 +23,22 @@ function clippy_start_page_homepage() { global $config; $clippy_is_annoying = (int)get_cookie('clippy_is_annoying', 0); + $nagios = (int)get_cookie('nagios', -1); + + $easter_egg_toy = $nagios % 6; + if (($easter_egg_toy == 5) || + ($easter_egg_toy == -1)) { + $image = 'images/clippy/clippy.png'; + } + else { + $image = 'images/clippy/easter_egg_0' . $easter_egg_toy . '.png'; + } + if ($image != 'easter_egg_04.png') { + $style = 'display: block; position: absolute; left: -112px; top: -80px;'; + } + else { + $style = 'display: block; position: absolute; left: -200px; top: -80px;'; + } clippy_clean_help(); @@ -38,17 +54,23 @@ function clippy_start_page_homepage() { $return_tours['tours']['homepage']['steps'] = array(); $return_tours['tours']['homepage']['steps'][] = array( 'element'=> '#clippy', - 'intro' => __('Hi, can I help you?') . '

' . + 'intro' => + '
'. + __('Hi, can I help you?') . '

' . __('Let me introduce my self: I am Pandorin, the annoying clippy of Pandora FMS. You can follow my steps to do basic tasks in Pandora FMS or you can close me and never see me again.') . - '
'. + '
' . + '
' . html_print_checkbox_extended ('clippy_is_annoying', 1, $clippy_is_annoying, false, 'set_clippy_annoying()', '', true) . __('Close this annoying clippy right now.') . '
' . '
-
' . - html_print_image('images/pandorin.png', true) . +
' . + html_print_image( + $image, + true, + array('id'=> 'clippy_toy', 'onclick' => 'easter_egg_clippy(1);')) . '
' ); @@ -89,9 +111,41 @@ function clippy_start_page_homepage() { intro_homepage.start(); } + var nagios = -1; + function easter_egg_clippy(click) { + if (readCookie('nagios')) { + nagios = readCookie('nagios'); + } + + if (click) + nagios++; + + if (nagios > 5) { + easter_egg_toy = nagios % 6; + + if ((easter_egg_toy == 5) || + (easter_egg_toy == -1)) { + image = 'images/clippy/clippy.png'; + } + else { + image = 'images/clippy/easter_egg_0' + easter_egg_toy + '.png'; + } + + $('#clippy_toy').attr('src', image); + if (easter_egg_toy == 4) { + $('#pandorin').css('left', '-200px'); + } + else { + $('#pandorin').css('left', '-112px'); + } + + document.cookie = 'nagios=' + nagios; + } + } + function set_clippy_annoying() { checked = $('input[name=\'clippy_is_annoying\']').is(':checked'); - intro_homepage.exit(); + //intro_homepage.exit(); if (checked) { document.cookie = 'clippy_is_annoying=1'; @@ -100,6 +154,22 @@ function clippy_start_page_homepage() { document.cookie = 'clippy_is_annoying=0'; } } + + function readCookie(name) { + var nameEQ = name + '='; + var ca = document.cookie.split(';'); + + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + + while (c.charAt(0)==' ') + c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) + return c.substring(nameEQ.length,c.length); + } + return null; + } + "; if ($config['logged']) { $return_tours['tours']['homepage']['conf']['autostart'] = true;