Dotclear


Ignore:
Timestamp:
10/27/13 09:46:02 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add touch capacity for drag'n'drop gestures on screen, addresses #1802

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/preferences.php

    r2289 r2495  
    4747$default_tab = !empty($_GET['tab']) ? html::escapeHTML($_GET['tab']) : 'user-profile'; 
    4848 
    49 if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) ||  
    50      !empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction']) ||  
     49if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) || 
     50     !empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction']) || 
    5151     !empty($_GET['db-updated'])) { 
    5252     $default_tab = 'user-favorites'; 
     
    8484     { 
    8585          $pwd_check = !empty($_POST['cur_pwd']) && $core->auth->checkPassword(crypt::hmac(DC_MASTER_KEY,$_POST['cur_pwd'])); 
    86            
     86 
    8787          if ($core->auth->allowPassChange() && !$pwd_check && $user_email != $_POST['user_email']) { 
    8888               throw new Exception(__('If you want to change your email or password you must provide your current password.')); 
    8989          } 
    90            
     90 
    9191          $cur = $core->con->openCursor($core->prefix.'user'); 
    92            
     92 
    9393          $cur->user_name = $user_name = $_POST['user_name']; 
    9494          $cur->user_firstname = $user_firstname = $_POST['user_firstname']; 
     
    100100 
    101101          $cur->user_options = new ArrayObject($user_options); 
    102            
     102 
    103103          if ($core->auth->allowPassChange() && !empty($_POST['new_pwd'])) 
    104104          { 
     
    106106                    throw new Exception(__('If you want to change your email or password you must provide your current password.')); 
    107107               } 
    108                 
     108 
    109109               if ($_POST['new_pwd'] != $_POST['new_pwd_c']) { 
    110110                    throw new Exception(__("Passwords don't match")); 
    111111               } 
    112                 
     112 
    113113               $cur->user_pwd = $_POST['new_pwd']; 
    114114          } 
    115            
     115 
    116116          # --BEHAVIOR-- adminBeforeUserUpdate 
    117117          $core->callBehavior('adminBeforeUserProfileUpdate',$cur,$core->auth->userID()); 
    118            
     118 
    119119          # Udate user 
    120120          $core->updUser($core->auth->userID(),$cur); 
    121            
     121 
    122122          # --BEHAVIOR-- adminAfterUserUpdate 
    123123          $core->callBehavior('adminAfterUserProfileUpdate',$cur,$core->auth->userID()); 
    124            
     124 
    125125          dcPage::addSuccessNotice(__('Personal information has been successfully updated.')); 
    126126 
     
    134134 
    135135# Update user options 
    136 if (isset($_POST['user_post_format']))  
     136if (isset($_POST['user_post_format'])) 
    137137{ 
    138138     try 
    139139     { 
    140140          $cur = $core->con->openCursor($core->prefix.'user'); 
    141            
     141 
    142142          $cur->user_name = $user_name; 
    143143          $cur->user_firstname = $user_firstname; 
     
    149149 
    150150          $cur->user_post_status = $user_post_status = $_POST['user_post_status']; 
    151            
     151 
    152152          $user_options['edit_size'] = (integer) $_POST['user_edit_size']; 
    153153          if ($user_options['edit_size'] < 1) { 
     
    156156          $user_options['post_format'] = $_POST['user_post_format']; 
    157157          $user_options['enable_wysiwyg'] = !empty($_POST['user_wysiwyg']); 
    158            
     158 
    159159          $cur->user_options = new ArrayObject($user_options); 
    160            
     160 
    161161          # --BEHAVIOR-- adminBeforeUserOptionsUpdate 
    162162          $core->callBehavior('adminBeforeUserOptionsUpdate',$cur,$core->auth->userID()); 
    163            
     163 
    164164          # Update user prefs 
    165165          $core->auth->user_prefs->accessibility->put('nodragdrop',!empty($_POST['user_acc_nodragdrop']),'boolean'); 
     
    170170          } 
    171171          $core->auth->user_prefs->interface->put('media_by_page',(integer)$_POST['user_ui_media_by_page'],'integer'); 
    172            
     172 
    173173          # Udate user 
    174174          $core->updUser($core->auth->userID(),$cur); 
    175            
     175 
    176176          # --BEHAVIOR-- adminAfterUserOptionsUpdate 
    177177          $core->callBehavior('adminAfterUserOptionsUpdate',$cur,$core->auth->userID()); 
    178            
     178 
    179179          dcPage::addSuccessNotice(__('Personal options has been successfully updated.')); 
    180180          http::redirect('preferences.php#user-options'); 
     
    192192          # --BEHAVIOR-- adminBeforeUserOptionsUpdate 
    193193          $core->callBehavior('adminBeforeDashboardOptionsUpdate',$core->auth->userID()); 
    194            
     194 
    195195          # Update user prefs 
    196196          $core->auth->user_prefs->dashboard->put('doclinks',!empty($_POST['user_dm_doclinks']),'boolean'); 
     
    199199          $core->auth->user_prefs->interface->put('iconset',(!empty($_POST['user_ui_iconset']) ? $_POST['user_ui_iconset'] : '')); 
    200200          $core->auth->user_prefs->interface->put('nofavmenu',empty($_POST['user_ui_nofavmenu']),'boolean'); 
    201            
     201 
    202202          # --BEHAVIOR-- adminAfterUserOptionsUpdate 
    203203          $core->callBehavior('adminAfterDashboardOptionsUpdate',$core->auth->userID()); 
    204            
     204 
    205205          dcPage::addSuccessNotice(__('Dashboard options has been successfully updated.')); 
    206206          http::redirect('preferences.php#user-favorites'); 
     
    213213 
    214214# Add selected favorites 
    215 if (!empty($_POST['appendaction']))  
     215if (!empty($_POST['appendaction'])) 
    216216{ 
    217217     try { 
     
    280280               unset($order[$k]); 
    281281          } 
    282      }     
     282     } 
    283283     $core->favs->setFavoriteIDs($order,false); 
    284284     if (!$core->error->flag()) { 
     
    305305     ($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')). 
    306306     dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     307     dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    307308     dcPage::jsLoad('js/jquery/jquery.pwstrength.js'). 
    308309          '<script type="text/javascript">'."\n". 
     
    320321     dcPage::jsPageTabs($default_tab). 
    321322     dcPage::jsConfirmClose('user-form'). 
    322       
     323 
    323324     # --BEHAVIOR-- adminPreferencesHeaders 
    324325     $core->callBehavior('adminPreferencesHeaders'), 
     
    386387     echo 
    387388     '<h4 class="vertical-separator pretty-title">'.__('Change my password').'</h4>'. 
    388       
     389 
    389390     '<div class="pw-table">'. 
    390391     '<p class="pw-cell"><label for="new_pwd">'.__('New password:').'</label>'. 
     
    395396     '</div>'. 
    396397     '</div>'. 
    397       
     398 
    398399     '<p><label for="new_pwd_c">'.__('Confirm new password:').'</label>'. 
    399400     form::password('new_pwd_c',20,255).'</p>'. 
    400       
     401 
    401402     '<p><label for="cur_pwd">'.__('Your current password:').'</label>'. 
    402403     form::password('cur_pwd',20,255).'</p>'. 
     
    589590 
    590591if (count($iconsets_combo) > 1) { 
    591      echo  
     592     echo 
    592593          '<div class="fieldset">'. 
    593594          '<h4>'.__('Dashboard icons').'</h4>'. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map