make repository for extensions configurable

This commit is contained in:
Uwe Steinmann 2018-03-14 18:43:01 +01:00
parent 4ac7fe0c07
commit db3990b8b7
6 changed files with 12 additions and 3 deletions

View File

@ -375,7 +375,7 @@ class SeedDMS_Extension_Mgr {
public function updateExtensionList($force=false) { /* {{{ */
if($this->reposurl) {
if(!file_exists($this->cachedir."/repository.json") || $force) {
$file = file_get_contents($this->reposurl."/repository.json");
$file = file_get_contents($this->reposurl);
file_put_contents($this->cachedir."/repository.json", $file);
}
return true;

View File

@ -91,6 +91,8 @@ class Settings { /* {{{ */
var $_dropFolderDir = null;
// Where the backup directory is located
var $_backupDir = null;
// Where the repository for extensions is located
var $_repositoryUrl = null;
// enable removal of file from dropfolder after success import
var $_removeFromDropFolder = false;
// Where the stop word file is located
@ -483,6 +485,7 @@ class Settings { /* {{{ */
$this->_luceneDir = strval($tab["luceneDir"]);
$this->_dropFolderDir = strval($tab["dropFolderDir"]);
$this->_backupDir = strval($tab["backupDir"]);
$this->_repositoryUrl = strval($tab["repositoryUrl"]);
$this->_logFileEnable = Settings::boolVal($tab["logFileEnable"]);
$this->_logFileRotation = strval($tab["logFileRotation"]);
$this->_enableLargeFileUpload = Settings::boolVal($tab["enableLargeFileUpload"]);
@ -800,6 +803,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "luceneDir", $this->_luceneDir);
$this->setXMLAttributValue($node, "dropFolderDir", $this->_dropFolderDir);
$this->setXMLAttributValue($node, "backupDir", $this->_backupDir);
$this->setXMLAttributValue($node, "repositoryUrl", $this->_repositoryUrl);
$this->setXMLAttributValue($node, "logFileEnable", $this->_logFileEnable);
$this->setXMLAttributValue($node, "logFileRotation", $this->_logFileRotation);
$this->setXMLAttributValue($node, "enableLargeFileUpload", $this->_enableLargeFileUpload);

View File

@ -118,6 +118,7 @@ if ($action == "saveSettings")
$settings->_extraPath = addDirSep($_POST["extraPath"]);
$settings->_dropFolderDir = addDirSep($_POST["dropFolderDir"]);
$settings->_backupDir = addDirSep($_POST["backupDir"]);
$settings->_repositoryUrl = addDirSep($_POST["repositoryUrl"]);
$settings->_logFileEnable = getBoolValue("logFileEnable");
$settings->_logFileRotation = $_POST["logFileRotation"];
$settings->_enableLargeFileUpload = getBoolValue("enableLargeFileUpload");

View File

@ -32,7 +32,7 @@ if (!$user->isAdmin()) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
$reposurl = 'http://seeddms.steinmann.cx/repository';
$reposurl = $settings->_repositoryUrl;
$v = new SeedDMS_Version;
$extmgr = new SeedDMS_Extension_Mgr($settings->_rootDir."/ext", $settings->_cacheDir, $reposurl);

View File

@ -200,7 +200,7 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Bootstrap_Style {
echo "<td nowrap>".$re['author']['name']."<br /><small>".$re['author']['company']."</small></td>";
echo "<td nowrap>";
echo "<div class=\"list-action\">";
if($needsupdate && !$checkmsgs && $extmgr->isWritableExitDir())
if(!$checkmsgs && $extmgr->isWritableExitDir())
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$extname."-import\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"import\" /><input type=\"hidden\" name=\"url\" value=\"".$re['filename']."\" /><a class=\"import\" data-extname=\"".$extname."\" title=\"".getMLText('import_extension')."\"><i class=\"icon-download\"></i></a></form>";
echo "</div>";
echo "</td>";

View File

@ -434,6 +434,10 @@ if(!is_writeable($settings->_configFilePath)) {
<td><?php printMLText("settings_dropFolderDir");?>:</td>
<td><?php $this->showTextField("dropFolderDir", $settings->_dropFolderDir); ?></td>
</tr>
<tr title="<?php printMLText("settings_repositoryUrl_desc");?>">
<td><?php printMLText("settings_repositoryUrl");?>:</td>
<td><?php $this->showTextField("repositoryUrl", $settings->_repositoryUrl); ?></td>
</tr>
<tr title="<?php printMLText("settings_logFileEnable_desc");?>">
<td><?php printMLText("settings_logFileEnable");?>:</td>
<td><input name="logFileEnable" type="checkbox" <?php if ($settings->_logFileEnable) echo "checked" ?> /></td>