示例#1
0
    } elseif ($group_properties['wiki_state'] == 2) {
        if (!api_is_allowed_to_edit(false, true) and !GroupManager::is_user_in_group(api_get_user_id(), api_get_group_id())) {
            api_not_allowed();
        }
    }
}
$is_allowed_to_edit = api_is_allowed_to_edit(false, true);
// The page we are dealing with
$page = isset($_GET['title']) ? $_GET['title'] : 'index';
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'showpage';
$view = isset($_GET['view']) ? Security::remove_XSS($_GET['view']) : null;
$wiki->page = $page;
$wiki->action = $action;
// Setting wiki data
if (!empty($view)) {
    $wiki->setWikiData($view);
}
$wiki->blockConcurrentEditions(api_get_user_id(), $action);
/* MAIN WIKI AREA */
ob_start();
$handleAction = $wiki->handleAction($action);
if (!$handleAction && $action == 'export_to_pdf') {
    $wiki->handleAction('showpage');
}
$content = ob_get_contents();
ob_end_clean();
Display::display_header($tool_name, 'Wiki');
// check last version
if (!empty($view)) {
    $wiki->checkLastVersion($view);
}