$aTemplate['thread_link_str'] = $thread_link_str;
$aTemplate['php_self'] = str_replace('&','&',$php_self);
$aTemplate['mailbox'] = $sMailbox;
+//FIXME: javascript_on is always assigned to the template object in places like init.php; is there some reason to reassign it here? is there some chance that it was changed? if not, please remove this line!
$aTemplate['javascript_on'] = (isset($aProps['config']['javascript_on'])) ? $aProps['config']['javascript_on'] : false;
$aTemplate['enablesort'] = (isset($aProps['config']['enablesort'])) ? $aProps['config']['enablesort'] : false;
$aTemplate['icon_theme'] = (isset($aProps['config']['icon_theme'])) ? $aProps['config']['icon_theme'] : false;
* @return string html formated option field
*/
function createWidget_Integer() {
- global $javascript_on;
// add onChange javascript handler to a regular string widget
// which will strip out all non-numeric chars
- if ($javascript_on)
+ if (checkForJavascript())
return preg_replace('/\/>/', ' onChange="origVal=this.value; newVal=\'\'; '
. 'for (i=0;i<origVal.length;i++) { if (origVal.charAt(i)>=\'0\' '
. '&& origVal.charAt(i)<=\'9\') newVal += origVal.charAt(i); } '
* @return string html formated option field
*/
function createWidget_Float() {
- global $javascript_on;
// add onChange javascript handler to a regular string widget
// which will strip out all non-numeric (period also OK) chars
- if ($javascript_on)
+ if (checkForJavascript())
return preg_replace('/\/>/', ' onChange="origVal=this.value; newVal=\'\'; '
. 'for (i=0;i<origVal.length;i++) { if ((origVal.charAt(i)>=\'0\' '
. '&& origVal.charAt(i)<=\'9\') || origVal.charAt(i)==\'.\') '
global $reply_focus, $hide_sm_attributions, $frame_top,
$provider_name, $provider_uri, $startMessage,
- $javascript_on, $action, $oTemplate;
+ $action, $oTemplate;
if (empty($sBodyTagJs)) {
if (strpos($action, 'reply') !== FALSE && $reply_focus) {
$frame_top = '_top';
}
- if( $javascript_on || strpos($sHeaderJs, 'new_js_autodetect_results.value') ) {
+//FIXME: does checkForJavascript() make the 2nd part of the if() below unneccessary??
+ if( checkForJavascript() || strpos($sHeaderJs, 'new_js_autodetect_results.value') ) {
$js_includes = $oTemplate->get_javascript_includes(TRUE);
$sJsBlock = '';
foreach ($js_includes as $js_file) {
*/
function compose_Header($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') {
- global $reply_focus, $javascript_on, $action, $oTemplate;
+ global $reply_focus, $action, $oTemplate;
if (empty($sBodyTagJs)) {
if (strpos($action, 'reply') !== FALSE && $reply_focus) {
/*
* Locate the first displayable form element (only when JavaScript on)
*/
- if($javascript_on) {
+ if(checkForJavascript()) {
if ($sHeaderJs) {
$sJsBlock = "\n<script type=\"text/javascript\">" .
"\n<!--\n" .
* @since 1.4.2
*/
function makeComposeLink($url, $text = null, $target='') {
- global $compose_new_win, $javascript_on, $compose_width,
+ global $compose_new_win, $compose_width,
$compose_height, $oTemplate;
if(!$text) {
// if javascript is on, use onclick event to handle it
- if($javascript_on) {
+ if(checkForJavascript()) {
sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION);
$compuri = SM_BASE_URI.$url;