예제 #1
0
session_start();
// Used for including files
if (!defined("_ABSPATH")) {
    define("_ABSPATH", dirname(dirname(__FILE__)));
}
require_once _ABSPATH . '/confs/config-inc.php';
require_once _ABSPATH . '/lib/settings.php';
require_once _ABSPATH . '/lib/Smarty.php';
require_once _ABSPATH . '/lib/functions.php';
require_once _ABSPATH . '/db/nessquikDB.php';
require_once _ABSPATH . '/lib/User.php';
require_once _ABSPATH . '/lib/Metrics.php';
$db = nessquikDB::getInstance();
$tpl = SmartyTemplate::getInstance();
$_usr = User::getInstance();
$_met = Metrics::getInstance();
$tpl->template_dir = _ABSPATH . '/templates/';
$tpl->compile_dir = _ABSPATH . '/templates_c/';
if ($_GET) {
    $action = import_var('action', 'G');
} else {
    $action = import_var('action', 'P');
}
if (!$_usr->is_editor($allowed_editors)) {
    exit;
}
switch ($action) {
    case "show_graph_categories":
        $categories = $_met->get_graph_categories();
        $tpl->assign(array('categories' => $categories));
        $tpl->display('metric_categories.tpl');