Skip to content

Commit

Permalink
Update OIDplusPagePublicIO4.class.php
Browse files Browse the repository at this point in the history
  • Loading branch information
wehowski authored Sep 15, 2024
1 parent 14548b7 commit 1e2eb0c
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion OIDplusPagePublicIO4.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ public function __construct() {
// $this->ob_privacy();
// }
$this->zipfile =OIDplus::localpath().\DIRECTORY_SEPARATOR.'frdl-plugins.zip';
$this->zipfile_info = __DIR__
.\DIRECTORY_SEPARATOR.'frdl-plugins.json';

$this->zipfile_remote_info = OIDplus::localpath().'userdata'.\DIRECTORY_SEPARATOR.'cache'
.\DIRECTORY_SEPARATOR.'frdl-plugins-remote.json';

$this->zipfile_publish = OIDplus::localpath().'frdl-plugins.json';
}


Expand Down Expand Up @@ -1160,7 +1167,8 @@ public function selfToPackage(){
&& !file_exists($zipfile)){

$this->archiveDownloadTo( OIDplus::localpath(null),
'https://registry.frdl.de/frdl-plugins.zip' ,
// 'https://registry.frdl.de/frdl-plugins.zip' ,
'https://registry.frdl.de/frdl-plugins-latest.zip' ,
// OIDplus::localpath(null).\DIRECTORY_SEPARATOR.
'frdl-plugins.zip',
false
Expand Down Expand Up @@ -2069,6 +2077,15 @@ public function gui_PAGE_ID_BRIDGE(string $id, array $out) {
.sprintf('<meta http-equiv="refresh" content="1; URL=%s">', $uri);
$handled = true;
}


if(OIDplus::authUtils()->isAdminLoggedIn() && 'POST'===$_SERVER['REQUEST_METHOD'] && isset($_POST['PUBLISH_IO4_PLUGINS_BUNDLE']) ){
$pfile= str_replace('frdl-plugins.zip', 'frdl-plugins-latest.zip', $zipfile);
if(file_exists($pfile)){
unlink($pfile);
}
copy($zipfile, $pfile);
}


$bytes=file_exists($zipfile) ? static::formatBytes(filesize($zipfile),2) : 0;
Expand All @@ -2079,6 +2096,11 @@ public function gui_PAGE_ID_BRIDGE(string $id, array $out) {
<form action="$uri" method="POST" $disabled>
<input type="submit" name="COMMIT_OR_UPDATE_IO4_PLUGINS_BUNDLE" value="COMMIT" class="btn btn-info" $disabled />
</form>
<form action="$uri" method="POST" $disabled>
<input type="submit" name="PUBLISH_IO4_PLUGINS_BUNDLE" value="PUBLISH" class="btn btn-info" $disabled />
</form>
<p>Size: $bytes</p>
HTMLCODE;
}else{
Expand Down

0 comments on commit 1e2eb0c

Please sign in to comment.