<?php
	require_once( $GLOBALS["site_root"] . "/includes/widgets/Widget.inc.php" );
	require_once( $GLOBALS["site_root"] . "/includes/models/Constants.inc.php" );

	class AdminConstants extends Widget {


		public function handleEvents() {
			if (!isset( $this->aG["inajax"] )) return parent::handleEvents();
			if (!$this->aG["inajax"]) return parent::handleEvents();
			if (!isset( $this->aG["action"] )) return parent::handleEvents();
			switch ($this->aG["action"]) {
			case "get_constants":
				$cm = new ConstantsModel();
				FNTH_echo_json_response( $cm->getConstants() );
				exit();
				break;
			default:
				return parent::handleEvents();
			}
		}
	}
?>
