Skip to content

Commit

Permalink
Intégration choix thème et language dans les préférences de Leed.
Browse files Browse the repository at this point in the history
  • Loading branch information
cobalt74 committed Mar 26, 2014
1 parent 39d57a0 commit f28bb70
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 2 deletions.
2 changes: 2 additions & 0 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@
$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'])!='') {
Expand Down
1 change: 1 addition & 0 deletions locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions locale/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions locale/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 18 additions & 2 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
20 changes: 20 additions & 0 deletions templates/marigolds/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,26 @@ <h2>{function="_t('PREFERENCES')"} :</h2>
<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>
Expand Down

0 comments on commit f28bb70

Please sign in to comment.