Пример #1
0
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');
}
Пример #2
0
function xnpGetPreviewPrinterFriendlyBlock($item_id)
{
    return xnpGetPreviewDetailBlock($item_id);
}