<?php
define("FEATURE", basename(__DIR__));
define("PERMISSION", str_replace(".php", "", basename(__FILE__)));
require_once __DIR__ . "/../../classes/System.php";

if(isset($_POST['id'])){
	if(!$System->hasEditPermission(FEATURE, $_POST['id'])){
		exit($System->error);
	}
	if($System->loadClass("%CLASS_NAME%")){
		if($%CLASS_NAME%->edit($_POST['id'], $_POST) !== false){
			die("success"); // view will redirect from this msg
		} else {
			die($%CLASS_NAME%->error);
		}
	} else {
		die($System->error);
	}
} else { 
	exit("You must supply a %LANG_SINGULAR% ID");
}
?>
