Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maven/fixes/9.1' into maven/rele…
Browse files Browse the repository at this point in the history
…ase/9.1
  • Loading branch information
metaventis-build committed Oct 1, 2024
2 parents 5c79a0d + 7e6e9aa commit febd27c
Show file tree
Hide file tree
Showing 80 changed files with 3,675 additions and 343 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ my_gdpr_modules="${SERVICES_RENDERING_SERVICE_GDPR_MODULES:-}"
my_gdpr_urls="${SERVICES_RENDERING_SERVICE_GDPR_URLS:-}"

my_viewer_enabled="${SERVICES_RENDERING_SERVICE_VIEWER_ENABLED:-true}"
admin_page_enabled="${SERVICES_RENDERING_SERVICE_ADMINPAGE_ENABLED:-true}"

my_plugins="${SERVICES_RENDERING_SERVICE_PLUGINS:-}"

Expand Down Expand Up @@ -287,6 +288,14 @@ sed -i -r 's|\$CUSTOM_CONTENT_URL =.*|\$CUSTOM_CONTENT_URL = '"'${rendering_serv
grep -q '$CUSTOM_CONTENT_URL' "${systemConf}" || echo '$CUSTOM_CONTENT_URL = '"'${rendering_service_custom_content_url}'"';' >> "${systemConf}"


adminHtaccessFile="${RS_ROOT}/admin/.htaccess"
if [[ "$admin_page_enabled" == "true" ]] ; then
if [[ -f "$adminHtaccessFile" ]] ; then
rm "$adminHtaccessFile"
fi
else
echo "Deny from all" > "$adminHtaccessFile"
fi


[[ -n $my_gdpr_modules ]] && my_gdpr_modules="'${my_gdpr_modules//,/','}'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ services:
SERVICES_RENDERING_SERVICE_PROXY_PORT: "${PROXY_PORT:-}"
SERVICES_RENDERING_SERVICE_PROXY_USER: "${PROXY_USER:-}"
SERVICES_RENDERING_SERVICE_PROXY_PASS: "${PROXY_PASS:-}"
SERVICES_RENDERING_SERVICE_ADMINPAGE_ENABLED: "${SERVICES_RENDERING_SERVICE_ADMINPAGE_ENABLED:-true}"
SERVICES_RENDERING_SERVICE_VIEWER_ENABLED: "${SERVICES_RENDERING_SERVICE_VIEWER_ENABLED:-true}"
SERVICES_RENDERING_RENDERMOODLE_URL: "${SERVICES_RENDERING_RENDERMOODLE_URL:-}"
SERVICES_RENDERING_RENDERMOODLE_TOKEN: "${SERVICES_RENDERING_RENDERMOODLE_TOKEN:-}"
Expand Down Expand Up @@ -114,4 +115,4 @@ services:
volumes:
services-rendering-database-volume-data:
services-rendering-service-volume-config:
services-rendering-service-volume-data:
services-rendering-service-volume-data:
1 change: 1 addition & 0 deletions deploy/docker/helm/service/src/main/chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
| `config.repository.host` | Set repository host | `edusharing-repository-service` |
| `config.repository.port` | Set repository port | `8080` |
| `config.repository.password` | Set repository password | `""` |
| `config.adminpage.enabled` | Enable admin page | `true` |
| `config.viewer.enabled` | Enable viewer | `true` |
| `config.rendermoodle.url` | Set URL for moodle renderer | `""` |
| `config.rendermoodle.token` | Set token for moodle renderer | `""` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ data:
SERVICES_RENDERING_SERVICE_PROXY_USER: {{ .Values.config.http.client.proxy.proxyuser | quote }}
SERVICES_RENDERING_SERVICE_PROXY_PASS: {{ .Values.config.http.client.proxy.proxypass | quote }}
SERVICES_RENDERING_SERVICE_VIEWER_ENABLED: {{ .Values.config.viewer.enabled | quote }}
SERVICES_RENDERING_SERVICE_ADMINPAGE_ENABLED: {{ .Values.config.adminpage.enabled | quote }}
SERVICES_RENDERING_RENDERMOODLE_URL: {{ .Values.config.rendermoodle.url | quote }}
SERVICES_RENDERING_RENDERMOODLE_TOKEN: {{ .Values.config.rendermoodle.token | quote }}
SERVICES_RENDERING_RENDERMOODLE_CATEGORY_ID: {{ .Values.config.rendermoodle.categoryId | quote }}
Expand All @@ -52,4 +53,4 @@ data:
SERVICES_RENDERING_VIDEO_DEFAULT_RESOLUTION: {{ .Values.config.converter.video.resolution.default | quote }}
SERVICES_RENDERING_VIDEO_THREADS: {{ .Values.config.converter.video.threads | quote }}
SERVICES_RENDERING_VIDEO_TIMEOUT: {{ .Values.config.converter.video.timeout | quote }}
SERVICES_RENDERING_H5P_DISABLE_CACHE_DELAY: {{ .Values.config.h5p.disableCacheDelay | quote }}
SERVICES_RENDERING_H5P_DISABLE_CACHE_DELAY: {{ .Values.config.h5p.disableCacheDelay | quote }}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ data:
return (pass);
}
if (req.http.range) {
return (pass);
}
if (req.restarts > 0) {
set req.hash_always_miss = true;
}
Expand Down
4 changes: 4 additions & 0 deletions deploy/docker/helm/service/src/main/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ config:
## @param config.repository.password Set repository password
password: ""

adminpage:
## @param config.adminpage.enabled Enable admin page
enabled: true

viewer:
## @param config.viewer.enabled Enable viewer
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ final public function createInstance() {
public function process($p_kind, $objectLocked = false) {

global $CC_RENDER_PATH;

if ($objectLocked) {
return parent::process(ESRender_Application_Interface::DISPLAY_MODE_LOCKED);
}
Expand Down
1 change: 1 addition & 0 deletions service/src/main/php/locale/esmain/DE/lang.common.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
->addTranslation('de', 'cannotOpenObject', 'Öffnen dieses Materials im Browser nicht möglich.')
->addTranslation('de', 'cannotOpenObjectText', 'Laden Sie das Material herunter, um es zu benutzen.')
->addTranslation('de', 'goToOrigin', 'Zur Originalseite springen')
->addTranslation('de', 'goToOriginConnector', 'Element öffnen')
->addTranslation('de', 'showDocument', 'Dokument anzeigen')
->addTranslation('de', 'showInLearningAppsOrg', 'In learningapps.org öffnen')
->addTranslation('de', 'hasNoContentLicense', 'Sie dürfen den Inhalt aufgrund von Lizenzbeschränkungen nicht verwenden.')
Expand Down
1 change: 1 addition & 0 deletions service/src/main/php/locale/esmain/EN/lang.common.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
->addTranslation('en', 'cannotOpenObject', 'This material can not be displayed in the browser.')
->addTranslation('en', 'cannotOpenObjectText', 'In order to use the material please download it.')
->addTranslation('en', 'goToOrigin', 'Go to link location')
->addTranslation('en', 'goToOriginConnector', 'Open element')
->addTranslation('en', 'showDocument', 'Show document')
->addTranslation('en', 'showInLearningAppsOrg', 'Open in learningapps.org')
->addTranslation('en', 'hasNoContentLicense', 'You\'re not allowed to use the content because of licence restrictions.')
Expand Down
2 changes: 1 addition & 1 deletion service/src/main/php/modules/h5p/H5PFramework.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public function isPatchedLibrary($library) {
WHERE name = ' . $db->quote($library['machineName']) . '
AND major_version = ' . (int)$library['majorVersion'] . '
AND minor_version = ' . (int)$library['minorVersion'] . '
AND patch_version = ' . (int)$library['patchVersion'];
AND patch_version >= ' . (int)$library['patchVersion'];

$statement = $db->query($query);
return $statement->fetch() === false;
Expand Down
1 change: 1 addition & 0 deletions service/src/main/php/modules/url/mod_url.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ protected function dynamic() {
$tempArray['metadata'] = $this -> esObject -> getMetadataHandler() -> render($this -> getTemplate(), '/metadata/dynamic');

$tempArray['title'] = $this -> esObject->getTitle();
$tempArray['ccressourcetype'] = $this -> esObject->getNodeProperty('ccm:ccressourcetype');
$tempArray['dataProtection'] = $this->getIsBehindDataProtection();
echo $Template -> render('/module/url/dynamic', $tempArray);

Expand Down
6 changes: 6 additions & 0 deletions service/src/main/php/theme/default/css/dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,4 +474,10 @@
height:100%;
min-height:calc(100vh - 150px);
border: none;
}

.edu-audio-video-element {
object-fit: cover;
max-width: 100%;
box-shadow: none;
}
13 changes: 13 additions & 0 deletions service/src/main/php/theme/default/css/embed.css
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,16 @@ a.edusharing_rendering_content {
.edusharing_rendering_wrapper {
text-align: center;
}

#docFrame {
width:100%;
height:100%;
min-height:calc(100vh - 150px);
border: none;
}

.edu-audio-video-element {
object-fit: cover;
max-width: 100%;
box-shadow: none;
}
12 changes: 12 additions & 0 deletions service/src/main/php/theme/default/css/inline.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,3 +492,15 @@
-moz-appearance: none;
}

#docFrame {
width:100%;
height:100%;
min-height:calc(100vh - 150px);
border: none;
}

.edu-audio-video-element {
object-fit: cover;
max-width: 100%;
box-shadow: none;
}
6 changes: 2 additions & 4 deletions service/src/main/php/theme/default/module/audio/dynamic.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ $_SESSION["mod_audio"][$id]=[
];
?>

<style>
<?php include(dirname(__FILE__) . '/../../css/dynamic.php'); ?>
<?php include(dirname(__FILE__) . '/../../css/metadata.css'); ?>
</style>
<link rel="stylesheet" href="<?php echo $MC_URL;?>/vendor/css/dynamic.css">
<link rel="stylesheet" href="<?php echo $MC_URL;?>/vendor/css/metadata.css">

<div class="edusharing_rendering_wrapper" vocab="http://schema.org/" typeof="WebPage">
<h1 class="edusharing_rendering_content_title"><?php echo htmlentities($title) ?></h1>
Expand Down
4 changes: 1 addition & 3 deletions service/src/main/php/theme/default/module/audio/embed.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ $_SESSION["mod_audio"][$id]=[
"authString" => $authString
];
?>
<style>
<?php include(dirname(__FILE__) . '/../../css/embed.css'); ?>
</style>
<link rel="stylesheet" href="<?php echo $MC_URL;?>/vendor/css/embed.css">
<div class="edusharing_rendering_wrapper" vocab="http://schema.org/" typeof="WebPage">
<div class="edusharing_rendering_content_wrapper" >
<div id="edusharing_rendering_content"></div>
Expand Down
13 changes: 5 additions & 8 deletions service/src/main/php/theme/default/module/audio/inline.phtml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<?php
global $Locale, $Translate, $MC_URL;
$licid = uniqid();

if ($css) {
echo '<link rel="stylesheet" href="' . $MC_URL . '/vendor/css/inline.css">';
echo '<link rel="stylesheet" href="' . $MC_URL . '/vendor/css/metadata.css">';
}
?>
<style>
<?php
if ($css){
include(dirname(__FILE__) . '/../../css/metadata.css');
include(dirname(__FILE__) . '/../../css/inline.php');
}
?>
</style>
<div class="edu_audio_wrapper">
<data class="edu_audio_data" value='<?php echo json_encode(["preview" => $preview_resource_url, "resource" => $audio_url]);?>'></data>
<?php if (isset($footer)){
Expand Down
5 changes: 4 additions & 1 deletion service/src/main/php/theme/default/module/audio/lock.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

global $Locale, $Translate, $ROOT_URI, $MC_URL;

echo '<script src="' . $MC_URL . '/vendor/js/audio/lock.js" type="text/javascript" charset="utf-8"></script>';
echo '<link rel="stylesheet" href="' . $MC_URL .'/vendor/css/audio/lock.css">';

echo '<span data-view="lock"></span>';
if($progress == 0 && $positionInConversionQueue) {
$msg1 = new Phools_Message_Default('Resource is waiting for conversion.');
Expand All @@ -18,7 +21,7 @@ if($progress == 0 && $positionInConversionQueue) {
} else {
$msg1 = new Phools_Message_Default('Resource is being converted for your view ...');
echo '<p class="renderservice_message">' . htmlentities($msg1 -> localize($Locale, $Translate), ENT_QUOTES, 'UTF-8'). ' '.$progress.'%</p>';
echo '<div style="height: 20px; max-width: 300px;border: 1px solid #ddd;" class="es_progressbar_container"><span class="es_progressbar_progress" style="display: inline-block; height: 100%; width:'.$progress.'%; background-color: #ddd;"></span></div>';
echo '<div class="es_progressbar_container"><span id="es_progressbar_progress" class="es_progressbar_progress" data-progress="' . $progress . '"></span></div>';
}
if(!empty($callback)) {
$jsonData = json_encode(['callback' => $callback, 'authString' => $authString]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (!$allowPrintAndDownload) {
'<img class="edusharing_rendering_content_preview" src="' . $previewUrl . '" alt="">';
} else {
echo '
<iframe id="docFrame" src="'.$MC_URL.'/vendor/js/pdfJS/web/index.php?file='.$content.'&pagemode=none" style="width:100%;height:100%;min-height:calc(100vh - 150px);border: none;">'.
<iframe id="docFrame" src="'.$MC_URL.'/vendor/js/pdfJS/web/index.php?file='.$content.'&pagemode=none">'.
'<h3>' . $msg['cannotOpenObject']->localize($Locale, $Translate) . '</h3>' .
'<h4>' . $msg['cannotOpenObjectText']->localize($Locale, $Translate) . '</h4>' .
'</iframe>'.
Expand All @@ -48,7 +48,7 @@ if (!$allowPrintAndDownload) {
'<img class="edusharing_rendering_content_preview" src="' . $previewUrl . '">';
} else {
echo '<div class="edusharing_rendering_content edusharing_rendering_content_embedded">' .
'<iframe src="' . $content . '#toolbar=0&pagemode=none" width="100%" height="100%" style="border: none;">' .
'<iframe id="docFrame" src="' . $content . '#toolbar=0&pagemode=none">' .
'<h3>' . $msg['cannotOpenObject']->localize($Locale, $Translate) . '</h3>' .
'<h4>' . $msg['cannotOpenObjectText']->localize($Locale, $Translate) . '</h4>' .
'</iframe>'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (!$allowPrintAndDownload) {
</style>
<div class="edusharing_rendering_wrapper" vocab="http://schema.org/" typeof="WebPage">
<div class="edusharing_rendering_content_wrapper" >
<iframe id="docFrame" src="<?php echo $MC_URL; ?>/vendor/js/pdfJS/web/index.php?file=<?php echo $content; ?>&pagemode=none" style="width:100%;height:100%;min-height:calc(100vh - 150px);mborder: none;">
<iframe id="docFrame" src="<?php echo $MC_URL; ?>/vendor/js/pdfJS/web/index.php?file=<?php echo $content; ?>&pagemode=none">
<h3><?php echo $msg['cannotOpenObject']->localize($Locale, $Translate); ?></h3>
<h4><?php echo $msg['cannotOpenObjectText']->localize($Locale, $Translate); ?></h4>
</iframe>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (!$allowPrintAndDownload) {
</style>

<div class="edusharing_rendering_content_wrapper" style="display: inline-block; width: 100%">
<iframe id="docFrame" src="<?php echo $MC_URL; ?>/vendor/js/pdfJS/web/index.php?file=<?php echo $content; ?>&pagemode=none" style="width:100%;height:100%;min-height:calc(100vh - 150px);border: none;">
<iframe id="docFrame" src="<?php echo $MC_URL; ?>/vendor/js/pdfJS/web/index.php?file=<?php echo $content; ?>&pagemode=none">
<h3><?php echo $msg['cannotOpenObject']->localize($Locale, $Translate); ?></h3>
<h4><?php echo $msg['cannotOpenObjectText']->localize($Locale, $Translate); ?></h4>
</iframe>
Expand Down
9 changes: 8 additions & 1 deletion service/src/main/php/theme/default/module/url/dynamic.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
global $Locale, $Translate;
$msg = array();
$msg['goToOrigin'] = new Phools_Message_Default('goToOrigin');
$msg['goToOriginConnector'] = new Phools_Message_Default('goToOriginConnector');
?>


Expand All @@ -21,7 +22,13 @@ $msg['goToOrigin'] = new Phools_Message_Default('goToOrigin');
}?>
<?php
//if(!$dataProtection) { ?>
<a href="<?php echo $url ?>" target="_blank" class="edusharing_rendering_content edusharing_rendering_content-origin" id="edusharing_rendering_content_href"><?php echo $msg['goToOrigin']->localize($Locale, $Translate);?></a>
<a href="<?php echo $url ?>" target="_blank" class="edusharing_rendering_content edusharing_rendering_content-origin" id="edusharing_rendering_content_href"><?php
if($ccressourcetype === 'connector') {
echo $msg['goToOriginConnector']->localize($Locale, $Translate);
} else {
echo $msg['goToOrigin']->localize($Locale, $Translate);
}
?></a>
<?php
//}
?>
Expand Down
9 changes: 8 additions & 1 deletion service/src/main/php/theme/default/module/url/embed.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
global $Locale, $Translate, $MC_URL;
$msg = array();
$msg['goToOrigin'] = new Phools_Message_Default('goToOrigin');
$msg['goToOriginConnector'] = new Phools_Message_Default('goToOriginConnector');
?>
<style>
<?php include(dirname(__FILE__) . '/../../css/inline.php'); ?>
Expand All @@ -16,7 +17,13 @@ $msg['goToOrigin'] = new Phools_Message_Default('goToOrigin');
} else {
echo $embedding;
}?>
<a href="<?php echo $url ?>" target="_blank" class="edusharing_rendering_content" data-nodeId="<?php echo $esObject-> getNode() -> ref -> id; ?>" id="edusharing_rendering_content_href"><?php echo $msg['goToOrigin']->localize($Locale, $Translate);?></a>
<a href="<?php echo $url ?>" target="_blank" class="edusharing_rendering_content" data-nodeId="<?php echo $esObject-> getNode() -> ref -> id; ?>" id="edusharing_rendering_content_href"><?php
if($ccressourcetype === 'connector') {
echo $msg['goToOriginConnector']->localize($Locale, $Translate);
} else {
echo $msg['goToOrigin']->localize($Locale, $Translate);
}
?></a>
</div>
<?php echo $footer?>
</div>
Expand Down
11 changes: 11 additions & 0 deletions service/src/main/php/vendor/css/audio/lock.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.es_progressbar_container {
height: 20px;
max-width: 300px;
border: 1px solid #ddd;
}

.es_progressbar_progress {
display: inline-block;
height: 100%; width:0;
background-color: #ddd;
}
Loading

0 comments on commit febd27c

Please sign in to comment.