예제 #1
0
파일: addnew.php 프로젝트: u007/FlexiPHP
	$translator = new SiteTranslatorAdmin();
?>

<html>
<body>
<?
	if (!$translator->isLoggedIn() || !$translator->isEditor())
	{
		echo "<h2>Access denied</h2>";
	}
	else
	{
	
		if ($_POST["submit"])
		{		
			if ($translator->addText($_POST["key"], $_POST["text"]))
			{
				echo "<h3>The database has been updated</h3>";
				echo "You will have to refresh the menu on the left hand side to see the changes";			
			}
			else
			{
				echo "<h3>The item already exists in the database</h3>";
				showForm($_POST["key"], $_POST["text"]);
			}
		}
		else
		{
			showForm();
		}
	}