Exemple #1
0
    header("Pragma: no-cache");
    $plugin->create_pdf_url($all ? $print_book_url : $print_section_url, $res->getVar('title') . '.pdf', $options);
}
// Sección
$section = new RDSection($id, isset($res) ? $res : null);
if ($section->isNew()) {
    RDfunctions::error_404();
}
$res = new RDResource($section->getVar('id_res'));
//Verificamos si es una publicación aprobada
if ($res->isNew()) {
    RDFunctions::error_404();
}
// Check if section is a top parent
if ($section->getVar('parent') > 0) {
    $top = RDfunctions::super_parent($section->getVar('parent'));
    header('location: ' . html_entity_decode($top->permalink()) . '#' . $section->getVar('nameid'));
    die;
}
if (!$res->getVar('approved')) {
    redirect_header(RDURL, 0, __('This content is not available!', 'docs'));
    die;
}
// Comprobamos permisos
if (!$res->isAllowed($xoopsUser ? $xoopsUser->groups() : XOOPS_GROUP_ANONYMOUS)) {
    redirect_header(RDURL, 0, __('You are not allowed to read this content!', 'docs'));
    die;
}
// Select correct operation
$action = rmc_server_var($_GET, 'action', '');
switch ($action) {