diff --git a/main/template/default/layout/layout_2_col.tpl b/main/template/default/layout/layout_2_col.tpl
index 1c6c89cc8c..7659dc8fc2 100644
--- a/main/template/default/layout/layout_2_col.tpl
+++ b/main/template/default/layout/layout_2_col.tpl
@@ -5,9 +5,14 @@
{/block}
{block name=body}
+ {if $show_sniff == 1 }
+ {include file="default/layout/sniff.tpl"}
+ {/if}
+
{$plugin_courses_block}
{$home_page_block}
+ {$sniff_notification}
{$content}
{$announcements_block}
diff --git a/main/template/default/layout/sniff.tpl b/main/template/default/layout/sniff.tpl
new file mode 100644
index 0000000000..84cb1e64ee
--- /dev/null
+++ b/main/template/default/layout/sniff.tpl
@@ -0,0 +1,134 @@
+{literal}
+ \n');
+ if (result) return name+' , '; else return '';
+ }
+}
+
+if (nav!="ie"){
+
+ if (list_plugins.indexOf("Shockwave Flash")!=-1){
+ check_some_plugins=check_some_plugins+', flash_yes';
+ }
+ if (list_plugins.indexOf("QuickTime")!=-1){
+ check_some_plugins=check_some_plugins+', quicktime_yes';
+ }
+ if (list_plugins.indexOf("Windows Media Player")!=-1){
+ check_some_plugins=check_some_plugins+', wmediaplayer_yes';
+ }
+ if (list_plugins.indexOf("Adobe Acrobat")!=-1){
+ check_some_plugins=check_some_plugins+',acrobatreader_yes';
+ }
+}
+
+if(navigator.javaEnabled()==true){java="java_yes";}else{java="java_no";}
+
+
+//for not IE
+if (nav!="ie"){
+ if (navigator.mimeTypes["application/x-java-applet"]){ java_sun_ver="javasun_yes";}
+ if (navigator.mimeTypes["application/x-java-applet;jpi-version=1.6.0_24"]){ java_sun_ver=java_sun_ver+" , javasun_ver_1.6_24_yes"; }//This java version 1.6.0_24 is problematic, the user should be updated
+
+}
+//for IE
+if (nav=="ie"){
+ //1.5->end nov 2009
+ //TODO:extract minor version
+ var java_sun_ver =
+ DetectActiveXObject("JavaWebStart.isInstalled","javasun_yes")+
+ DetectActiveXObject("JavaWebStart.isInstalled.1.4.2.0","javasun_ver_1.4_yes")+
+ DetectActiveXObject("JavaWebStart.isInstalled.1.5.0.0","javasun_ver_1.5_yes")+
+ DetectActiveXObject("JavaWebStart.isInstalled.1.6.0.0","javasun_ver_1.6_yes")+
+ DetectActiveXObject("JavaWebStart.isInstalled.1.7.0.0","javasun_ver_1.7_yes");
+
+ function DetectActiveXObject(ObjectName, name) {
+ result = false;
+ document.write(' \n');
+ if (result) return name+' , '; else return '';
+ }
+}
+
+
+function sendSniff(){
+ document.forms.sniff_nav_form.sniff_navigator.value="checked";
+ document.forms.sniff_nav_form.sniff_navigator_screen_size_w.value=screen_size_w;
+ document.forms.sniff_nav_form.sniff_navigator_screen_size_h.value=screen_size_h;
+ document.forms.sniff_nav_form.sniff_navigator_type_mimetypes.value=type_mimetypes;
+ document.forms.sniff_nav_form.sniff_navigator_suffixes_mimetypes.value=suffixes_mimetypes;
+ document.forms.sniff_nav_form.sniff_navigator_list_plugins.value=list_plugins;
+ document.forms.sniff_nav_form.sniff_navigator_check_some_activex.value=check_some_activex;
+ document.forms.sniff_nav_form.sniff_navigator_check_some_plugins.value=check_some_plugins;
+ document.forms.sniff_nav_form.sniff_navigator_java.value=java;
+ document.forms.sniff_nav_form.sniff_navigator_java_sun_ver.value=java_sun_ver;
+ document.sniff_nav_form.submit();
+}
+
+{/literal}
+
+
+{if empty($smarty.post.sniff_navigator) }
+
+{/if}
\ No newline at end of file
diff --git a/user_portal.php b/user_portal.php
index da19248690..6b8815ea3c 100755
--- a/user_portal.php
+++ b/user_portal.php
@@ -184,143 +184,7 @@ if ($load_dirs) {
}
/* Sniffing system */
-//by Juan Carlos RaƱa Trabado
-?>
-
- \n');
- if (result) return name+' , '; else return '';
- }
-}
-
-if (nav!="ie"){
-
- if (list_plugins.indexOf("Shockwave Flash")!=-1){
- check_some_plugins=check_some_plugins+', flash_yes';
- }
- if (list_plugins.indexOf("QuickTime")!=-1){
- check_some_plugins=check_some_plugins+', quicktime_yes';
- }
- if (list_plugins.indexOf("Windows Media Player")!=-1){
- check_some_plugins=check_some_plugins+', wmediaplayer_yes';
- }
- if (list_plugins.indexOf("Adobe Acrobat")!=-1){
- check_some_plugins=check_some_plugins+',acrobatreader_yes';
- }
-}
-
-if(navigator.javaEnabled()==true){java="java_yes";}else{java="java_no";}
-
-
-//for not IE
-if (nav!="ie"){
- if (navigator.mimeTypes["application/x-java-applet"]){ java_sun_ver="javasun_yes";}
- if (navigator.mimeTypes["application/x-java-applet;jpi-version=1.6.0_24"]){ java_sun_ver=java_sun_ver+" , javasun_ver_1.6_24_yes"; }//This java version 1.6.0_24 is problematic, the user should be updated
-
-}
-//for IE
-if (nav=="ie"){
- //1.5->end nov 2009
- //TODO:extract minor version
- var java_sun_ver =
- DetectActiveXObject("JavaWebStart.isInstalled","javasun_yes")+
- DetectActiveXObject("JavaWebStart.isInstalled.1.4.2.0","javasun_ver_1.4_yes")+
- DetectActiveXObject("JavaWebStart.isInstalled.1.5.0.0","javasun_ver_1.5_yes")+
- DetectActiveXObject("JavaWebStart.isInstalled.1.6.0.0","javasun_ver_1.6_yes")+
- DetectActiveXObject("JavaWebStart.isInstalled.1.7.0.0","javasun_ver_1.7_yes");
-
- function DetectActiveXObject(ObjectName, name) {
- result = false;
- document.write(' \n');
- if (result) return name+' , '; else return '';
- }
-}
-
-function sendSniff(){
- document.forms.sniff_nav_form.sniff_navigator.value="checked";
- document.forms.sniff_nav_form.sniff_navigator_screen_size_w.value=screen_size_w;
- document.forms.sniff_nav_form.sniff_navigator_screen_size_h.value=screen_size_h;
- document.forms.sniff_nav_form.sniff_navigator_type_mimetypes.value=type_mimetypes;
- document.forms.sniff_nav_form.sniff_navigator_suffixes_mimetypes.value=suffixes_mimetypes;
- document.forms.sniff_nav_form.sniff_navigator_list_plugins.value=list_plugins;
- document.forms.sniff_nav_form.sniff_navigator_check_some_activex.value=check_some_activex;
- document.forms.sniff_nav_form.sniff_navigator_check_some_plugins.value=check_some_plugins;
- document.forms.sniff_nav_form.sniff_navigator_java.value=java;
- document.forms.sniff_nav_form.sniff_navigator_java_sun_ver.value=java_sun_ver;
- document.sniff_nav_form.submit();
-}
-
-
-
-
-';
- echo 'sendSniff();';
- echo '';
-}
//store posts to sessions
$_SESSION['sniff_screen_size_w']=Security::remove_XSS($_POST['sniff_navigator_screen_size_w']);
@@ -333,17 +197,6 @@ $_SESSION['sniff_check_some_plugins']=Security::remove_XSS($_POST['sniff_navigat
$_SESSION['sniff_java']=Security::remove_XSS($_POST['sniff_navigator_java']);
$_SESSION['sniff_java_sun_ver']=Security::remove_XSS($_POST['sniff_navigator_java_sun_ver']);
-//var_dump($_SESSION);
-
-// end sniffing system
-
-//check for flash and message
-if (stripos("flash_yes", $_SESSION['sniff_check_some_activex'])===0 || stripos("flash_yes", $_SESSION['sniff_check_some_plugins'])===0){
-
- Display::display_warning_message(get_lang('NoFlash'),false);
-}
-
-
/* MAIN CODE */
$controller = new IndexManager(get_lang('MyCourses'));
@@ -368,6 +221,15 @@ ob_get_clean();
//
$controller->tpl->assign('content', $courses_and_sessions);
+$controller->tpl->assign('show_sniff', 1);
+
+$sniff_notification = '';
+//check for flash and message
+if (stripos("flash_yes", $_SESSION['sniff_check_some_activex'])===0 || stripos("flash_yes", $_SESSION['sniff_check_some_plugins'])===0){
+ $sniff_notification = Display::return_message(get_lang('NoFlash'), 'warning', false);
+ $controller->tpl->assign('sniff_notification', $sniff_notification);
+}
+
$controller->tpl->assign('plugin_courses_block', $controller->return_courses_main_plugin());
$controller->tpl->assign('profile_block', $controller->return_profile_block());
$controller->tpl->assign('account_block', $controller->return_account_block());