function xnppresentationGetConfirmBlock($item_id)
{
    $formdata =& xoonips_getutility('formdata');
    $creator_handler =& xoonips_getormhandler('xnppresentation', 'creator');
    $creator_objs =& $formdata->getObjectArray('post', $creator_handler->getTableName(), $creator_handler, false);
    // retrieve blocks of BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationConfirmBlock($item_id);
    $preview = xnpGetPreviewConfirmBlock($item_id);
    $index = xnpGetIndexConfirmBlock($item_id);
    $presentation_file = xnpGetAttachmentConfirmBlock($item_id, 'presentation_file');
    $lengths = xnpGetColumnLengths('xnppresentation_item_detail');
    $readme = xnpGetTextFileConfirmBlock($item_id, 'readme', $lengths['readme']);
    $rights = xnpGetRightsConfirmBlock($item_id, $lengths['rights']);
    // retrieve detail information
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        $detail = array('presentation_type' => array('value' => $formdata->getValue('post', 'presentation_type', 's', false)));
        xnpConfirmHtml($detail, 'xnppresentation_item_detail', array_keys($detail), _CHARSET);
        $types = xnppresentationGetTypes();
        $detail['presentation_type_str'] = array('value' => htmlspecialchars($types[$detail['presentation_type']['value']], ENT_QUOTES));
    } else {
        $detail = array();
    }
    // trim strings
    if (xnpHasWithout($basic) || xnpHasWithout($readme) || xnpHasWithout($rights) || xnpHasWithout($detail) || xnpHasWithout($preview) || xnpHasWithout($presentation_file) || xoonips_is_multiple_field_too_long($creator_objs, 'xnppresentation', 'creator')) {
        global $system_message;
        $system_message = $system_message . "\n<br /><font color='#ff0000'>" . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
    }
    // assign to template
    global $xoopsTpl;
    $tpl = new XoopsTpl();
    $tpl->assign($xoopsTpl->get_template_vars());
    // variables assigned to xoopsTpl are copied to tpl
    $tpl->assign('basic', $basic);
    $tpl->assign('preview', $preview);
    $tpl->assign('index', $index);
    $tpl->assign('presentation_file', $presentation_file);
    $tpl->assign('attachment_dl_limit', xnpGetDownloadLimitationOptionConfirmBlock('xnppresentation'));
    $tpl->assign('attachment_dl_notify', xnpGetDownloadNotificationOptionConfirmBlock('xnppresentation'));
    $tpl->assign('detail', $detail);
    $tpl->assign('readme', $readme);
    $tpl->assign('rights', $rights);
    $tpl->assign('xnppresentation_creator', xoonips_get_multiple_field_template_vars($creator_objs, 'xnppresentation', 'creator'));
    // return HTML content
    return $tpl->fetch('db:xnppresentation_confirm_block.html');
}
function xnpbookGetConfirmBlock($item_id)
{
    $textutil =& xoonips_getutility('text');
    $formdata =& xoonips_getutility('formdata');
    $author_handler =& xoonips_getormhandler('xnpbook', 'author');
    $author_objs =& $formdata->getObjectArray('post', $author_handler->getTableName(), $author_handler, false);
    // get BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationConfirmBlock($item_id);
    $index = xnpGetIndexConfirmBlock($item_id);
    $attachment = xnpGetAttachmentConfirmBlock($item_id, 'book_pdf');
    // retrieve detail information
    $detail = array();
    if (!empty($item_id)) {
        $detail = xnpbookGetDetailInformation($item_id);
    }
    $req = _xnpbook_get_detail_request();
    foreach ($req as $key => $val) {
        $detail[$key]['value'] = $val;
    }
    // trim strings
    xnpConfirmHtml($detail, 'xnpbook_item_detail', array_keys($detail), _CHARSET);
    if (xnpHasWithout($basic) || xnpHasWithout($attachment) || xnpHasWithout($detail) || xoonips_is_multiple_field_too_long($author_objs, 'xnpbook', 'author')) {
        global $system_message;
        $system_message = _xnpbook_append_message($system_message, _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM);
    }
    // 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);
    $tpl->assign('attachment_dl_limit', xnpGetDownloadLimitationOptionConfirmBlock('xnpbook'));
    $tpl->assign('attachment_dl_notify', xnpGetDownloadNotificationOptionConfirmBlock('xnpbook'));
    $tpl->assign('detail', $detail);
    $tpl->assign('xnpbook_author', xoonips_get_multiple_field_template_vars($author_objs, 'xnpbook', 'author'));
    // return as HTML
    return $tpl->fetch('db:xnpbook_confirm_block.html');
}
function xnpconferenceGetConfirmBlock($item_id)
{
    $textutil =& xoonips_getutility('text');
    $formdata =& xoonips_getutility('formdata');
    $author_handler =& xoonips_getormhandler('xnpconference', 'author');
    $author_objs =& $formdata->getObjectArray('post', $author_handler->getTableName(), $author_handler, false);
    // get BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationConfirmBlock($item_id);
    $index = xnpGetIndexConfirmBlock($item_id);
    $presentation_file = xnpGetAttachmentConfirmBlock($item_id, 'conference_file');
    $conference_paper = xnpGetAttachmentConfirmBlock($item_id, 'conference_paper');
    $attachment_dl_limit = xnpGetDownloadLimitationOptionConfirmBlock('xnpconference');
    $attachment_dl_notify = xnpGetDownloadNotificationOptionConfirmBlock('xnpconference');
    // get DetailInformation
    $conference_title = $formdata->getValue('post', 'conference_title', 's', false);
    if (isset($conference_title)) {
        $detail = array('presentation_type' => array('value' => $textutil->html_special_chars($formdata->getValue('post', 'presentation_type', 's', false))), 'conference_title' => array('value' => $textutil->html_special_chars($formdata->getValue('post', 'conference_title', 's', false))), 'place' => array('value' => $textutil->html_special_chars($formdata->getValue('post', 'place', 's', false))), 'abstract' => array('value' => $textutil->html_special_chars($formdata->getValue('post', 'abstract', 's', false))), 'conference_from_year' => array('value' => $formdata->getValue('post', 'conferenceFromYear', 'i', false)), 'conference_from_month' => array('value' => $formdata->getValue('post', 'conferenceFromMonth', 'i', false)), 'conference_from_mday' => array('value' => $formdata->getValue('post', 'conferenceFromDay', 'i', false)), 'conference_to_year' => array('value' => $formdata->getValue('post', 'conferenceToYear', 'i', false)), 'conference_to_month' => array('value' => $formdata->getValue('post', 'conferenceToMonth', 'i', false)), 'conference_to_mday' => array('value' => $formdata->getValue('post', 'conferenceToDay', 'i', false)));
        // trim strings
        xnpConfirmHtml($detail, 'xnpconference_item_detail', array_keys($detail), _CHARSET);
        $types = xnpconferenceGetTypes();
        $detail['presentation_type_str']['value'] = $textutil->html_special_chars($types[$detail['presentation_type']['value']]);
        $conference_from = date(DATE_FORMAT, mktime(0, 0, 0, $detail['conference_from_month']['value'], $detail['conference_from_mday']['value'], $detail['conference_from_year']['value']));
        $conference_to = date(DATE_FORMAT, mktime(0, 0, 0, $detail['conference_to_month']['value'], $detail['conference_to_mday']['value'], $detail['conference_to_year']['value']));
        $conference_date = 'From: ' . $conference_from . ' To: ' . $conference_to;
    } else {
        $detail = array();
    }
    if (xnpHasWithout($basic) || xnpHasWithout($presentation_file) || xnpHasWithout($conference_paper) || xnpHasWithout($detail) || xoonips_is_multiple_field_too_long($author_objs, 'xnpconference', 'author')) {
        global $system_message;
        $system_message = $system_message . "\n<br /><font color='#ff0000'>" . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
    }
    // 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', array('name' => _MD_XOONIPS_ITEM_PUBLICATION_DATE_LABEL, 'value' => $conference_date));
    $tpl->assign('xnpconference_author', xoonips_get_multiple_field_template_vars($author_objs, 'xnpconference', 'author'));
    // return as HTML
    return $tpl->fetch('db:xnpconference_confirm_block.html');
}
function xnpmodelGetConfirmBlock($item_id)
{
    $textutil =& xoonips_getutility('text');
    $formdata =& xoonips_getutility('formdata');
    $creator_handler =& xoonips_getormhandler('xnpmodel', 'creator');
    $creator_objs =& $formdata->getObjectArray('post', $creator_handler->getTableName(), $creator_handler, false);
    // retrive creator, model_type from GET/POST array
    foreach (array('model_type', 'creator', 'readme', 'rights') as $k) {
        $tmp = $formdata->getValue('both', $k, 's', false);
        if ($tmp !== NULL) {
            ${$k} = $tmp;
        } else {
            ${$k} = false;
        }
    }
    // get BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationConfirmBlock($item_id);
    // TODO xnpConfirmHtml
    $model_types = xnpmodel_get_type_array();
    // reject if illegal model_type
    if (isset($model_types[$model_type])) {
        $detail['model_type'] = array('value' => $textutil->html_special_chars($model_type), 'display_value' => $textutil->html_special_chars($model_types[$model_type]));
    }
    $preview = xnpGetPreviewConfirmBlock($item_id);
    $attachment = xnpGetAttachmentConfirmBlock($item_id, 'model_data');
    $index = xnpGetIndexConfirmBlock($item_id);
    $lengths = xnpGetColumnLengths('xnpmodel_item_detail');
    $readme = xnpGetTextFileConfirmBlock($item_id, 'readme', $lengths['readme']);
    $rights = xnpGetRightsConfirmBlock($item_id, $lengths['rights']);
    if (xnpHasWithout($basic) || xnpHasWithout($readme) || xnpHasWithout($rights) || xnpHasWithout($detail) || xoonips_is_multiple_field_too_long($creator_objs, 'xnpmodel', 'creator')) {
        global $system_message;
        $system_message = $system_message . "\n" . '<br /><font color="#ff0000">' . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
    }
    $detail['creator_str'] = array('value' => '');
    if (!empty($detail['creator'])) {
        $detail['creator_str']['value'] = "<table>\n";
        $creator = explode("\n", $detail['creator']['value']);
        $i = 0;
        foreach ($creator as $value) {
            $detail['creator_str']['value'] .= '<tr class="oddeven' . fmod($i, 2) . '"><td>' . $value . "</td></tr>\n";
            $i++;
        }
        $detail['creator_str']['value'] .= '</table>';
        $detail['creator_cnt'] = array('value' => strval(fmod(count($creator), 2)));
    }
    // 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('preview', $preview);
    $tpl->assign('index', $index);
    $tpl->assign('attachment', $attachment);
    $tpl->assign('attachment_dl_limit', xnpGetDownloadLimitationOptionConfirmBlock('xnpmodel'));
    $tpl->assign('attachment_dl_notify', xnpGetDownloadNotificationOptionConfirmBlock('xnpmodel'));
    $tpl->assign('detail', $detail);
    $tpl->assign('readme', $readme);
    $tpl->assign('rights', $rights);
    $tpl->assign('model_type', $model_type);
    $tpl->assign('xnpmodel_creator', xoonips_get_multiple_field_template_vars($creator_objs, 'xnpmodel', 'creator'));
    // return as HTML
    return $tpl->fetch('db:xnpmodel_confirm_block.html');
}
function xnppaperGetConfirmBlock($item_id)
{
    $textutil =& xoonips_getutility('text');
    $formdata =& xoonips_getutility('formdata');
    $author_handler =& xoonips_getormhandler('xnppaper', 'author');
    $author_objs =& $formdata->getObjectArray('post', $author_handler->getTableName(), $author_handler, false);
    // retrieve blocks of BasicInformation / index
    $basic = xnpGetBasicInformationConfirmBlock($item_id);
    $index = xnpGetIndexConfirmBlock($item_id);
    $paper_pdf_reprint = xnpGetAttachmentConfirmBlock($item_id, 'paper_pdf_reprint');
    // retrieve DetailInformation
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        $detail = array('journal' => array('value' => $textutil->html_special_chars($formdata->getValue('post', 'journal', 's', false))), 'volume' => array('value' => $formdata->getValue('post', 'volume', 'i', false)), 'number' => array('value' => $formdata->getValue('post', 'number', 'i', false)), 'page' => array('value' => $textutil->html_special_chars($formdata->getValue('post', 'page', 's', false))), 'abstract' => array('value' => $textutil->html_special_chars($formdata->getValue('post', 'abstract', 's', false))), 'pubmed_id' => array('value' => $textutil->html_special_chars($formdata->getValue('post', 'pubmed_id', 's', false))));
    } else {
        $detail = array();
    }
    // trim strings
    xnpConfirmHtml($detail, 'xnppaper_item_detail', array_keys($detail), _CHARSET);
    if (xnpHasWithout($basic) || xnpHasWithout($paper_pdf_reprint) || xnpHasWithout($detail) || xoonips_is_multiple_field_too_long($author_objs, 'xnppaper', 'author')) {
        global $system_message;
        $system_message = $system_message . "\n<br /><font color='#ff0000'>" . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
    }
    // TODO: formdata integration
    if ($detail['volume']['value'] == 0) {
        $detail['volume']['value'] = '';
    }
    if ($detail['number']['value'] == 0) {
        $detail['number']['value'] = '';
    }
    // assign to template
    global $xoopsTpl;
    $tpl = new XoopsTpl();
    // variables assigned to xoopsTpl are copied to $tpl
    $tpl->assign($xoopsTpl->get_template_vars());
    $tpl->assign('basic', $basic);
    $tpl->assign('index', $index);
    $tpl->assign('paper_pdf_reprint', $paper_pdf_reprint);
    $tpl->assign('detail', $detail);
    $tpl->assign('xnppaper_author', xoonips_get_multiple_field_template_vars($author_objs, 'xnppaper', 'author'));
    // return HTML
    return $tpl->fetch('db:xnppaper_confirm_block.html');
}
function xnpfilesGetConfirmBlock($item_id)
{
    $formdata =& xoonips_getutility('formdata');
    $textutil =& xoonips_getutility('text');
    // get BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationConfirmBlock($item_id);
    $index = xnpGetIndexConfirmBlock($item_id);
    $file_file = $formdata->getFile('files_file', false);
    $data_file = xnpGetAttachmentConfirmBlock($item_id, 'files_file');
    $file_id = $formdata->getValue('post', 'files_fileFileID', 'i', false);
    // get detail information
    if (is_null($file_file) && $file_id == 0) {
        $data_file_name = '';
        $data_file_mimetype = '';
        $data_file_filetype = '';
    } else {
        if (is_null($file_file)) {
            $file_handler =& xoonips_getormhandler('xoonips', 'file');
            $file_obj =& $file_handler->get($file_id);
            $data_file_name = $file_obj->get('original_file_name', 's');
            $data_file_mimetype = $file_obj->get('mime_type', 's');
        } else {
            $data_file_name = $file_file['name'];
            $data_file_mimetype = $file_file['type'];
        }
        $file_pathinfo = pathinfo($data_file_name);
        $data_file_filetype = $file_pathinfo['extension'];
    }
    if (xnpHasWithout($basic) || xnpHasWithout($data_file)) {
        global $system_message;
        $system_message = $system_message . "\n<br /><font color='#ff0000'>" . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
    }
    // 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('data_file', $data_file);
    $tpl->assign('data_file_name', $textutil->html_special_chars($data_file_name));
    $tpl->assign('data_file_mimetype', $textutil->html_special_chars($data_file_mimetype));
    $tpl->assign('data_file_filetype', $textutil->html_special_chars($data_file_filetype));
    // return as HTML
    return $tpl->fetch('db:xnpfiles_confirm_block.html');
}
function xnpsimulatorGetConfirmBlock($item_id)
{
    $textutil =& xoonips_getutility('text');
    $formdata =& xoonips_getutility('formdata');
    $developer_handler =& xoonips_getormhandler('xnpsimulator', 'developer');
    $developer_objs =& $formdata->getObjectArray('post', $developer_handler->getTableName(), $developer_handler, false);
    // retrive detail information
    $detail = array();
    $simulator_type = $formdata->getValue('post', 'simulator_type', 's', false);
    if ($simulator_type !== false) {
        $simulator_types = xnpsimulator_get_type_array();
        $detail['simulator_type'] = array('value' => $textutil->html_special_chars($simulator_type), 'display_value' => $textutil->html_special_chars($simulator_types[$simulator_type]));
    }
    // retrieve blocks of BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationConfirmBlock($item_id);
    xnpConfirmHtml($detail, 'xnpsimulator_item_detail', array_keys($detail), _CHARSET);
    $preview = xnpGetPreviewConfirmBlock($item_id);
    $attachment = xnpGetAttachmentConfirmBlock($item_id, 'simulator_data');
    $index = xnpGetIndexConfirmBlock($item_id);
    $lengths = xnpGetColumnLengths('xnpsimulator_item_detail');
    $readme = xnpGetTextFileConfirmBlock($item_id, 'readme', $lengths['readme']);
    $rights = xnpGetRightsConfirmBlock($item_id, $lengths['rights']);
    if (xnpHasWithout($basic) || xnpHasWithout($detail) || xnpHasWithout($preview) || xnpHasWithout($attachment) || xnpHasWithout($readme) || xnpHasWithout($rights) || xoonips_is_multiple_field_too_long($developer_objs, 'xnpsimulator', 'developer')) {
        global $system_message;
        $system_message = $system_message . "\n<br /><font color='#ff0000'>" . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
    }
    // assign to template
    global $xoopsTpl;
    $tpl = new XoopsTpl();
    // variables assigned to xoopsTpl are copied to tpl
    $tpl->assign($xoopsTpl->get_template_vars());
    $tpl->assign('basic', $basic);
    $tpl->assign('preview', $preview);
    $tpl->assign('index', $index);
    $tpl->assign('attachment', $attachment);
    $tpl->assign('attachment_dl_limit', xnpGetDownloadLimitationOptionConfirmBlock('xnpsimulator'));
    $tpl->assign('attachment_dl_notify', xnpGetDownloadNotificationOptionConfirmBlock('xnpsimulator'));
    $tpl->assign('detail', $detail);
    $tpl->assign('readme', $readme);
    $tpl->assign('rights', $rights);
    if (isset($simulator_date)) {
        $tpl->assign('simulator_date', $simulator_date);
        if ($simulator_date['Date_Year']) {
            $tpl->assign('system_message', $tpl->get_template_vars('system_message') . '<br/><font color=\'#ff0000\'>' . _MD_XOONIPS_ITEM_TITLE_REQUIRED . '</font>');
        }
    }
    $tpl->assign('xnpsimulator_developer', xoonips_get_multiple_field_template_vars($developer_objs, 'xnpsimulator', 'developer'));
    // return HTML content
    return $tpl->fetch('db:xnpsimulator_confirm_block.html');
}
function xnpdataGetConfirmBlock($item_id)
{
    $formdata =& xoonips_getutility('formdata');
    $experimenter_handler =& xoonips_getormhandler('xnpdata', 'experimenter');
    $experimenter_objs =& $formdata->getObjectArray('post', $experimenter_handler->getTableName(), $experimenter_handler, false);
    $textutil =& xoonips_getutility('text');
    // get BasicInformation / Preview / index block
    $ar = array();
    $basic = xnpGetBasicInformationConfirmBlock($item_id);
    $preview = xnpGetPreviewConfirmBlock($item_id);
    $index = xnpGetIndexConfirmBlock($item_id);
    $data_file = xnpGetAttachmentConfirmBlock($item_id, 'data_file');
    $lengths = xnpGetColumnLengths('xnpdata_item_detail');
    $readme = xnpGetTextFileConfirmBlock($item_id, 'readme', $lengths['readme']);
    $rights = xnpGetRightsConfirmBlock($item_id, $lengths['rights']);
    $attachment_dl_limit = xnpGetDownloadLimitationOptionConfirmBlock('xnpdata');
    $attachment_dl_notify = xnpGetDownloadNotificationOptionConfirmBlock('xnpdata');
    // get DetailInformation
    $detail = array('data_type' => array('value' => $formdata->getValue('post', 'data_type', 's', false)));
    xnpConfirmHtml($detail, 'xnpdata_item_detail', array_keys($detail), _CHARSET);
    $types = xnpdataGetTypes();
    $detail['data_type_str'] = array('value' => $textutil->html_special_chars($types[$detail['data_type']['value']], ENT_QUOTES));
    if (xnpHasWithout($basic) || xnpHasWithout($readme) || xnpHasWithout($rights) || xnpHasWithout($detail) || xoonips_is_multiple_field_too_long($experimenter_objs, 'xnpdata', 'experimenter')) {
        global $system_message;
        $system_message = $system_message . "\n" . '<br /><font color="#ff0000">' . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
    }
    // 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('preview', $preview);
    $tpl->assign('index', $index);
    $tpl->assign('attachment_dl_limit', $attachment_dl_limit);
    $tpl->assign('attachment_dl_notify', $attachment_dl_notify);
    $tpl->assign('data_file', $data_file);
    $tpl->assign('detail', $detail);
    $tpl->assign('readme', $readme);
    $tpl->assign('rights', $rights);
    $tpl->assign('xnpdata_experimenter', xoonips_get_multiple_field_template_vars($experimenter_objs, 'xnpdata', 'experimenter'));
    // return as HTML
    return $tpl->fetch('db:xnpdata_confirm_block.html');
}
function xnpmemoGetConfirmBlock($item_id)
{
    $formdata =& xoonips_getutility('formdata');
    // get BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationConfirmBlock($item_id);
    $index = xnpGetIndexConfirmBlock($item_id);
    $memo_file = xnpGetAttachmentConfirmBlock($item_id, 'memo_file');
    // get DetailInformation
    $item_link = $formdata->getValue('post', 'item_link', 's', false);
    if (isset($item_link)) {
        $detail = array('item_link' => array('value' => $item_link));
        xnpConfirmHtml($detail, 'xnpmemo_item_detail', array_keys($detail), _CHARSET);
    } else {
        $detail = array();
    }
    if (xnpHasWithout($basic)) {
        global $system_message;
        $system_message = $system_message . "\n<br /><font color='#ff0000'>" . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
    }
    if (isset($item_link)) {
        if (xnpHasWithout($detail)) {
            global $system_message;
            $system_message = $system_message . "\n<br /><font color='#ff0000'>" . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
        }
    }
    // 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('memo_file', $memo_file);
    $tpl->assign('detail', $detail);
    // return as HTML
    return $tpl->fetch('db:xnpmemo_confirm_block.html');
}
function xnpurlGetConfirmBlock($item_id)
{
    $formdata =& xoonips_getutility('formdata');
    // retrieve blocks of BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationConfirmBlock($item_id);
    $preview = xnpGetPreviewConfirmBlock($item_id);
    $index = xnpGetIndexConfirmBlock($item_id);
    $url_banner_file = xnpurlGetUrlBannerFileConfirmBlock($item_id, 'url_banner_file');
    // retrieve detail information
    $url = $formdata->getValue('post', 'url', 's', false);
    if (isset($url)) {
        $detail = array('url' => array('value' => $url));
        xnpConfirmHtml($detail, 'xnpurl_item_detail', array_keys($detail), _CHARSET);
    } else {
        $detail = array();
    }
    // trim strings
    if (xnpHasWithout($basic) || xnpHasWithout($preview) || xnpHasWithout($detail)) {
        global $system_message;
        $system_message = $system_message . "\n<br /><font color='#ff0000'>" . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
    }
    // assign to template
    global $xoopsTpl;
    $tpl = new XoopsTpl();
    // variables assigned to xoopsTpl are copied to tpl
    $tpl->assign($xoopsTpl->get_template_vars());
    $tpl->assign('basic', $basic);
    $tpl->assign('preview', $preview);
    $tpl->assign('index', $index);
    $tpl->assign('url_banner_file', $url_banner_file);
    $tpl->assign('detail', $detail);
    // return HTML content
    return $tpl->fetch('db:xnpurl_confirm_block.html');
}
function xnpbinderGetConfirmBlock($item_id)
{
    $textutil =& xoonips_getutility('text');
    $formdata =& xoonips_getutility('formdata');
    $post_vars = array();
    foreach ($_POST as $key1 => $val1) {
        if (is_array($val1)) {
            $post_vars[$key1] = array_map(array($textutil, 'html_special_chars'), $val1);
        } else {
            $post_vars[$key1] = $textutil->html_special_chars($val1);
        }
    }
    if (xnpbinder_public_binder_has_not_public_item($formdata->getValueArray('post', 'xoonips_item_id', 'i', false), xnpbinder_get_add_to_index_id_form_data())) {
        global $xoopsTpl;
        $tpl = new XoopsTpl();
        $tpl->assign($xoopsTpl->get_template_vars());
        $tpl->assign('post_vars', $post_vars);
        $tpl->assign('message', sprintf(_MD_XNPBINDER_REMOVE_NONPUBLIC_ITEM, number_of_nonpublic_item($formdata->getValueArray('post', 'xoonips_item_id', 'i', false))));
        $tpl->assign('form_data_name_yes', 'delete_nonpublic_yes');
        return $tpl->fetch('db:xnpbinder_confirm_block2.html');
    } else {
        if (xnpbinder_group_binder_has_private_item($formdata->getValueArray('post', 'xoonips_item_id', 'i', false), xnpbinder_get_add_to_index_id_form_data())) {
            global $xoopsTpl;
            $tpl = new XoopsTpl();
            $tpl->assign($xoopsTpl->get_template_vars());
            $tpl->assign('post_vars', $post_vars);
            $tpl->assign('message', sprintf(_MD_XNPBINDER_REMOVE_PRIVATE_ITEM, number_of_private_item($formdata->getValueArray('post', 'xoonips_item_id', 'i', false))));
            $tpl->assign('form_data_name_yes', 'delete_private_yes');
            return $tpl->fetch('db:xnpbinder_confirm_block2.html');
        } else {
            // Get block of BasicInformation / Preview / index
            $basic = xnpGetBasicInformationConfirmBlock($item_id);
            $index = xnpGetIndexConfirmBlock($item_id);
            $items = xnpbinder_get_to_be_registered_items();
            if (xnpHasWithout($basic)) {
                global $system_message;
                $system_message = $system_message . "\n<br /><font color='#ff0000'>" . _MD_XOONIPS_ITEM_WARNING_FIELD_TRIM . '</font><br />';
            }
            // 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('basic', $basic);
            $tpl->assign('index', $index);
            $tpl->assign('detail', $items);
            // Output in HTML.
            return $tpl->fetch('db:xnpbinder_confirm_block.html');
        }
    }
}