mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
add missing controller
This commit is contained in:
parent
16d9cb5c1e
commit
3a2e0d70d2
81
controllers/class.ExtensionMgr.php
Normal file
81
controllers/class.ExtensionMgr.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
/**
|
||||
* Implementation of ExtensionMgr controller
|
||||
*
|
||||
* @category DMS
|
||||
* @package SeedDMS
|
||||
* @license GPL 2
|
||||
* @version @version@
|
||||
* @author Uwe Steinmann <uwe@steinmann.cx>
|
||||
* @copyright Copyright (C) 2018 Uwe Steinmann
|
||||
* @version Release: @package_version@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class which does the busines logic for managing extensions
|
||||
*
|
||||
* @category DMS
|
||||
* @package SeedDMS
|
||||
* @author Uwe Steinmann <uwe@steinmann.cx>
|
||||
* @copyright Copyright (C) 2018 Uwe Steinmann
|
||||
* @version Release: @package_version@
|
||||
*/
|
||||
class SeedDMS_Controller_ExtensionMgr extends SeedDMS_Controller_Common {
|
||||
|
||||
public function refresh() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$extmgr = $this->params['extmgr'];
|
||||
|
||||
$extmgr->createExtensionConf();
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
||||
public function download() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$settings = $this->params['settings'];
|
||||
$extmgr = $this->params['extmgr'];
|
||||
$extname = $this->params['extname'];
|
||||
|
||||
$filename = $extmgr->createArchive($extname, $GLOBALS['EXT_CONF'][$extname]['version']);
|
||||
|
||||
if(null === $this->callHook('download')) {
|
||||
if(file_exists($filename)) {
|
||||
header("Content-Transfer-Encoding: binary");
|
||||
header("Content-Length: " . filesize($filename));
|
||||
header("Content-Disposition: attachment; filename=\"" . utf8_basename($filename) . "\"; filename*=UTF-8''".utf8_basename($filename));
|
||||
header("Content-Type: application/zip");
|
||||
header("Cache-Control: must-revalidate");
|
||||
|
||||
sendFile($filename);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
||||
public function upload() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$extmgr = $this->params['extmgr'];
|
||||
$file = $this->params['file'];
|
||||
|
||||
if($extmgr->updateExtension($file))
|
||||
$extmgr->createExtensionConf();
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
||||
public function getlist() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$extmgr = $this->params['extmgr'];
|
||||
$forceupdate = $this->params['forceupdate'];
|
||||
$version = $this->params['version'];
|
||||
|
||||
if(!$extmgr->updateExtensionList($version, $forceupdate)) {
|
||||
$this->errormsg = $extmgr->getErrorMsg();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} /* }}} */
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user