}
// We want some variables to always be available to the template
-$always_include = array('sTemplateID', 'icon_theme_path', 'javascript_on');
+$oTemplate->assign('javascript_on', checkForJavascript());
+$always_include = array('sTemplateID', 'icon_theme_path');
foreach ($always_include as $var) {
$oTemplate->assign($var, (isset($$var) ? $$var : NULL));
}
if ( !$reset && sqGetGlobalVar('javascript_on', $javascript_on, SQ_SESSION) )
return $javascript_on;
- if ( $reset || !isset($javascript_setting) )
+ if ( ( $reset || !isset($javascript_setting) )
+ // getPref() not defined (nor is it meaningful) when user not
+ // logged in, but that begs the question if $javascript_on is
+ // not in the session in that case, where do we get it from?
+ && ( sqGetGlobalVar('user_is_logged_in', $user_is_logged_in, SQ_SESSION)
+ && $user_is_logged_in) )
$javascript_setting = getPref($data_dir, $username, 'javascript_setting', SMPREF_JS_AUTODETECT);
if ( !sqGetGlobalVar('new_js_autodetect_results', $js_autodetect_results) &&
* @param bool $includesource If true, adds backend column to address listing
*/
function addr_display_result($res, $includesource = true) {
- global $color, $javascript_on, $PHP_SELF, $squirrelmail_language;
+ global $color, $PHP_SELF, $squirrelmail_language;
global $oTemplate, $oErrorHandler;
foreach ($optpage_blocks as $cur_optpage) {
if (!isset($cur_optpage['js']) || !$cur_optpage['js']) {
$reg_optpage_blocks[] = $cur_optpage;
- } else if ($javascript_on == SMPREF_JS_ON) {
+ } else if (checkForJavascript()) {
$js_optpage_blocks[] = $cur_optpage;
}
}
function formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message,
$color, $FirstTimeSee) {
global $default_use_mdn, $default_use_priority,
- $show_xmailer_default, $mdn_user_support, $PHP_SELF, $javascript_on,
+ $show_xmailer_default, $mdn_user_support, $PHP_SELF,
$squirrelmail_language, $oTemplate;
$mailbox = $aMailbox['NAME'];
$startMessage, $PHP_SELF, $save_as_draft,
$enable_forward_as_attachment, $imapConnection, $lastTargetMailbox,
$delete_prev_next_display, $show_copy_buttons,
- $compose_new_win, $javascript_on, $compose_width, $compose_height,
+ $compose_new_win, $compose_width, $compose_height,
$oTemplate;
//FIXME cleanup argument list, use $aMailbox where possible
if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {
$compose_height = '550';
}
- if ( $javascript_on ) {
+ if ( checkForJavascript() ) {
$on_click=' onclick="comp_in_new_form(\''.$comp_uri.'\', this, this.form,'. $compose_width .',' . $compose_height .')"';
$comp_uri = 'javascript:void(0)';
$method='method="get" ';
function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
global $base_uri, $where, $what, $show_html_default,
- $oTemplate, $javascript_on, $download_href,
+ $oTemplate, $download_href,
$unsafe_image_toggle_href, $unsafe_image_toggle_text;
$urlMailbox = urlencode($mailbox);
$oTemplate->assign('page_selector', $page_selector);
$oTemplate->assign('page_selector_max', $page_selector_max);
$oTemplate->assign('compact_paginator', $compact_paginator);
- $oTemplate->assign('javascript_on', $javascript_on);
+ $oTemplate->assign('javascript_on', checkForJavascript());
$oTemplate->assign('enablesort', (isset($aProps['config']['enablesort'])) ? $aProps['config']['enablesort'] : false);
$oTemplate->assign('icon_theme_path', $icon_theme_path);
$oTemplate->assign('aOrder', array_keys($aColumns));
$oTemplate->assign('page_selector', $page_selector);
$oTemplate->assign('page_selector_max', $page_selector_max);
$oTemplate->assign('compact_paginator', $compact_paginator);
- $oTemplate->assign('javascript_on', $javascript_on);
+ $oTemplate->assign('javascript_on', checkForJavascript());
$oTemplate->assign('enablesort', (isset($aProps['config']['enablesort'])) ? $aProps['config']['enablesort'] : false);
$oTemplate->assign('icon_theme_path', $icon_theme_path);
$oTemplate->assign('use_icons', (isset($use_icons)) ? $use_icons : false);
$oTemplate = Template::construct_template($sTemplateID);
// We want some variables to always be available to the template
- $always_include = array('sTemplateID', 'icon_theme_path', 'javascript_on');
+ $oTemplate->assign('javascript_on', checkForJavascript());
+ $always_include = array('sTemplateID', 'icon_theme_path');
foreach ($always_include as $var) {
$oTemplate->assign($var, (isset($$var) ? $$var : NULL));
}