Location: PHPKode > scripts > Photos > photos/objects/class.msg.inc.php
<?php

// This file is part of Photos
// Copyright (c) 2001-2004 Alex King
// see LICENSE.txt for more information

if ('class.msg.inc.php' == basename($_SERVER['SCRIPT_NAME'])) {
	header("Location: ../login.php");
	die();
}

class msg {
	var $icon;
	var $text;
	var $type;
	
	function msg($type = 'info', $text = '', $icon = '') {
		if (!empty($icon)) {
			$this->icon = $icon;
		}
		else {
			switch($type) {
				case "info":
					$this->icon = 'images/icon_msg_info.gif';
					break;
				case "warning":
					$this->icon = 'images/icon_msg_warning.gif';
					break;
				case "error":
					$this->icon = 'images/icon_msg_error.gif';
					break;
			}
		}
		$this->text = $text;
		$this->type = $type;
	}

	function show($extra = '') {
		global $lang;
		print('					<li class="'.$this->type.'"'.$extra.'>'
		     .'<img src="'.$this->icon.'" class="msg_icon" />'
		     .'<span><strong>'.$lang->str("msg_".$this->type).'</strong> '
		     .$this->text
		     .'</span></li>'."\n"
		     );
	}

	function show_mobile() {
		global $lang;
		print('<strong>'.$lang->str("msg_".$this->type).'</strong> '
		     .$this->text
		     .'<br />'."\n"
		     );
	}
}

?>
Return current item: Photos