コード例 #1
0
<?php

require_once 'lib/header.php';
require_once 'lib/lib_anaphora_syntax.php';
$action = isset($_GET['act']) ? $_GET['act'] : '';
switch ($action) {
    case 'finish_moder':
        finish_syntax_moderation($_GET['book_id']);
        header("Location:syntax.php");
        break;
    case 'set_status':
        set_syntax_annot_status($_GET['book_id'], $_GET['status']);
        header("Location:syntax.php");
        break;
    case 'set_moderated':
        become_syntax_moderator($_GET['book_id']);
        header("Location:syntax.php");
        break;
    default:
        check_permission(PERM_SYNTAX);
        $smarty->assign('page', get_books_with_syntax());
        $smarty->display('syntax/main.tpl');
}
log_timing();
コード例 #2
0
<?php

// set_include_path(".:/Users/alex/pear/share/pear:/Users/alex/Code/php/smarty/libs");
// register_shutdown_function(function() { debug_print_backtrace(); });
require_once 'lib/header.php';
require_once 'lib/lib_anaphora_syntax.php';
require_once 'lib/lib_users.php';
require_once 'kappa_fn.php';
$books = get_books_with_syntax();
$simple_groups = get_all_simple_groups();
$types = get_syntax_group_types();
$SIMPLE_TYPES = array(1, 6, 2, 3, 5, 15, 4, 7);
$COMPLEX_TYPES = array(13, 14, 9, 12, 11, 10, 8);
$KAPPA_BEST = array();
$matrixes = array();
foreach ($books['books'] as $book) {
    $simple_groups = get_all_simple_groups_by_book($book['id']);
    if (count($simple_groups) === 0) {
        continue;
    }
    $users = array();
    if ($book['syntax_moder_id'] === 0) {
        $mod = "none";
    } else {
        $mod = get_user_shown_name($book['syntax_moder_id']);
    }
    foreach ($simple_groups as $gr) {
        $users[$gr['user_id']]++;
        $USERS[] = $gr['user_id'];
        $USERS = array_values(array_unique($USERS));
    }