Login   Register  
PHP Classes
elePHPant
Icontem

File: test_webedit.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Keyvan Minoukadeh  >  Config Manager  >  test_webedit.php  >  Download  
File: test_webedit.php
Role: ???
Content type: text/plain
Description: example of using the config web editor class
Class: Config Manager
Sorry, no longer supported
Author: By
Last change:
Date: 2002-03-29 17:01
Size: 1,134 bytes
 

Contents

Class file image Download
<?php

require_once('class.config_base.php');
require_once('class.config_webedit.php');

$webedit = new config_webedit('valid_config.txt');
$webedit->set('debug', false);
$webedit->set('allow_type_change', true);
$webedit->set('show_quotes', true);

// check to see if changes have been posted
if (isset($HTTP_POST_VARS['CONFIGMAN_INFO'])) {
	if ($webedit->update($HTTP_POST_VARS['CONFIGMAN'], $HTTP_POST_VARS['CONFIGMAN_INFO'])) {
		$updated = true;
	} else {
		$updated = false;
	}
}

?>

<?php echo "<"."?xml version=\"1.0\" encoding=\"UTF-8\"?".">\n"; ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/tr/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Config Manager Web Editor (Demo)</title>
<link rel="stylesheet" href="configman.css" type="text/css" />
</head>
<body>

<h2>Config Manager Web Editor (Demo)</h2>

<?php
if (isset($updated)) {
	echo "<b>".($updated ? "Update Successful!" : "Update Failed :(")."</b><br />";
}

echo $webedit->build_form();
?>

</body>
</html>