Example #1
0
            $smarty->display('static/doc/export.tpl');
            break;
        case 'faq':
            $smarty->assign('active_page', 'about');
            $smarty->assign('content', get_wiki_page('FAQ'));
            $smarty->assign('title', 'FAQ');
            $smarty->display('static/faq.tpl');
            break;
        case 'achievements':
            $am = new AchievementsManager($_SESSION['user_id']);
            $smarty->assign('stats', $am->pull_stats());
            $smarty->assign('manager', $am);
            $smarty->display('achievements/all_achievements.tpl');
            break;
        default:
            header("Location:index.php");
            break;
    }
} else {
    if (!is_admin()) {
        if (is_logged()) {
            $smarty->assign('available', get_available_tasks($_SESSION['user_id'], true, $config['misc']['mainpage_tasks_limit'], true));
            $tagset_id = get_current_tagset();
            $smarty->assign('ner_tagset_id', $tagset_id);
            $smarty->assign('ner_tasks', get_books_with_NE($tagset_id));
        }
        $smarty->assign('answer_count', count_all_answers());
    }
    $smarty->display('index.tpl');
}
log_timing();
Example #2
0
<?php

require_once 'lib/header.php';
require_once 'lib/lib_ne.php';
require_once 'lib/lib_users.php';
// TODO: permissions?
check_logged();
$action = isset($_GET['act']) ? $_GET['act'] : '';
$tagset_id = get_current_tagset();
switch ($action) {
    case 'manual':
        $smarty->assign('content', get_wiki_page("nermanual/" . (int) $_GET['id']));
        $smarty->display('static/doc/annotation.tpl');
        break;
    default:
        $is_ner_mod = user_has_permission(PERM_NE_MODER);
        $smarty->assign('possible_guidelines', array(1 => "Default (2014)", 2 => "Dialogue Eval (2016)"));
        // TODO read from db
        $smarty->assign('is_ner_mod', $is_ner_mod);
        $smarty->assign('current_guideline', $tagset_id);
        $smarty->assign('page', get_books_with_NE($tagset_id, !$is_ner_mod));
        $smarty->display($is_ner_mod ? 'ner/main-moderator.tpl' : 'ner/main.tpl');
}
log_timing();
Example #3
0
<?php

require_once 'lib/header.php';
require_once 'lib/lib_ne.php';
// TODO: permissions?
check_logged();
$action = isset($_GET['act']) ? $_GET['act'] : '';
$tagset_id = get_current_tagset();
switch ($action) {
    case 'manual':
        $smarty->assign('content', get_wiki_page("nermanual/" . (int) $_GET['id']));
        $smarty->display('static/doc/annotation.tpl');
        break;
    default:
        $smarty->assign('possible_guidelines', array(1 => "Default (2014)", 2 => "Dialogue Eval (2016)"));
        // TODO read from db
        $smarty->assign('current_guideline', $tagset_id);
        $smarty->assign('page', get_books_with_NE($tagset_id));
        $smarty->display('ner/main.tpl');
}
log_timing();