Skip to content

Commit

Permalink
Added indicator to project information for oai_publish status
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoBoer committed Jan 26, 2023
1 parent bfc171e commit 43eb525
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Expand Up @@ -55,7 +55,13 @@

define ("PROJECT_INFO_SHARED", "Shared");

define ("PROJECT_INFO_NOTSHARED", "Not Shared");
define ("PROJECT_INFO_PUBLISHED", "Published");

define ("PROJECT_INFO_NOTPUBLISHED", "Not Published");

define ("PROJECT_INFO_NOTSHARED", "Not shared");

define("PROJECT_INFO_OAI", "Oai status");

define ("PROJECT_INFO_PRIVATE", "Private");

Expand Down
15 changes: 15 additions & 0 deletions website_code/php/properties/properties_library.php
Expand Up @@ -1025,6 +1025,21 @@ function access_info($template_id){
return $info;
}

function oai_shared($template_id){
global $xerte_toolkits_site;

$sql = "select status from {$xerte_toolkits_site->database_table_prefix}oai_publish where template_id=? ORDER BY audith_id DESC LIMIT 1";
$params = array($_POST['template_id']);
$last_oaiTable_status = db_query_one($sql, $params)["status"];
$info = PROJECT_INFO_OAI . ": ";
if (is_null($last_oaiTable_status) || $last_oaiTable_status != "published") {
$info .= PROJECT_INFO_NOTSHARED . "<br/>";
} else {
$info .= PROJECT_INFO_SHARED . "<br/>";
}
return $info;
}

function str_replace_1st($pattern, $replacement, $subject)
{
$pos = strpos($subject, $pattern);
Expand Down
2 changes: 2 additions & 0 deletions website_code/php/templates/get_template_info.php
Expand Up @@ -44,6 +44,8 @@
$info->properties .= access_info($_POST['template_id']);
$info->properties .= sharing_info($_POST['template_id']);
$info->properties .= rss_syndication($_POST['template_id']);
$info->properties .= oai_shared($_POST['template_id']);


$statistics_available = statistics_prepare($_POST['template_id']);

Expand Down

0 comments on commit 43eb525

Please sign in to comment.