Browse Source

Intégration choix thème et language dans les préférences de Leed.

cobalt74 5 years ago
parent
commit
f28bb70b1e
6 changed files with 43 additions and 2 deletions
  1. 2 0
      action.php
  2. 1 0
      locale/en.json
  3. 1 0
      locale/es.json
  4. 1 0
      locale/fr.json
  5. 18 2
      settings.php
  6. 20 0
      templates/marigolds/settings.html

+ 2 - 0
action.php

@@ -186,6 +186,8 @@ switch ($action){
             $configurationManager->put('synchronisationEnableCache',$_['synchronisationEnableCache']);
             $configurationManager->put('synchronisationForceFeed',$_['synchronisationForceFeed']);
             $configurationManager->put('feedMaxEvents',$_['feedMaxEvents']);
+            $configurationManager->put('language',$_['ChgLanguage']);
+            $configurationManager->put('theme',$_['ChgTheme']);
 
             $userManager->change(array('login'=>$_['login']),array('id'=>$myUser->getId()));
             if(trim($_['password'])!='') {

+ 1 - 0
locale/en.json

@@ -187,6 +187,7 @@
  "SYNCHRONISATION_TYPE":"Synchronization type",
  "SYNCHRONIZE_COFFEE_TIME":"NB : The synchronization can take time, leave your browser do the job and go grab a coffee :).",
  "SYNCHRONIZE_NOW":"Synchronize now",
+ "THEMES":"Template",
  "TITLE":"Title",
  "TRASH_EVENTS":"Empty events",
  "UNFAVORIZE":"Unfavorize",

+ 1 - 0
locale/es.json

@@ -187,6 +187,7 @@
  "SYNCHRONISATION_TYPE":"Tipo de syncronisación",
  "SYNCHRONIZE_COFFEE_TIME":"NB : La syncronisación puede tomar cierto tiempo, deje su navegador y vaya tomarse un cafe. :)",
  "SYNCHRONIZE_NOW":"Syncronisar ahora",
+ "THEMES":"Tema",
  "TITLE":"Título",
  "TRASH_EVENTS":"Vaciar los eventos",
  "UNFAVORIZE":"Marcar no favorito",

+ 1 - 0
locale/fr.json

@@ -187,6 +187,7 @@
  "SYNCHRONISATION_TYPE":"Type de synchronisation",
  "SYNCHRONIZE_COFFEE_TIME":"NB : La synchronisation peut prendre un certain temps, laissez votre navigateur tourner et allez vous prendre un café. :)",
  "SYNCHRONIZE_NOW":"Synchroniser maintenant",
+ "THEMES":"Thème",
  "TITLE":"Titre",
  "TRASH_EVENTS":"Vider les événements",
  "UNFAVORIZE":"Défavoriser",

+ 18 - 2
settings.php

@@ -8,8 +8,24 @@
 
 require_once('header.php');
 
-
-
+// gestion de la langue
+$languageList = $i18n->languages;
+$tpl->assign('languageList',$languageList);
+$tpl->assign('currentLanguage',$configurationManager->get('language'));
+
+// gestion des thèmes
+$themesDir = 'templates/';
+$dirs = scandir($themesDir);
+foreach($dirs as $dir){
+    if(is_dir($themesDir.$dir) && !in_array($dir,array(".","..")) ){
+        $themeList[]=$dir;
+    }
+}
+sort($themeList);
+$tpl->assign('themeList',$themeList);
+$tpl->assign('currentTheme',$configurationManager->get('theme'));
+
+//autres variables de configuration
 $tpl->assign('feeds',$feedManager->populate('name'));
 $tpl->assign('folders',$folderManager->populate('name'));
 $tpl->assign('synchronisationType',$configurationManager->get('synchronisationType'));

+ 20 - 0
templates/marigolds/settings.html

@@ -146,6 +146,26 @@
                         <h3>{function="_t('GENERALITY')"}</h3>
                         <p><label for="root">{function="_t('PROJECT_ROOT')"} :</label> <input type="text" id="root" name="root" value="{$configurationManager->get('root')}"></p>
                         <h4>{function="_t('LET_SLASH_AT_END')"}</h4>
+                        <p>{function="_t('INSTALL_LANGUAGE')"} :
+                        <select name="ChgLanguage">
+                            {loop="$languageList"}
+                                {if="$value==$currentLanguage"}
+                                    <option selected=selected value='{$value}'>{$value}</option>";
+                                {else}
+                                    <option value='{$value}'>{$value}</option>";
+                                {/if}
+                            {/loop}
+                        </select></p>
+                        <p>{function="_t('THEMES')"} :
+                            <select name="ChgTheme">
+                                {loop="$themeList"}
+                                {if="$value==$currentTheme"}
+                                <option selected=selected value='{$value}'>{$value}</option>";
+                                {else}
+                                <option value='{$value}'>{$value}</option>";
+                                {/if}
+                                {/loop}
+                            </select></p>
                     </section>
 
                     <section>