RFM pour les membres

'fontes' au lieu de 'fonte'
This commit is contained in:
Fred Tempez 2023-03-28 14:51:46 +02:00
parent 6ee961f618
commit e0fe61ccc7
7 changed files with 57 additions and 30 deletions

View File

@ -341,14 +341,9 @@ class layout extends common
) {
$items .= '<span id="footerDisplayMemberAccount"';
$items .= $this->getData(['theme', 'footer', 'displaymemberAccount']) === false ? ' class="displayNone">' : '>';
$items .= '<wbr>&nbsp;|&nbsp;' .
template::ico('user', [
'margin' => 'all',
'help' => 'Mon compte',
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id') . '/' . $_SESSION['csrf']
]);
$items .= '<wbr>&nbsp;|&nbsp;';
if (
$this->getData(['user', $this->getUser('id'), 'files']) === true
$this->getgroup('folder', 'share') === true
) {
$items .= '<wbr>' . template::ico('folder', [
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']),
@ -357,6 +352,11 @@ class layout extends common
'help' => 'Fichiers du site'
]);
}
$items .= '<wbr>' . template::ico('user', [
'margin' => 'all',
'help' => 'Mon compte',
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id') . '/' . $_SESSION['csrf']
]);
$items .= '<wbr>' . template::ico('logout', [
'margin' => 'all',
'help' => 'Déconnecter',
@ -497,7 +497,7 @@ class layout extends common
&& $this->getData(['theme', 'menu', 'memberBar']) === true
) {
if (
$this->getData(['user', $this->getUser('id'), 'files']) === true
$this->getGroup('folder', 'share') === true
) {
$itemsRight .= '<li>' . template::ico('folder', [
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']),

View File

@ -97,8 +97,8 @@ class core extends common
*/
// Fonts disponibles
$fontsAvailable['files'] = $this->getData(['fonts', 'files']);
$fontsAvailable['imported'] = $this->getData(['fonts', 'imported']);
$fontsAvailable['files'] = $this->getData(['font', 'files']);
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
$fontsAvailable['websafe'] = self::$fontsWebSafe;
// Fontes installées
@ -139,8 +139,8 @@ class core extends common
$fontFile = $gf ? '<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>' . $fontFile
: $fontFile;
// Enregistre la personnalisation
if (!is_dir(self::DATA_DIR . 'fonts')) {
mkdir(self::DATA_DIR . 'fonts');
if (!is_dir(self::DATA_DIR . 'font')) {
mkdir(self::DATA_DIR . 'font');
}
file_put_contents(self::DATA_DIR . 'fonts/fonts.html', $fontFile);
@ -319,8 +319,8 @@ class core extends common
$css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}';
// Enregistre les fontes
if (!is_dir(self::DATA_DIR . 'fonts')) {
mkdir(self::DATA_DIR . 'fonts');
if (!is_dir(self::DATA_DIR . 'font')) {
mkdir(self::DATA_DIR . 'font');
}
file_put_contents(self::DATA_DIR . 'fonts/fonts.html', $fontFile);
@ -343,8 +343,8 @@ class core extends common
$css = '/*' . md5(json_encode($this->getData(['admin']))) . '*/';
// Fonts disponibles
$fontsAvailable['files'] = $this->getData(['fonts', 'files']);
$fontsAvailable['imported'] = $this->getData(['fonts', 'imported']);
$fontsAvailable['files'] = $this->getData(['font', 'files']);
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
$fontsAvailable['websafe'] = self::$fontsWebSafe;
/**

View File

@ -911,6 +911,23 @@ class common
}
}
/**
* Accède aux données du groupe de l'utilisateur connecté
* @param int $key Clé de la valeur
* @return string|null
*/
public function getGroup($key1, $key2 = null) {
if (is_array($this->user) === false) {
return false;
} elseif ($key2 === null && array_key_exists($key1, $this->getData(['group', $this->user['group']]))) {
return $this->getData(['group', $this->user['group'], $key1]);
} elseif ($key2 && array_key_exists($key2, $this->getData(['group', $this->user['group'], $key1]))) {
return $this->getData(['group', $this->user['group'], $key1, $key2]);
} else {
return false;
}
}
/**
* Check qu'une valeur est transmise par la méthode _POST
* @return bool

View File

@ -347,7 +347,7 @@ class init extends common
],
'1' => [
'name' => 'Membre',
'readonly' => true,
'readonly' => false,
'comment' => 'Accède aux pages réservées et à un dossier partagé',
'path' => '/site/file/source/partage/',
'file' => [
@ -368,7 +368,9 @@ class init extends common
'delete' => false,
'rename' => false,
'copycut' => false,
'permission' => false
'permission' => false,
'share' => false,
'path' => '.\/site\/file\/source\/partage\/',
]
],
'2' => [
@ -394,7 +396,9 @@ class init extends common
'delete' => true,
'rename' => true,
'copycut' => false,
'permission' => false
'permission' => false,
'share' => false,
'path' => '.\/site\/file\/source\/partage\/',
]
],
'99' => [
@ -413,7 +417,9 @@ class init extends common
'duplicate' => true,
'extract' => true,
'copycut' => true,
'permission' => true
'permission' => true,
'share' => false,
'path' => '.\/site\/file\/source\/',
],
'folder' => [
'create' => true,

View File

@ -31,7 +31,7 @@ class theme extends common
'export' => self::GROUP_ADMIN,
'import' => self::GROUP_ADMIN,
'save' => self::GROUP_ADMIN,
'fonts' => self::GROUP_ADMIN,
'font' => self::GROUP_ADMIN,
'fontAdd' => self::GROUP_ADMIN,
'fontEdit' => self::GROUP_ADMIN,
'fontDelete' => self::GROUP_ADMIN
@ -645,7 +645,7 @@ class theme extends common
// Valeurs en sortie
$this->addOutput([
'title' => helper::translate('Fontes'),
'view' => 'fonts'
'view' => 'font'
]);
}
@ -669,8 +669,8 @@ class theme extends common
$fontFamilyName = str_replace('"', '\'', $fontFamilyName);
// Supprime la fonte si elle existe dans le type inverse
if (is_array($this->getData(['fonts', $type, $fontId]))) {
$this->deleteData(['fonts', $type, $fontId]);
if (is_array($this->getData(['font', $type, $fontId]))) {
$this->deleteData(['font', $type, $fontId]);
}
// Stocker la fonte
$this->setData([
@ -733,8 +733,8 @@ class theme extends common
$fontFamilyName = str_replace('"', '\'', $fontFamilyName);
// Supprime la fonte si elle existe dans le type inverse
if (is_array($this->getData(['fonts', $type, $fontId]))) {
$this->deleteData(['fonts', $type, $fontId]);
if (is_array($this->getData(['font', $type, $fontId]))) {
$this->deleteData(['font', $type, $fontId]);
}
// Stocker les fontes

View File

@ -487,6 +487,7 @@ class user extends common
'rename' => $this->getInput('groupEditFolderRename', helper::FILTER_BOOLEAN),
'copycut' => $this->getInput('groupEditFolderCopycut', helper::FILTER_BOOLEAN),
'permission' => $this->getInput('groupEditFolderPermission', helper::FILTER_BOOLEAN),
'share' => $this->getInput('groupEditShare', helper::FILTER_BOOLEAN),
'path' => $this->getInput('groupEditPath'),
]
]

View File

@ -86,7 +86,6 @@
<?php echo helper::translate('Opérations sur les dossiers'); ?>
</h4>
<div class="row">
<div class="col2">
<?php echo template::checkbox('groupEditFolderCreate', true, 'Création', [
'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'create'])
@ -112,12 +111,16 @@
'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'permission'])
]); ?>
</div>
</div>
<div class="row">
<div class="col2">
<?php echo template::checkbox('groupEditShare', true, 'Partage', [
'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'share'])
]); ?>
</div>
<div class="col6">
<?php echo template::select('groupEditPath', $module::$sharePath, [
'label' => 'Racine du dossier partagé',
'label' => 'Racine du partage',
'selected' => $this->getData(['group', $this->getUrl(2), 'folder', 'path'])
]); ?>
</div>