-
- switch ( $module ) {
- case 'src/read_body.php':
- $js ='';
- if ($compose_new_win == '1') {
- if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
- $compose_width = '640';
+
+ if( $javascript_on || strpos($xtra, 'new_js_autodetect_results.value') ) {
+
+ switch ( $module ) {
+ case 'src/read_body.php':
+ $js ='';
+
+ // compose in new window code
+ if ($compose_new_win == '1') {
+ if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
+ $compose_width = '640';
+ }
+ if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {
+ $compose_height = '550';
+ }
+ $js .= "function comp_in_new_form(comp_uri, button, myform) {\n".
+ ' if (!comp_uri) {'."\n".
+ ' comp_uri = "'.$compose_uri."\";\n".
+ ' }'. "\n".
+ ' comp_uri += "&" + button.name + "=1";'."\n".
+ ' for ( var i=0; i < myform.elements.length; i++ ) {'."\n".
+ ' if ( myform.elements[i].type == "checkbox" && myform.elements[i].checked )'."\n".
+ ' comp_uri += "&" + myform.elements[i].name + "=1";'."\n".
+ ' }'."\n".
+ ' var newwin = window.open(comp_uri' .
+ ', "_blank",'.
+ '"width='.$compose_width. ',height='.$compose_height.
+ ',scrollbars=yes,resizable=yes,status=yes");'."\n".
+ "}\n\n";
+ $js .= "function comp_in_new(comp_uri) {\n".
+ " if (!comp_uri) {\n".
+ ' comp_uri = "'.$compose_uri."\";\n".
+ ' }'. "\n".
+ ' var newwin = window.open(comp_uri' .
+ ', "_blank",'.
+ '"width='.$compose_width. ',height='.$compose_height.
+ ',scrollbars=yes,resizable=yes,status=yes");'."\n".
+ "}\n\n";