<?php
include '../env.php';
require_once(LIB.'common.inc.php');
require_once(LIB.'Post.class.php');
$post = new Post();
if (! can_action('view')) {
	echo json_encode(FALSE);
	die;
}

if (empty($_GET['id'])) {
	echo json_encode($post->getFavoriteItems());
	die;
}
echo json_encode($post->getFavoriteItems());
?>