1<?php
2/********************************
3OSBib:
4A collection of PHP classes to create and manage bibliographic formatting for OS bibliography software
5using the OSBib standard.
6
7Released through http://bibliophile.sourceforge.net under the GPL licence.
8Do whatever you like with this -- some credit to the author(s) would be appreciated.
9
10If you make improvements, please consider contacting the administrators at bibliophile.sourceforge.net
11so that your improvements can be added to the release package.
12
13Adapted from WIKINDX: http://wikindx.sourceforge.net
14
15Mark Grimshaw 2005
16http://bibliophile.sourceforge.net
17********************************/
18/**
19*	Error messages
20*
21*	@author Mark Grimshaw
22*
23*	$Header: /cvsroot/bibliophile/OSBib/create/ERRORS.php,v 1.1 2005/06/20 22:26:51 sirfragalot Exp $
24*/
25class ERRORS
26{
27// Constructor
28	function ERRORS()
29	{
30	}
31/**
32* Print the message
33*/
34	function text($arrayName, $indexName, $extra = FALSE)
35	{
36		include_once("MISC.php");
37		include_once("../UTF8.php");
38		$utf8 = new UTF8();
39		$arrays = $this->loadArrays();
40		$string = $arrays[$arrayName][$indexName];
41		$string = $extra ?	preg_replace("/###/", $utf8->smartUtf8_decode($extra), $string) :
42			preg_replace("/###/", "", $string);
43		return MISC::p($utf8->encodeUtf8($string), "error", "center");
44	}
45// English errors
46	function loadArrays()
47	{
48		return array(
49			"sessionError" => array(
50				"write"		=>	"Unable to write to session.",
51			),
52// General user input errors
53			"inputError" => array(
54				"nan"		=>	"Input is not a number.###",
55				"missing"	=>	"Missing input.###",
56				"invalid"	=>	"Invalid input.###",
57				"styleExists"	=>	"That style already exists",
58			),
59// File operations (import/export)
60			"file"	=> array(
61				'write'			=>	"Unable to write to file###",
62				'noSql'			=>	"You must first list or select resources",
63				"read"			=>	"Unable to read directory or file",
64				"empty"			=>	"You have not yet exported any files",
65				"upload"		=>	"File upload error",
66				"folder"		=>	"Unable to create directory",
67			),
68		);
69	}
70}
71?>
72