function xnpbinderGetDetailBlock($item_id)
{
    // Get Block of BasicInformation / RegisteredItem.
    $basic = xnpGetBasicInformationDetailBlock($item_id);
    $index = xnpGetIndexDetailBlock($item_id);
    $detail = xnpbinder_get_registered_items($item_id);
    // Variables are set to template.
    global $xoopsTpl;
    $tpl = new XoopsTpl();
    // Variables set to $xoopsTpl ( $xoops_url etc.. ) is copied to $tpl.
    $tpl->assign($xoopsTpl->get_template_vars());
    $tpl->assign('editable', xnp_get_item_permission($_SESSION['XNPSID'], $item_id, OP_MODIFY));
    $tpl->assign('basic', $basic);
    $tpl->assign('index', $index);
    $tpl->assign('detail', $detail);
    // Output in HTML.
    return $tpl->fetch('db:xnpbinder_detail_block.html');
}
function xnpbookGetDetailBlock($item_id)
{
    // get uid
    global $xoopsUser;
    $myuid = is_object($xoopsUser) ? $xoopsUser->getVar('uid', 'n') : UID_GUEST;
    // set to template
    global $xoopsTpl;
    $tpl = new XoopsTpl();
    // copy variables in $xoopsTpl to $tpl
    $tpl->assign($xoopsTpl->get_template_vars());
    $tpl->assign('editable', xnp_get_item_permission($_SESSION['XNPSID'], $item_id, OP_MODIFY));
    $tpl->assign('basic', xnpGetBasicInformationDetailBlock($item_id));
    $tpl->assign('index', xnpGetIndexDetailBlock($item_id));
    $tpl->assign('attachment', xnpGetAttachmentDetailBlock($item_id, 'book_pdf'));
    $xnpbook_handler =& xoonips_getormcompohandler('xnpbook', 'item');
    $tpl->assign('xoonips_item', $xnpbook_handler->getTemplateVar(XOONIPS_TEMPLATE_TYPE_ITEM_DETAIL, $item_id, $myuid));
    // return as HTML
    return $tpl->fetch('db:xnpbook_detail_block.html');
}
function xnppresentationGetDetailBlock($item_id)
{
    // get uid
    global $xoopsUser;
    $myuid = is_object($xoopsUser) ? $xoopsUser->getVar('uid', 'n') : UID_GUEST;
    global $xoopsTpl;
    // get DetailInformation
    $detail_handler =& xoonips_getormhandler('xnppresentation', 'item_detail');
    $detail_orm =& $detail_handler->get($item_id);
    if (!$detail_orm) {
        return '';
    }
    // set to template
    $tpl = new XoopsTpl();
    // copy variables in $xoopsTpl to $tpl
    $tpl->assign($xoopsTpl->get_template_vars());
    $tpl->assign('editable', xnp_get_item_permission($_SESSION['XNPSID'], $item_id, OP_MODIFY));
    $tpl->assign('basic', xnpGetBasicInformationDetailBlock($item_id));
    $tpl->assign('index', xnpGetIndexDetailBlock($item_id));
    $tpl->assign('preview', xnpGetPreviewDetailBlock($item_id));
    $tpl->assign('presentation_file', xnpGetAttachmentDetailBlock($item_id, 'presentation_file'));
    $tpl->assign('readme', xnpGetTextFileDetailBlock($item_id, 'readme', $detail_orm->getVar('readme', 'n')));
    $tpl->assign('rights', xnpGetRightsDetailBlock($item_id, $detail_orm->getVar('use_cc', 'n'), $detail_orm->getVar('rights', 'n'), $detail_orm->getVar('cc_commercial_use', 'n'), $detail_orm->getVar('cc_modification', 'n')));
    $xnppresentation_handler =& xoonips_getormcompohandler('xnppresentation', 'item');
    $tpl->assign('xoonips_item', $xnppresentation_handler->getTemplateVar(XOONIPS_TEMPLATE_TYPE_ITEM_DETAIL, $item_id, $myuid));
    // return as HTML
    return $tpl->fetch('db:xnppresentation_detail_block.html');
}
function xnppaperGetDetailBlock($item_id)
{
    // get uid
    global $xoopsUser;
    $myuid = is_object($xoopsUser) ? $xoopsUser->getVar('uid', 'n') : UID_GUEST;
    global $xoopsTpl;
    $mhandler =& xoops_gethandler('module');
    $chandler =& xoops_gethandler('config');
    $module = $mhandler->getByDirname('xnppaper');
    $assoc = $chandler->getConfigsByCat(false, $module->mid());
    // set to template
    $tpl = new XoopsTpl();
    // copy variables in $xoopsTpl to $tpl
    $tpl->assign($xoopsTpl->get_template_vars());
    $tpl->assign('editable', xnp_get_item_permission($_SESSION['XNPSID'], $item_id, OP_MODIFY));
    $tpl->assign('basic', xnpGetBasicInformationDetailBlock($item_id));
    $tpl->assign('index', xnpGetIndexDetailBlock($item_id));
    $tpl->assign('paper_pdf_reprint', xnpGetAttachmentDetailBlock($item_id, 'paper_pdf_reprint'));
    // Make sure that this user access to item_id is permitted or not
    $tpl->assign('show_pdf', $assoc['pdf_access_rights'] <= xnpGetAccessRights($item_id));
    $tpl->assign('show_abstract', $assoc['abstract_access_rights'] <= xnpGetAccessRights($item_id));
    $xnppaper_handler =& xoonips_getormcompohandler('xnppaper', 'item');
    $tpl->assign('xoonips_item', $xnppaper_handler->getTemplateVar(XOONIPS_TEMPLATE_TYPE_ITEM_DETAIL, $item_id, $myuid));
    // return as HTML
    return $tpl->fetch('db:xnppaper_detail_block.html');
}
function xnpGetIndexPrinterFriendlyBlock($item_id)
{
    return xnpGetIndexDetailBlock($item_id, false);
}