Exemplo n.º 1
0
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');
}
Exemplo n.º 2
0
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');
}
Exemplo n.º 3
0
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');
}
Exemplo n.º 4
0
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');
}
Exemplo n.º 5
0
function xnppaperGetRegisterBlock()
{
    global $xoopsDB;
    $formdata =& xoonips_getutility('formdata');
    $textutil =& xoonips_getutility('text');
    if ($formdata->getValue('get', 'post_id', 's', false)) {
        $detail = _xnppaper_get_form_request();
        foreach ($detail as $key => $val) {
            $detail[$key] = $textutil->html_special_chars($detail[$key]);
        }
    } else {
        $detail = array();
    }
    // retrieve blocks of BasicInformation / index block
    $basic = xnpGetBasicInformationRegisterBlock();
    $index = xnpGetIndexRegisterBlock();
    $paper_pdf_reprint = xnpGetAttachmentRegisterBlock('paper_pdf_reprint');
    // assingn 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('index', $index);
    $tpl->assign('paper_pdf_reprint', $paper_pdf_reprint);
    $tpl->assign('detail', $detail);
    $tpl->assign('xnppaper_author', xoonips_get_multiple_field_template_vars(xoonips_get_orm_from_post('xnppaper', 'author'), 'xnppaper', 'author'));
    // for pubmed fillin
    $tpl->assign('is_register', true);
    $tpl->assign('myurl', XOOPS_URL . '/modules/xoonips/edit.php');
    // return HTML
    return $tpl->fetch('db:xnppaper_register_block.html');
}
Exemplo n.º 6
0
function xnpfilesGetRegisterBlock()
{
    $formdata =& xoonips_getutility('formdata');
    // get BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationRegisterBlock();
    if ($basic['title'] == '') {
        $basic['title'] = ' ';
    }
    $index = xnpGetIndexRegisterBlock();
    $data_file = xnpGetAttachmentRegisterBlock('files_file');
    $post_id = $formdata->getValue('get', 'post_id', 's', false);
    if (!is_null($post_id)) {
        $file_id = $formdata->getValue('post', 'files_fileFileID', 'i', false);
        if ($file_id == 0) {
            $data_file_name = '';
            $data_file_mimetype = '';
            $data_file_filetype = '';
        } else {
            $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');
            $file_pathinfo = pathinfo($data_file_name);
            $data_file_filetype = $file_pathinfo['extension'];
        }
    }
    if (isset($data_file_name)) {
        $data_file_name = array('name' => _MD_XOONIPS_ITEM_ATTACHMENT_LABEL, 'value' => $data_file_name);
    } else {
        $data_file_name = '';
    }
    if (isset($data_file_mimetype)) {
        $data_file_mimetype = array('name' => _MD_XOONIPS_ITEM_ATTACHMENT_LABEL, 'value' => $data_file_mimetype);
    } else {
        $data_file_mimetype = '';
    }
    if (isset($data_file_filetype)) {
        $data_file_filetype = array('name' => _MD_XOONIPS_ITEM_ATTACHMENT_LABEL, 'value' => $data_file_filetype);
    } else {
        $data_file_filetype = '';
    }
    // 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', $data_file_name);
    $tpl->assign('data_file_mimetype', $data_file_mimetype);
    $tpl->assign('data_file_filetype', $data_file_filetype);
    $tpl->assign('title_empty_magic', XNPFILES_ITEM_TITLE_EMPTY_MAGIC);
    // return as HTML
    return $tpl->fetch('db:xnpfiles_register_block.html');
}
Exemplo n.º 7
0
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');
}
Exemplo n.º 8
0
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');
}
Exemplo n.º 9
0
function xnpmemoGetRegisterBlock()
{
    $textutil =& xoonips_getutility('text');
    $formdata =& xoonips_getutility('formdata');
    // get DetailInformation
    if ($formdata->getValue('get', 'post_id', 's', false)) {
        $detail = array('item_link' => $textutil->html_special_chars($formdata->getValue('post', 'item_link', 's', true)));
    } else {
        $detail = array('item_link' => '');
    }
    // get BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationRegisterBlock();
    $index = xnpGetIndexRegisterBlock();
    $memo_file = xnpGetAttachmentRegisterBlock('memo_file');
    // 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_register_block.html');
}
Exemplo n.º 10
0
function xnpurlGetRegisterBlock()
{
    $textutil =& xoonips_getutility('text');
    $formdata =& xoonips_getutility('formdata');
    // get DetailInformation
    if ($formdata->getValue('get', 'post_id', 's', false)) {
        $detail = array('url' => $textutil->html_special_chars($formdata->getValue('post', 'url', 's', true)));
    } else {
        $detail = array('url' => '');
    }
    // retrieve blocks of BasicInformation / Preview / index block
    $basic = xnpGetBasicInformationRegisterBlock();
    $preview = xnpGetPreviewRegisterBlock();
    $index = xnpGetIndexRegisterBlock();
    $url_banner_file = xnpGetAttachmentRegisterBlock('url_banner_file');
    // 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_register_block.html');
}
Exemplo n.º 11
0
function xnpbinderGetRegisterBlock()
{
    $extra_param = xoonips_extra_param_restore();
    if ($extra_param) {
        $_POST['title'] = $extra_param['title'];
        $_POST['keywords'] = $extra_param['keywords'];
        $_POST['description'] = $extra_param['description'];
        $_POST['doi'] = $extra_param['doi'];
        $_POST['xoonipsCheckedXID'] = $extra_param['xoonipsCheckedXID'];
    }
    // Get Block of BasicInformation / RegisteredItem.
    $basic = xnpGetBasicInformationRegisterBlock();
    $index = xnpGetIndexRegisterBlock();
    $items = xnpbinder_get_to_be_registered_items();
    // 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);
    $tpl->assign('submit_url', 'register.php');
    // Output in HTML.
    return $tpl->fetch('db:xnpbinder_register_block.html');
}