Project

General

Profile

« Previous | Next » 

Revision 1684

Added by Dietmar about 12 years ago

! update upgrade-script, now don't overwrite existings values in settings
+ add field tooltip to table pages in installer
! change some module tool_icon.png (Tks to Stefek)
! add date_time string to backup_droplets.zip
- search and comment out founded require_once(WB_PATH."/framework/class.database.php");
- this will be never needed anymore and produce errors
! rename class.msg_queue.php in msgQueue.php to work with autokoader
+ add function format_message to class.wb.php

View differences:

class.wb.php
383 383
		}
384 384
		exit();
385 385
	}
386
/*
387
 * @param string $message: the message to format
388
 * @param string $status:  ('ok' / 'error' / '') status defines the apereance of the box
389
 * @return string: the html-formatted message (using template 'message.htt')
390
 */
391
	public function format_message($message, $status = 'ok')
392
	{
393
		$id = uniqid('x');
394
		$tpl = new Template(dirname($this->correct_theme_source('message.htt')));
395
		$tpl->set_file('page', 'message.htt');
396
		$tpl->set_block('page', 'main_block', 'main');
397
		$tpl->set_var('MESSAGE', $message);
398
 	    $tpl->set_var( 'THEME_URL', THEME_URL );
399
		$tpl->set_var( 'ID', $id );
400
		if($status == 'ok' || $status == 'error' || $status = 'warning')
401
		{
402
			$tpl->set_var('BOX_STATUS', ' box-'.$status);
403
		}else
404
		{
405
			$tpl->set_var('BOX_STATUS', '');
406
		}
407
		$tpl->set_var('STATUS', $status);
408
		if(!defined('REDIRECT_TIMER') ) { define('REDIRECT_TIMER', -1); }
409
		$retval = '';
410
		if( $status != 'error' )
411
		{
412
			switch(REDIRECT_TIMER):
413
				case 0: // do not show message
414
					unset($tpl);
415
					break;
416
				case -1: // show message permanently
417
					$tpl->parse('main', 'main_block', false);
418
					$retval = $tpl->finish($tpl->parse('output', 'page', false));
419
					unset($tpl);
420
					break;
421
				default: // hide message after REDIRECTOR_TIMER milliseconds
422
					$retval = '<script type="text/javascript">/* <![CDATA[ */ function '.$id.'_hide() {'.
423
							  'document.getElementById(\''.$id.'\').style.display = \'none\';}'.
424
							  'window.setTimeout(\''.$id.'_hide()\', '.REDIRECT_TIMER.');/* ]]> */ </script>';
425
					$tpl->parse('main', 'main_block', false);
426
					$retval = $tpl->finish($tpl->parse('output', 'page', false)).$retval;
427
					unset($tpl);
428
			endswitch;
429
		}else
430
		{
431
			$tpl->parse('main', 'main_block', false);
432
			$retval = $tpl->finish($tpl->parse('output', 'page', false)).$retval;
433
			unset($tpl);
434
		}
435
		return $retval;
436
	}
386 437

  
387 438
	// Validate send email
388 439
	function mail($fromaddress, $toaddress, $subject, $message, $fromname='', $replyTo='') {

Also available in: Unified diff