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 xnpbookGetPrinterFriendlyDetailBlock($item_id) { // get uid global $xoopsUser; $myuid = is_object($xoopsUser) ? $xoopsUser->getVar('uid', 'n') : UID_GUEST; // get BasicInformation / RegisteredItem block $basic = xnpGetBasicInformationDetailBlock($item_id); $index = xnpGetIndexPrinterFriendlyBlock($item_id); $attachment = xnpGetAttachmentPrinterFriendlyBlock($item_id, 'book_pdf'); // set to template global $xoopsTpl; $tpl = new XoopsTpl(); // copy variables in $xoopsTpl to $tpl $tpl->assign($xoopsTpl->get_template_vars()); $tpl->assign('basic', $basic); $tpl->assign('index', $index); $tpl->assign('attachment', $attachment); $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 xnpconferenceGetEditBlock($item_id) { $textutil =& xoonips_getutility('text'); $formdata =& xoonips_getutility('formdata'); // get BasicInformation / Preview / index block $basic = xnpGetBasicInformationEditBlock($item_id); $index = xnpGetIndexEditBlock($item_id); $presentation_file = xnpGetAttachmentEditBlock($item_id, 'conference_file'); $conference_paper = xnpGetAttachmentEditBlock($item_id, 'conference_paper'); // get DetailInformation $presentation_type = $formdata->getValue('post', 'presentation_type', 's', false); if (isset($presentation_type)) { $detail = array('presentation_type' => $presentation_type, 'conference_title' => $formdata->getValue('post', 'conference_title', 's', false), 'place' => $formdata->getValue('post', 'place', 's', false), 'abstract' => $formdata->getValue('post', 'abstract', 's', false), 'conference_from_year' => $formdata->getValue('post', 'conferenceFromYear', 'i', false), 'conference_from_month' => $formdata->getValue('post', 'conferenceFromMonth', 'i', false), 'conference_from_mday' => $formdata->getValue('post', 'conferenceFromDay', 'i', false), 'conference_to_year' => $formdata->getValue('post', 'conferenceToYear', 'i', false), 'conference_to_month' => $formdata->getValue('post', 'conferenceToMonth', 'i', false), 'conference_to_mday' => $formdata->getValue('post', 'conferenceToDay', 'i', false)); foreach ($detail as $key => $val) { ${$key} = $val; } } else { if (!empty($item_id)) { $detail = xnpconferenceGetDetailInformation($item_id); } else { $detail = array(); } } $basic2 = xnpGetBasicInformationDetailBlock($item_id); $tpl = new XoopsTpl(); if (!empty($detail['conference_from_year'])) { $tpl->assign('gmtimeFrom', mktime(0, 0, 0, $detail['conference_from_month'], $detail['conference_from_mday'], $detail['conference_from_year'])); $tpl->assign('gmtimeTo', mktime(0, 0, 0, $detail['conference_to_month'], $detail['conference_to_mday'], $detail['conference_to_year'])); } else { $tpl->assign('gmtimeFrom', mktime(0, 0, 0, $basic2['publication_month']['value'], $basic2['publication_mday']['value'], $basic2['publication_year']['value'])); $tpl->assign('gmtimeTo', mktime(0, 0, 0, $basic2['publication_month']['value'], $basic2['publication_mday']['value'], $basic2['publication_year']['value'])); } $detail = array_map(array($textutil, 'html_special_chars'), $detail); $detail['conference_date'] = array('name' => _MD_XOONIPS_ITEM_PUBLICATION_DATE_LABEL, 'value' => $tpl->fetch('db:xnpconference_date.html')); $attachment_dl_limit = xnpGetDownloadLimitationOptionEditBlock('xnpconference', xnpconferenceGetAttachmentDownloadLimitOption($item_id)); $attachment_dl_notify = xnpGetDownloadNotificationOptionEditBlock('xnpconference', xnpconferenceGetAttachmentDownloadNotifyOption($item_id)); // set to template global $xoopsTpl; $tpl = new XoopsTpl(); // copy variables in $xoopsTpl to $tpl $tpl->assign($xoopsTpl->get_template_vars()); $tpl->assign('basic', $basic); $tpl->assign('index', $index); $tpl->assign('presentation_file', $presentation_file); $tpl->assign('conference_paper', $conference_paper); $tpl->assign('attachment_dl_limit', $attachment_dl_limit); $tpl->assign('attachment_dl_notify', $attachment_dl_notify); $tpl->assign('detail', $detail); $tpl->assign('conference_date', $detail['conference_date']); $formdata =& xoonips_getutility('formdata'); if (!$formdata->getValue('get', 'post_id', 's', false)) { $detail_handler =& xoonips_getormhandler('xnpconference', 'item_detail'); $detail_orm =& $detail_handler->get($item_id); $tpl->assign('xnpconference_author', xoonips_get_multiple_field_template_vars($detail_orm->getAuthors(), 'xnpconference', 'author')); } else { $tpl->assign('xnpconference_author', xoonips_get_multiple_field_template_vars(xoonips_get_orm_from_post('xnpconference', 'author'), 'xnpconference', 'author')); } $tpl->assign('presentation_type', xnpconferenceGetTypes()); $tpl->assign('presentation_type_selected', $detail['presentation_type']); // return as HTML return $tpl->fetch('db:xnpconference_register_block.html'); }
function xnpfilesGetDetailBlock($item_id) { // get uid global $xoopsUser; $myuid = is_object($xoopsUser) ? $xoopsUser->getVar('uid', 'n') : UID_GUEST; // set to template global $xoopsTpl; $tpl = new XoopsTpl(); $tpl->assign($xoopsTpl->get_template_vars()); // copy variables in $xoopsTpl to $tpl $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('files_file', xnpGetAttachmentDetailBlock($item_id, 'files_file')); $xnpfiles_handler =& xoonips_getormcompohandler('xnpfiles', 'item'); $tpl->assign('xoonips_item', $xnpfiles_handler->getTemplateVar(XOONIPS_TEMPLATE_TYPE_ITEM_DETAIL, $item_id, $myuid)); // return as HTML return $tpl->fetch('db:xnpfiles_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 xnpGetBasicInformationPrinterFriendlyBlock($item_id) { return xnpGetBasicInformationDetailBlock($item_id); }