* @author The SmartFactory * @version $Id: print.php 335 2011-12-05 20:24:01Z lusopoemas@gmail.com $ */ include_once dirname(__FILE__) . '/header.php'; require_once XOOPS_ROOT_PATH . '/class/template.php'; $itemid = SmartsectionRequest::getInt('itemid'); if ($itemid == 0) { redirect_header("javascript:history.go(-1)", 1, _MD_SMARTSECTION_NOITEMSELECTED); exit(); } // Creating the ITEM object for the selected ITEM $itemObj = $smartsection->getHandler('item')->get($itemid); // if the selected ITEM was not found, exit if ($itemObj->notLoaded()) { redirect_header("javascript:history.go(-1)", 1, _MD_SMARTSECTION_NOITEMSELECTED); exit(); } // Check user permissions to access that category of the selected ITEM if (!$itemObj->accessGranted()) { redirect_header("javascript:history.go(-1)", 1, _NOPERM); exit; } // Creating the category object that holds the selected ITEM $categoryObj = $itemObj->category(); $xoopsTpl = new XoopsTpl(); $myts = MyTextSanitizer::getInstance(); $item['title'] = $itemObj->title(); $item['body'] = $itemObj->body(); $item['categoryname'] = $myts->displayTarea($categoryObj->name()); $mainImage = $itemObj->getMainImage(); if ($mainImage['image_path'] != '') { $item['image'] = '' . $myts->undoHtmlSpecialChars($mainImage['image_name']) . ''; } $xoopsTpl->assign('item', $item); $xoopsTpl->assign('printtitle', $xoopsConfig['sitename'] . " - " . smartsection_html2text($categoryObj->getCategoryPath()) . " > " . $myts->displayTarea($itemObj->title())); $xoopsTpl->assign('printlogourl', $smartsection->getConfig('print_logourl')); $xoopsTpl->assign('printheader', $myts->displayTarea($smartsection->getConfig('print_header'), 1)); $xoopsTpl->assign('lang_category', _CO_SMARTSECTION_CATEGORY); $xoopsTpl->assign('lang_author_date', sprintf(_MD_SMARTSECTION_WHO_WHEN, $itemObj->posterName(), $itemObj->datesub())); $doNotStartPrint = false; $noTitle = false; $noCategory = false; $smartPopup = false; $xoopsTpl->assign('doNotStartPrint', $doNotStartPrint); $xoopsTpl->assign('noTitle', $noTitle); $xoopsTpl->assign('smartPopup', $smartPopup); $xoopsTpl->assign('current_language', $xoopsConfig['language']); if ($smartsection->getConfig('print_footer') == 'item footer' || $smartsection->getConfig('print_footer') == 'both') { $xoopsTpl->assign('itemfooter', $myts->displayTarea($smartsection->getConfig('item_footer'), 1)); } if ($smartsection->getConfig('print_footer') == 'index footer' || $smartsection->getConfig('print_footer') == 'both') { $xoopsTpl->assign('indexfooter', $myts->displayTarea($smartsection->getConfig('index_footer'), 1)); } $xoopsTpl->assign('display_whowhen_link', $smartsection->getConfig('item_disp_whowhen_link')); $xoopsTpl->display('db:smartsection_print.html'); ?>