forked from deblan/side_menu
Merge pull request 'release v3.13.1' (#356) from develop into master
Reviewed-on: deblan/side_menu#356
This commit is contained in:
commit
aa2246a1ec
6 changed files with 80 additions and 17 deletions
|
|
@ -26,7 +26,7 @@ body:
|
|||
id: configuration
|
||||
attributes:
|
||||
label: Configuration
|
||||
description: Export the configuration using the admin page and copy/paste here ([documentation](https://deblan.gitnet.page/side_menu_doc/tips/#export-the-configuration)).
|
||||
description: Export the configuration using the admin page and copy/paste here ([documentation](https://deblan.gitnet.page/side_menu_doc/docs/FAQ/export-config/)).
|
||||
value: |
|
||||
```
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
## [Unreleased]
|
||||
|
||||
## 3.13.1
|
||||
### Fixed
|
||||
* fix #354: remove the opener when the menu is always displayed
|
||||
* fix extra margin between the logo and the opener
|
||||
|
||||
## 3.13.0
|
||||
### Added
|
||||
* show apps generated with Tables (fix #349)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ Notice
|
|||
Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**.
|
||||
In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/).
|
||||
]]></description>
|
||||
<version>3.13.0</version>
|
||||
<version>3.13.1</version>
|
||||
<licence>agpl</licence>
|
||||
<author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
|
||||
<namespace>SideMenu</namespace>
|
||||
|
|
@ -55,7 +55,7 @@ In case of downtime, you can download **Custom Menu** from [here](https://kim.de
|
|||
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc25_default_menu.png</screenshot>
|
||||
<dependencies>
|
||||
<nextcloud min-version="25" max-version="29"/>
|
||||
<php min-version="7.4"/>
|
||||
<php min-version="8.0"/>
|
||||
</dependencies>
|
||||
<settings>
|
||||
<admin>OCA\SideMenu\Settings\Admin</admin>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,75 @@
|
|||
<?php
|
||||
/**
|
||||
* Imports a json configuration into a sqlite database.
|
||||
*
|
||||
* Usage:
|
||||
* php bin/import_config.php /path/to/config.json /path/to/owncloud.db
|
||||
*/
|
||||
|
||||
$configFile = $argv[1];
|
||||
$databaseFile = $argv[2];
|
||||
function showUsageAndExit(int $code)
|
||||
{
|
||||
global $argv;
|
||||
|
||||
$content = file_get_contents($configFile);
|
||||
$config = json_decode($content, true);
|
||||
echo "${argv[0]} [--help] --config /path/to/config/config.php --file /path/to/config.json\n";
|
||||
|
||||
$pdo = new \Pdo(sprintf('sqlite:%s', $databaseFile));
|
||||
$stmt = $pdo->prepare('UPDATE oc_appconfig SET configvalue=:value WHERE configkey=:key and appid=:appId');
|
||||
exit($code);
|
||||
}
|
||||
|
||||
foreach ($config as $key => $value) {
|
||||
function value(string $shortName, string $longName, array $options, bool $required = true): ?string
|
||||
{
|
||||
$value = $options[$shortName] ?? $options[$longName] ?? null;
|
||||
|
||||
if (is_array($value)) {
|
||||
echo "To much --{$longName}\n";
|
||||
showUsageAndExit(1);
|
||||
}
|
||||
|
||||
if (empty($value) && $required) {
|
||||
echo "--{$longName} is missing\n";
|
||||
showUsageAndExit(1);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
$options = getopt('t:f:c:h', [
|
||||
'type:',
|
||||
'file:',
|
||||
'config:',
|
||||
'help',
|
||||
]);
|
||||
|
||||
$help = value('h', 'help', $options, false);
|
||||
$config = value('c', 'config', $options);
|
||||
$file = value('f', 'file', $options);
|
||||
|
||||
if (!is_readable($config) && !is_file($config)) {
|
||||
echo "No such file: {$config}\n";
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!is_readable($file) && !is_file($file)) {
|
||||
echo "No such file: {$file}\n";
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$appConfig = json_decode(file_get_contents($file), true);
|
||||
|
||||
require $config;
|
||||
|
||||
if ('mysql' === $CONFIG['dbtype']) {
|
||||
$pdo = new \PDO(
|
||||
'mysql:host='.$CONFIG['dbhost'].';dbname='.$CONFIG['dbname'],
|
||||
$CONFIG['dbuser'],
|
||||
$CONFIG['dbpassword']
|
||||
);
|
||||
} elseif ($CONFIG['dbtype']) {
|
||||
$pdo = new \PDO(sprintf('sqlite:%s', $CONFIG['datadirectory'].'/owncloud.db'));
|
||||
} else {
|
||||
echo "dbtype is not valid\n";
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$stmt = $pdo->prepare('UPDATE '.$CONFIG['dbtableprefix'].'appconfig SET configvalue=:value WHERE configkey=:key and appid=:appId');
|
||||
|
||||
foreach ($appConfig as $key => $value) {
|
||||
$stmt->execute([
|
||||
'appId' => 'side_menu',
|
||||
'key' => $key,
|
||||
|
|
|
|||
|
|
@ -89,6 +89,10 @@
|
|||
.side-menu-opener span {
|
||||
position: relative;
|
||||
left: 50px;
|
||||
display: block;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.side-menu-opener:active, .side-menu-opener:focus {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
v-bind:label="settings.name"
|
||||
v-bind:avatar="settings.avatar" />
|
||||
<AppSearch v-model:search="search" />
|
||||
<OpenerButton />
|
||||
<OpenerButton v-if="!alwaysDisplayed" />
|
||||
<Logo
|
||||
v-if="!avatar && !alwaysDisplayed && logo" v-bind:classes="{'side-menu-logo': true, 'avatardiv': false}"
|
||||
v-bind:image="logo"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue