diff --git a/core/core.php b/core/core.php index 7acb76bf..fee015e1 100644 --- a/core/core.php +++ b/core/core.php @@ -2163,11 +2163,11 @@ class layout extends common { $rightItems .= '
  • ' . template::ico('users') . '
  • '; $rightItems .= '
  • ' . template::ico('brush') . '
  • '; $rightItems .= '
  • ' . template::ico('gear') . '
  • '; - // UA + // Mise à jour bloquée // if(helper::checkNewVersion()) { - // $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; + // $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; // } - // UA + // Mise à jour bloquée } $rightItems .= '
  • ' . template::ico('user', 'right') . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '
  • '; $rightItems .= '
  • ' . template::ico('logout') . '
  • '; diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 319925a2..df579c64 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -23,7 +23,10 @@ class theme extends common { 'index' => self::GROUP_ADMIN, 'menu' => self::GROUP_ADMIN, 'reset' => self::GROUP_ADMIN, - 'site' => self::GROUP_ADMIN + 'site' => self::GROUP_ADMIN, + 'manage' => self::GROUP_ADMIN, + 'themeEport' => self::GROUP_ADMIN, + 'themeImport' => self::GROUP_ADMIN ]; public static $aligns = [ 'left' => 'À gauche', @@ -440,4 +443,46 @@ class theme extends common { ]); } + /** + * Import du thème + */ + public function manage() { + // Valeurs en sortie + $this->addOutput([ + 'title' => 'Gestion des thèmes', + 'view' => 'manage' + ]); + } + + + /** + * Export du thème + */ + public function themeExport() { + // Creation du ZIP + $fileName = date('Theme Y-m-d-h-i-s', time()) . '.zip'; + $zip = new ZipArchive(); + if($zip->open('site/tmp/' . $fileName, ZipArchive::CREATE) === TRUE){ + foreach('data/theme.json' as $file) { + $zip->addFile($file); + } + } + $zip->close(); + // Téléchargement du ZIP + header('Content-Transfer-Encoding: binary'); + header('Content-Disposition: attachment; filename="' . $fileName . '"'); + header('Content-Length: ' . filesize('site/tmp/' . $fileName)); + readfile('site/tmp/' . $fileName); + // Valeurs en sortie + $this->addOutput([ + 'display' => self::DISPLAY_RAW + ]); + } + + /** + * Import du thème + */ + public function themeImport() { + } + } \ No newline at end of file diff --git a/core/module/theme/view/index/index.css b/core/module/theme/view/index/index.css index bc1803c4..a6d2e69b 100755 --- a/core/module/theme/view/index/index.css +++ b/core/module/theme/view/index/index.css @@ -21,6 +21,7 @@ footer { } #themeShowAll, #themeBack, +#themeManage, #themeAdvanced { position: relative; z-index: 11; diff --git a/core/module/theme/view/index/index.php b/core/module/theme/view/index/index.php index f04cd873..67c7dd76 100755 --- a/core/module/theme/view/index/index.php +++ b/core/module/theme/view/index/index.php @@ -5,7 +5,7 @@ ): ?>
    -
    +
    'buttonGrey', 'href' => helper::baseUrl(false), @@ -13,6 +13,13 @@ 'value' => 'Accueil' ]); ?>
    +
    + helper::baseUrl() . $this->getUrl(0) . '/manage', + 'ico' => 'download', + 'value' => 'Importer/Exporter' + ]); ?> +
    helper::baseUrl() . $this->getUrl(0) . '/advanced', @@ -30,7 +37,7 @@
    -
    +
    'buttonGrey', 'href' => helper::baseUrl(false), @@ -38,6 +45,13 @@ 'value' => 'Accueil' ]); ?>
    +
    + helper::baseUrl() . $this->getUrl(0) . '/manage', + 'ico' => 'download', + 'value' => 'Importer/Exporter' + ]); ?> +
    helper::baseUrl() . $this->getUrl(0) . '/advanced', diff --git a/core/module/theme/view/manage/manage.php b/core/module/theme/view/manage/manage.php new file mode 100644 index 00000000..085bb514 --- /dev/null +++ b/core/module/theme/view/manage/manage.php @@ -0,0 +1,24 @@ + +
    +
    + 'buttonGrey', + 'href' => helper::baseUrl(false), + 'ico' => 'home', + 'value' => 'Accueil' + ]); ?> +
    +
    + helper::baseUrl() . 'theme/themeImport', + 'value' => 'Importer les données du thème' + ]); ?> +
    +
    + helper::baseUrl() . 'theme/themeExport', + 'value' => 'Exporter les données du thème' + ]); ?> +
    +
    +