function xnppresentationGetMetaInformation($item_id) { $ret = array(); $creator_array = array(); $basic = xnpGetBasicInformationArray($item_id); $detail = xnppresentationGetDetailInformation($item_id); if (!empty($basic)) { $ret[_MD_XOONIPS_ITEM_TITLE_LABEL] = implode("\n", $basic['titles']); $ret[_MD_XOONIPS_ITEM_CONTRIBUTOR_LABEL] = $basic['contributor']; $ret[_MD_XOONIPS_ITEM_KEYWORDS_LABEL] = implode("\n", $basic['keywords']); $ret[_MD_XOONIPS_ITEM_DESCRIPTION_LABEL] = $basic['description']; $ret[_MD_XOONIPS_ITEM_DOI_LABEL] = $basic['doi']; $ret[_MD_XOONIPS_ITEM_CREATION_DATE_LABEL] = $basic['creation_date']; $ret[_MD_XOONIPS_ITEM_LAST_UPDATE_DATE_LABEL] = $basic['last_update_date']; } if (!empty($detail)) { $ret[_MD_XNPPRESENTATION_PRESENTATION_TYPE_LABEL] = $detail['presentation_type_str']; } if (!empty($basic)) { $ret[_MD_XNPPRESENTATION_DATE_LABEL] = xnpDate($basic['publication_year'], $basic['publication_month'], $basic['publication_mday']); } if (!empty($detail)) { $ret[_MD_XOONIPS_ITEM_README_LABEL] = $detail['readme']; $ret[_MD_XOONIPS_ITEM_RIGHTS_LABEL] = $detail['rights']; } $xnppresentation_handler =& xoonips_getormcompohandler('xnppresentation', 'item'); $xnppresentation =& $xnppresentation_handler->get($item_id); foreach ($xnppresentation->getVar('creator') as $creator) { $creator_array[] = $creator->getVar('creator', 'n'); } $ret[_MD_XNPPRESENTATION_CREATOR_LABEL] = implode("\n", $creator_array); return $ret; }
function xnpconferenceGetMetaInformation($item_id) { $ret = array(); $author_array = array(); $basic = xnpGetBasicInformationArray($item_id); $detail = xnpconferenceGetDetailInformation($item_id); if (!empty($basic)) { $ret[_MD_XNPCONFERENCE_PRESENTATION_TITLE_LABEL] = implode("\n", $basic['titles']); $ret[_MD_XOONIPS_ITEM_CONTRIBUTOR_LABEL] = $basic['contributor']; $ret[_MD_XOONIPS_ITEM_KEYWORDS_LABEL] = implode("\n", $basic['keywords']); $ret[_MD_XOONIPS_ITEM_DESCRIPTION_LABEL] = $basic['description']; $ret[_MD_XOONIPS_ITEM_DOI_LABEL] = $basic['doi']; $ret[_MD_XOONIPS_ITEM_CREATION_DATE_LABEL] = $basic['creation_date']; $ret[_MD_XOONIPS_ITEM_LAST_UPDATE_DATE_LABEL] = $basic['last_update_date']; } if (!empty($detail)) { $ret[_MD_XNPCONFERENCE_PRESENTATION_TYPE_LABEL] = $detail['presentation_type_str']; $ret[_MD_XNPCONFERENCE_CONFERENCE_TITLE_LABEL] = $detail['conference_title']; $ret[_MD_XNPCONFERENCE_PLACE_LABEL] = $detail['place']; $ret[_MD_XNPCONFERENCE_ABSTRACT_LABEL] = $detail['abstract']; } if (!empty($basic)) { $ret[_MD_XNPCONFERENCE_DATE_LABEL] = xnpDate($basic['publication_year'], $basic['publication_month'], $basic['publication_mday']); } $xnpconference_handler =& xoonips_getormcompohandler('xnpconference', 'item'); $xnpconference =& $xnpconference_handler->get($item_id); foreach ($xnpconference->getVar('author') as $author) { $author_array[] = $author->getVar('author', 'n'); } return $ret; }
function xnptoolGetMetaInformation($item_id) { $ret = array(); $developer_array = array(); $basic = xnpGetBasicInformationArray($item_id); $detail = xnptoolGetDetailInformation($item_id); if (!empty($basic)) { $ret[_MD_XOONIPS_ITEM_TITLE_LABEL] = implode("\n", $basic['titles']); $ret[_MD_XOONIPS_ITEM_CONTRIBUTOR_LABEL] = $basic['contributor']; $ret[_MD_XOONIPS_ITEM_KEYWORDS_LABEL] = implode("\n", $basic['keywords']); $ret[_MD_XOONIPS_ITEM_DESCRIPTION_LABEL] = $basic['description']; $ret[_MD_XOONIPS_ITEM_DOI_LABEL] = $basic['doi']; $ret[_MD_XOONIPS_ITEM_LAST_UPDATE_DATE_LABEL] = $basic['last_update_date']; $ret[_MD_XOONIPS_ITEM_CREATION_DATE_LABEL] = $basic['creation_date']; $ret[_MD_XNPTOOL_DATE_LABEL] = xnpDate($basic['publication_year'], $basic['publication_month'], $basic['publication_mday']); } if (!empty($detail)) { $ret[_MD_XNPTOOL_TOOL_TYPE_LABEL] = $detail['tool_type']['display_value']; $ret[_MD_XOONIPS_ITEM_README_LABEL] = $detail['readme']['value']; $ret[_MD_XOONIPS_ITEM_RIGHTS_LABEL] = $detail['rights']['value']; } $xnptool_handler =& xoonips_getormcompohandler('xnptool', 'item'); $xnptool =& $xnptool_handler->get($item_id); foreach ($xnptool->getVar('developer') as $developer) { $developer_array[] = $developer->getVar('developer', 'n'); } $ret[_MD_XNPTOOL_DEVELOPER_LABEL] = implode("\n", $developer_array); return $ret; }
function xnpfilesGetMetaInformation($item_id) { $ret = array(); $basic = xnpGetBasicInformationArray($item_id); $detail = xnpfilesGetDetailInformation($item_id); if (!empty($basic)) { $ret[_MD_XOONIPS_ITEM_TITLE_LABEL] = implode("\n", $basic['titles']); $ret[_MD_XOONIPS_ITEM_CONTRIBUTOR_LABEL] = $basic['contributor']; $ret[_MD_XOONIPS_ITEM_KEYWORDS_LABEL] = implode("\n", $basic['keywords']); $ret[_MD_XOONIPS_ITEM_DESCRIPTION_LABEL] = $basic['description']; $ret[_MD_XOONIPS_ITEM_DOI_LABEL] = $basic['doi']; $ret[_MD_XOONIPS_ITEM_CREATION_DATE_LABEL] = $basic['creation_date']; $ret[_MD_XOONIPS_ITEM_LAST_UPDATE_DATE_LABEL] = $basic['last_update_date']; } if (!empty($basic)) { $ret[_MD_XNPFILES_DATE_LABEL] = xnpDate($basic['publication_year'], $basic['publication_month'], $basic['publication_mday']); } return $ret; }
/** * get item basic information array * * @access public * @param string $fmt format * @return array formated strings */ function getBasicInformationArray($fmt) { $textutil =& xoonips_getutility('text'); // item type if (is_object($this->_item_type_obj)) { $item_type_id = $this->_item_type_obj->get('item_type_id'); $item_type = $this->_item_type_obj->getVar('display_name', $fmt); } else { $item_type_id = 0; $item_type = ''; } // contributor if (is_object($this->_xoops_users_obj)) { $user_name = $this->_xoops_users_obj->getVar('name', $fmt); $user_uname = $this->_xoops_users_obj->getVar('uname', $fmt); if ($user_name == '') { $contributor = $user_uname; } else { $contributor = $user_name . ' (' . $user_uname . ')'; } } else { $contributor = '(Zombie User)'; } // titles $titles = array(); foreach ($this->_item_title_objs as $item_title_obj) { $titles[] = $item_title_obj->getVar('title', $fmt); } // keywords $keywords = array(); foreach ($this->_item_keyword_objs as $item_keyword_obj) { $keywords[] = $item_keyword_obj->getVar('keyword', $fmt); } // last update date $last_update_date = xoops_getUserTimestamp($this->_item_basic_obj->get('last_update_date')); // creation date $creation_date = xoops_getUserTimestamp($this->_item_basic_obj->get('creation_date')); // publication date (year, month, mday) $publication_year = $this->_item_basic_obj->get('publication_year'); $publication_month = $this->_item_basic_obj->get('publication_month'); $publication_mday = $this->_item_basic_obj->get('publication_mday'); $publication_date = xnpDate($publication_year, $publication_month, $publication_mday); // language $lang_map = array(); $lang_ids = explode(',', _MD_XOONIPS_ITEM_LANG_OPTION_IDS); $lang_names = explode(',', _MD_XOONIPS_ITEM_LANG_OPTION_NAMES); foreach ($lang_ids as $num => $lang_id) { $lang_map[$lang_id] = $lang_names[$num]; } $lang = $this->_item_basic_obj->get('lang'); $language = isset($lang_map[$lang]) ? $lang_map[$lang] : ''; // change log if ($fmt == 'e' || $fmt == 's') { $change_log = $textutil->html_special_chars($this->_changelog); } else { $change_log = $this->_changelog; } // return array return array('item_id' => $this->_item_basic_obj->get('item_id'), 'item_url' => $this->getItemDetailUrl(), 'uid' => $this->_item_basic_obj->get('uid'), 'item_type_id' => $item_type_id, 'item_type' => $item_type, 'titles' => $titles, 'contributor' => $contributor, 'keywords' => $keywords, 'description' => $this->_item_basic_obj->getVar('description', $fmt), 'doi' => $this->_item_basic_obj->getVar('doi', $fmt), 'last_update_date' => date(DATETIME_FORMAT, $last_update_date), 'creation_date' => date(DATETIME_FORMAT, $creation_date), 'publication_year' => $publication_year, 'publication_month' => $publication_month, 'publication_mday' => $publication_mday, 'publication_date' => $publication_date, 'lang' => $lang, 'language' => $language, 'related_to' => $this->_related_to_ids, 'related_to_check' => $this->_related_to_check_ids, 'related_to_check_all' => $this->_related_to_check_all_ids, 'change_log' => $change_log); }