function xnppresentationGetRegisterBlock() { global $xoopsDB; $myts =& MyTextSanitizer::getInstance(); // retrieve detail information $formdata =& xoonips_getutility('formdata'); if ($formdata->getValue('get', 'post_id', 's', false)) { $detail = array('presentation_type' => $formdata->getValue('post', 'presentation_type', 's', true)); } else { $detail = array('presentation_type' => 'other'); } // retrieve blocks of BasicInformation / Preview / index block $basic = xnpGetBasicInformationRegisterBlock(); $preview = xnpGetPreviewRegisterBlock(); $index = xnpGetIndexRegisterBlock(); $presentation_file = xnpGetAttachmentRegisterBlock('presentation_file'); $readme = xnpGetTextFileRegisterBlock('readme'); $rights = xnpGetRightsRegisterBlock(); // 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', xnpGetDownloadLimitationOptionRegisterBlock('xnppresentation')); $tpl->assign('attachment_dl_notify', xnpGetDownloadNotificationOptionRegisterBlock('xnppresentation')); $tpl->assign('detail', $detail); $tpl->assign('readme', $readme); $tpl->assign('rights', $rights); $tpl->assign('presentation_type', xnppresentationGetTypes()); $tpl->assign('presentation_type_selected', $detail['presentation_type']); $tpl->assign('xnppresentation_creator', xoonips_get_multiple_field_template_vars(xoonips_get_orm_from_post('xnppresentation', 'creator'), 'xnppresentation', 'creator')); // return HTML content return $tpl->fetch('db:xnppresentation_register_block.html'); }
function xnpbookGetRegisterBlock() { global $xoopsDB; $system_message = ''; // get BasicInformation / Preview / Readme / License / Rights / index block $basic = xnpGetBasicInformationRegisterBlock(); $index = xnpGetIndexRegisterBlock(); $attachment = xnpGetAttachmentRegisterBlock('book_pdf'); // retrive variables from POST array $req = _xnpbook_get_detail_request(true); $detail = array(); foreach ($req as $key => $val) { if ($val !== null) { $detail[$key]['value'] = $val; } } // check amazon access key and secret access key $mydirname = basename(dirname(dirname(__FILE__))); $mhandler =& xoops_gethandler('module'); $module =& $mhandler->getByDirname($mydirname); $chandler =& xoops_gethandler('config'); $mconfig = $chandler->getConfigsByCat(false, $module->mid()); $amazon_key_exist = true; if (empty($mconfig['AccessKey']) || empty($mconfig['SecretAccessKey']) || empty($mconfig['AssociateTag'])) { $amazon_key_exist = false; } // 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', xnpGetDownloadLimitationOptionRegisterBlock('xnpbook')); $tpl->assign('attachment_dl_notify', xnpGetDownloadNotificationOptionRegisterBlock('xnpbook')); $tpl->assign('detail', $detail); $tpl->assign('system_message', $tpl->get_template_vars('system_message') . $system_message); $tpl->assign('is_register', true); $tpl->assign('myurl', XOOPS_URL . '/modules/xoonips/register.php'); $tpl->assign('xnpbook_author', xoonips_get_multiple_field_template_vars(xoonips_get_orm_from_post('xnpbook', 'author'), 'xnpbook', 'author')); $tpl->assign('amazon_key_exist', $amazon_key_exist); // return as HTML return $tpl->fetch('db:xnpbook_register_block.html'); }
function xnpmodelGetRegisterBlock() { global $xoopsDB; $formdata =& xoonips_getutility('formdata'); // retrive creator, model_type from GET/POST array foreach (array('model_type', 'readme', 'rights') as $k) { $tmp = $formdata->getValue('both', $k, 's', false); if ($tmp !== NULL) { ${$k} = $tmp; } else { ${$k} = false; } } // get BasicInformation / Preview / Readme / License / index block $basic = xnpGetBasicInformationRegisterBlock(); $model_types = xnpmodel_get_type_array(); if ($model_type == false) { list($model_type) = each($model_types); } $detail = array('model_type' => array('value' => $model_type, 'display_value' => $model_types[$model_type], 'select' => xnpmodel_get_type_array())); $preview = xnpGetPreviewRegisterBlock(); $index = xnpGetIndexRegisterBlock(); $attachment = xnpGetAttachmentRegisterBlock('model_data'); $readme = xnpGetTextFileRegisterBlock('readme'); $rights = xnpGetRightsRegisterBlock(); // 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', xnpGetDownloadLimitationOptionRegisterBlock('xnpmodel')); $tpl->assign('attachment_dl_notify', xnpGetDownloadNotificationOptionRegisterBlock('xnpmodel')); $tpl->assign('detail', $detail); $tpl->assign('readme', $readme); $tpl->assign('rights', $rights); $tpl->assign('xnpmodel_creator', xoonips_get_multiple_field_template_vars(xoonips_get_orm_from_post('xnpmodel', 'creator'), 'xnpmodel', 'creator')); // return as HTML return $tpl->fetch('db:xnpmodel_register_block.html'); }
function xnpconferenceGetRegisterBlock() { $textutil =& xoonips_getutility('text'); $formdata =& xoonips_getutility('formdata'); // get DetailInformation $tpl = new XoopsTpl(); $presentation_type = $formdata->getValue('post', 'presentation_type', 's', false); $conferenceFromYear = $formdata->getValue('post', 'conferenceFromYear', 'i', false); $conferenceToYear = $formdata->getValue('post', 'conferenceToYear', 'i', false); if (isset($presentation_type)) { if (isset($conferenceFromYear)) { $tpl->assign('gmtimeFrom', mktime(0, 0, 0, $formdata->getValue('post', 'conferenceFromMonth', 'i', false, 1), $formdata->getValue('post', 'conferenceFromDay', 'i', false, 1), $conferenceFromYear)); } if (isset($conferenceToYear)) { $tpl->assign('gmtimeTo', mktime(0, 0, 0, $formdata->getValue('post', 'conferenceToMonth', 'i', false, 1), $formdata->getValue('post', 'conferenceToDay', 'i', false, 1), $conferenceToYear)); } $detail = array('presentation_type' => $textutil->html_special_chars($formdata->getValue('post', 'presentation_type', 's', false)), 'conference_title' => $textutil->html_special_chars($formdata->getValue('post', 'conference_title', 's', false)), 'place' => $textutil->html_special_chars($formdata->getValue('post', 'place', 's', false)), 'abstract' => $textutil->html_special_chars($formdata->getValue('post', 'abstract', 's', false)), 'conference_date' => array('name' => _MD_XOONIPS_ITEM_PUBLICATION_DATE_LABEL, 'value' => $tpl->fetch('db:xnpconference_date.html'))); } else { $tpl->assign('gmtimeFrom', time()); $tpl->assign('gmtimeTo', time()); $detail = array('presentation_type' => 'other', 'conference_date' => array('name' => _MD_XOONIPS_ITEM_PUBLICATION_DATE_LABEL, 'value' => $tpl->fetch('db:xnpconference_date.html')), 'conference_year' => array('name' => _MD_XOONIPS_ITEM_PUBLICATION_YEAR_LABEL, 'value' => $tpl->fetch('db:xnpconference_year.html')), 'conference_month' => array('name' => _MD_XOONIPS_ITEM_PUBLICATION_MONTH_LABEL, 'value' => $tpl->fetch('db:xnpconference_month.html')), 'conference_mday' => array('name' => _MD_XOONIPS_ITEM_PUBLICATION_MDAY_LABEL, 'value' => $tpl->fetch('db:xnpconference_mday.html'))); } // get BasicInformation / Preview / index block $basic = xnpGetBasicInformationRegisterBlock(); $index = xnpGetIndexRegisterBlock(); $presentation_file = xnpGetAttachmentRegisterBlock('conference_file'); $conference_paper = xnpGetAttachmentRegisterBlock('conference_paper'); $attachment_dl_limit = xnpGetDownloadLimitationOptionRegisterBlock('xnpconference'); $attachment_dl_notify = xnpGetDownloadNotificationOptionRegisterBlock('xnpconference'); // set to template global $xoopsTpl; $tpl = new XoopsTpl(); $tpl->assign($xoopsTpl->get_template_vars()); // copy variables in $xoopsTpl to $tpl $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('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']); $tpl->assign('conference_date', $detail['conference_date']); // return as HTML return $tpl->fetch('db:xnpconference_register_block.html'); }
function xnpsimulatorGetRegisterBlock() { $formdata =& xoonips_getutility('formdata'); // retrieve detail information $detail = array(); $simulator_types = xnpsimulator_get_type_array(); $post_id = $formdata->getValue('get', 'post_id', 's', false); if (is_null($post_id)) { $simulator_type = false; } else { $simulator_type = $formdata->getValue('post', 'simulator_type', 's', false); } if ($simulator_type == false) { list($simulator_type) = each($simulator_types); } $detail['simulator_type'] = array('value' => $simulator_type, 'display_value' => $simulator_types[$simulator_type], 'select' => $simulator_types); // retrieve blocks of BasicInformation / Preview / Readme / License / index $basic = xnpGetBasicInformationRegisterBlock(); $preview = xnpGetPreviewRegisterBlock(); $index = xnpGetIndexRegisterBlock(); $attachment = xnpGetAttachmentRegisterBlock('simulator_data'); $readme = xnpGetTextFileRegisterBlock('readme'); $rights = xnpGetRightsRegisterBlock(); // 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', xnpGetDownloadLimitationOptionRegisterBlock('xnpsimulator')); $tpl->assign('attachment_dl_notify', xnpGetDownloadNotificationOptionRegisterBlock('xnpsimulator')); $tpl->assign('detail', $detail); $tpl->assign('readme', $readme); $tpl->assign('rights', $rights); if (isset($simulator_date)) { $tpl->assign('gmtime', mktime(0, 0, 0, $simulator_date['Date_Month'], $simulator_date['Date_Day'], $simulator_date['Date_Year'])); } else { $tpl->assign('gmtime', time()); } $tpl->assign('xnpsimulator_developer', xoonips_get_multiple_field_template_vars(xoonips_get_orm_from_post('xnpsimulator', 'developer'), 'xnpsimulator', 'developer')); // return HTML content return $tpl->fetch('db:xnpsimulator_register_block.html'); }
function xnpdataGetRegisterBlock() { $textutil =& xoonips_getutility('text'); $formdata =& xoonips_getutility('formdata'); // get DetailInformation if ($formdata->getValue('get', 'post_id', 's', false)) { $detail = array('data_type' => $textutil->html_special_chars($formdata->getValue('post', 'data_type', 's', true))); } else { $detail = array('data_type' => ''); } // get BasicInformation / Preview / index block $basic = xnpGetBasicInformationRegisterBlock(); $preview = xnpGetPreviewRegisterBlock(); $index = xnpGetIndexRegisterBlock(); $data_file = xnpGetAttachmentRegisterBlock('data_file'); $readme = xnpGetTextFileRegisterBlock('readme'); $rights = xnpGetRightsRegisterBlock(); $attachment_dl_limit = xnpGetDownloadLimitationOptionRegisterBlock('xnpdata'); $attachment_dl_notify = xnpGetDownloadNotificationOptionRegisterBlock('xnpdata'); // 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('data_type', xnpdataGetTypes()); $tpl->assign('data_type_selected', $formdata->getValue('post', 'data_type', 's', false)); $tpl->assign('xnpdata_experimenter', xoonips_get_multiple_field_template_vars(xoonips_get_orm_from_post('xnpdata', 'experimenter'), 'xnpdata', 'experimenter')); // return as HTML return $tpl->fetch('db:xnpdata_register_block.html'); }
/** * * @param dirname module dirname * @param option download limit option(0:everyone, 1:login user only) */ function xnpGetDownloadNotificationOptionEditBlock($dirname, $option) { return xnpGetDownloadNotificationOptionRegisterBlock($dirname, $option); }