Dotclear

Changeset 1762:1ec1e9f0ed5d


Ignore:
Timestamp:
09/08/13 19:34:30 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

User preferences re-factoring in progress, step 1.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/preferences.php

    r1726 r1762  
    4747 
    4848if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) ||  
    49      !empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction'])) { 
     49     !empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction']) ||  
     50     !empty($_GET['db-updated'])) { 
    5051     $default_tab = 'user-favorites'; 
    5152} elseif (!empty($_GET['updated'])) { 
     
    178179           
    179180          http::redirect('preferences.php?updated=1'); 
     181     } 
     182     catch (Exception $e) 
     183     { 
     184          $core->error->add($e->getMessage()); 
     185     } 
     186} 
     187 
     188# Dashboard options 
     189if (isset($_POST['db-options'])) { 
     190     try 
     191     { 
     192          # --BEHAVIOR-- adminBeforeUserOptionsUpdate 
     193          $core->callBehavior('adminBeforeDashboardOptionsUpdate',$core->auth->userID()); 
     194           
     195          # Update user prefs 
     196          $core->auth->user_prefs->dashboard->put('doclinks',!empty($_POST['user_dm_doclinks']),'boolean'); 
     197          $core->auth->user_prefs->dashboard->put('dcnews',!empty($_POST['user_dm_dcnews']),'boolean'); 
     198          $core->auth->user_prefs->dashboard->put('quickentry',!empty($_POST['user_dm_quickentry']),'boolean'); 
     199          $core->auth->user_prefs->interface->put('iconset',(!empty($_POST['user_ui_iconset']) ? $_POST['user_ui_iconset'] : '')); 
     200          $core->auth->user_prefs->interface->put('nofavmenu',!empty($_POST['user_ui_nofavmenu']),'boolean'); 
     201           
     202          # --BEHAVIOR-- adminAfterUserOptionsUpdate 
     203          $core->callBehavior('adminAfterDashboardOptionsUpdate',$core->auth->userID()); 
     204           
     205          http::redirect('preferences.php?db-updated=1'); 
    180206     } 
    181207     catch (Exception $e) 
     
    369395     dcPage::success(__('Personal options has been successfully updated.')); 
    370396} 
     397if (!empty($_GET['db-updated'])) { 
     398     dcPage::success(__('Dashboard options has been successfully updated.')); 
     399} 
    371400if (!empty($_GET['append'])) { 
    372401     dcPage::success(__('Favorites have been successfully added.')); 
     
    501530 
    502531echo 
    503 '</div>'. 
    504  
    505 '<div class="col">'. 
    506 '<h4>'.__('Dashboard and menu').'</h4>'. 
    507  
    508 '<p><label for="user_ui_nofavmenu" class="classic">'. 
    509 form::checkbox('user_ui_nofavmenu',1,$user_ui_nofavmenu).' '. 
    510 __('Hide My favorites menu').'</label></p>'; 
    511  
    512 if (count($iconsets_combo) > 1) { 
    513      echo  
    514           '<p><label for="user_ui_iconset" class="classic">'.__('Iconset:').'</label> '. 
    515           form::combo('user_ui_iconset',$iconsets_combo,$user_ui_iconset).'</p>'; 
    516 } else { 
    517      form::hidden('user_ui_iconset',''); 
    518 } 
    519  
    520 echo 
    521 '<h5>'.('Dashboard modules').'</h5>'. 
    522  
    523 '<p><label for="user_dm_doclinks" class="classic">'. 
    524 form::checkbox('user_dm_doclinks',1,$user_dm_doclinks).' '. 
    525 __('Display documentation links').'</label></p>'. 
    526  
    527 '<p><label for="user_dm_dcnews" class="classic">'. 
    528 form::checkbox('user_dm_dcnews',1,$user_dm_dcnews).' '. 
    529 __('Display Dotclear news').'</label></p>'. 
    530  
    531 '<p><label for="user_dm_quickentry" class="classic">'. 
    532 form::checkbox('user_dm_quickentry',1,$user_dm_quickentry).' '. 
    533 __('Display quick entry form').'</label><br class="clear" />'. //Opera sucks 
    534 '</p>'; 
    535  
    536 echo 
    537 '</div>'. 
     532'</div>'; 
     533 
     534echo 
    538535'</div>'; 
    539536 
     
    547544 
    548545# User favorites 
    549 echo '<div class="multi-part" id="user-favorites" title="'.__('My favorites').'">'; 
     546echo '<div class="multi-part" id="user-favorites" title="'.__('My dashboard').'">'; 
    550547$ws = $core->auth->user_prefs->addWorkspace('favorites'); 
    551548echo '<form action="preferences.php" method="post" id="favs-form">'; 
     
    652649echo '</div>'; # Two-cols 
    653650echo '</form>'; 
     651 
     652echo 
     653'<div class="col">'. 
     654'<form action="preferences.php" method="post" id="db-forms">'. 
     655'<h4>'.__('Dashboard and menu').'</h4>'. 
     656 
     657'<p><label for="user_ui_nofavmenu" class="classic">'. 
     658form::checkbox('user_ui_nofavmenu',1,$user_ui_nofavmenu).' '. 
     659__('Hide My favorites menu').'</label></p>'; 
     660 
     661if (count($iconsets_combo) > 1) { 
     662     echo  
     663          '<p><label for="user_ui_iconset" class="classic">'.__('Iconset:').'</label> '. 
     664          form::combo('user_ui_iconset',$iconsets_combo,$user_ui_iconset).'</p>'; 
     665} else { 
     666     form::hidden('user_ui_iconset',''); 
     667} 
     668 
     669echo 
     670'<h5>'.__('Dashboard modules').'</h5>'. 
     671 
     672'<p><label for="user_dm_doclinks" class="classic">'. 
     673form::checkbox('user_dm_doclinks',1,$user_dm_doclinks).' '. 
     674__('Display documentation links').'</label></p>'. 
     675 
     676'<p><label for="user_dm_dcnews" class="classic">'. 
     677form::checkbox('user_dm_dcnews',1,$user_dm_dcnews).' '. 
     678__('Display Dotclear news').'</label></p>'. 
     679 
     680'<p><label for="user_dm_quickentry" class="classic">'. 
     681form::checkbox('user_dm_quickentry',1,$user_dm_quickentry).' '. 
     682__('Display quick entry form').'</label><br class="clear" />'. //Opera sucks 
     683'</p>'; 
     684 
     685echo 
     686'<h4>'.__('Other options').'</h4>'; 
     687 
     688# --BEHAVIOR-- adminDashboardOptionsForm 
     689$core->callBehavior('adminDashboardOptionsForm',$core); 
     690 
     691echo 
     692'<p class="clear border-top">'. 
     693form::hidden('db-options','-'). 
     694$core->formNonce(). 
     695'<input type="submit" accesskey="s" value="'.__('Save my dashboard options').'" /></p>'. 
     696'</form>'; 
     697 
     698echo '</div>'; 
     699 
    654700echo '</div>'; # user-favorites 
    655701 
  • locales/fr/main.po

    r1760 r1762  
    33393339msgid "The URL of blog or the URL scan method might not be well set (<code>%s</code> does not return an ATOM feed)." 
    33403340msgstr "L'URL du blog ou la méthode de lecture de l'URL ne semblent pas être bien réglées (<code>%s</code> ne retourne pas un flux ATOM)" 
     3341 
     3342msgid "Dashboard options has been successfully updated." 
     3343msgstr "Les options du tableau de bord ont été enregistrées avec succès." 
     3344 
     3345msgid "Save my dashboard options" 
     3346msgstr "Enregistrer les options de mon tableau de bord" 
Note: See TracChangeset for help on using the changeset viewer.

Sites map