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
  • plugins/widgets/index.php

    r2412 r2495  
    5353          } 
    5454     } 
    55            
     55 
    5656     # Append 1 widget 
    5757     $wid = false; 
     
    6060          $wid = $wid[0]; 
    6161     } 
    62       
     62 
    6363     # Append widgets 
    6464     if (!empty($addw)) 
     
    7373               $widgets_custom = new dcWidgets(); 
    7474          } 
    75            
     75 
    7676          foreach ($addw as $k => $v) 
    7777          { 
     
    9191               } 
    9292          } 
    93            
     93 
    9494          try { 
    9595               $core->blog->settings->addNamespace('widgets'); 
     
    151151          $_POST['w'] = array(); 
    152152     } 
    153       
     153 
    154154     try 
    155155     { 
     
    163163               } 
    164164          } 
    165            
     165 
    166166          if (!isset($_POST['w']['nav'])) { 
    167167               $_POST['w']['nav'] = array(); 
     
    173173               $_POST['w']['custom'] = array(); 
    174174          } 
    175            
     175 
    176176          $widgets_nav = dcWidgets::loadArray($_POST['w']['nav'],$__widgets); 
    177177          $widgets_extra = dcWidgets::loadArray($_POST['w']['extra'],$__widgets); 
    178178          $widgets_custom = dcWidgets::loadArray($_POST['w']['custom'],$__widgets); 
    179            
     179 
    180180          $core->blog->settings->addNamespace('widgets'); 
    181181          $core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store()); 
     
    183183          $core->blog->settings->widgets->put('widgets_custom',$widgets_custom->store()); 
    184184          $core->blog->triggerBlog(); 
    185            
     185 
    186186          http::redirect($p_url); 
    187187     } 
     
    200200          $core->blog->settings->widgets->put('widgets_custom',''); 
    201201          $core->blog->triggerBlog(); 
    202            
     202 
    203203          http::redirect($p_url); 
    204204     } 
     
    218218          echo 
    219219               dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 
     220               dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 
    220221               dcPage::jsLoad('index.php?pf=widgets/widgets.js'); 
    221222  ?> 
    222   <?php  
    223      $core->auth->user_prefs->addWorkspace('accessibility');  
     223  <?php 
     224     $core->auth->user_prefs->addWorkspace('accessibility'); 
    224225     $user_dm_nodragdrop = $core->auth->user_prefs->accessibility->nodragdrop; 
    225226  ?> 
     
    325326     ($w->desc() != '' ? ' <span class="form-note">'.__($w->desc()).'</span>' : '').'</dt>'. 
    326327     '<dd>'; 
    327       
     328 
    328329     $w_settings = $w->settings(); 
    329330     if (empty($w_settings)) 
     
    350351                         break; 
    351352               } 
    352                 
     353 
    353354               $widget_elements->content .= 
    354355               '<li>'. 
     
    368369{ 
    369370     $res = '<h3>'.$title.'</h3>'; 
    370       
     371 
    371372     if (!($widgets instanceof dcWidgets)) 
    372373     { 
    373374          $widgets = $default_widgets; 
    374375     } 
    375       
     376 
    376377     $res .= '<ul id="'.$id.'" class="connected">'; 
    377       
     378 
    378379     $res .= '<li class="empty-widgets" '.(!$widgets->isEmpty() ? 'style="display: none;"' : '').'>'.__('No widget for now.').'</li>'; 
    379       
     380 
    380381     $i = 0; 
    381382     foreach ($widgets->elements() as $w) 
     
    383384          $upDisabled = $i == 0 ? '" disabled="" src="images/disabled_' : '" src="images/'; 
    384385          $downDisabled = $i == count($widgets->elements())-1 ? '" disabled="" src="images/disabled_' : '" src="images/'; 
    385            
     386 
    386387          $iname = 'w['.$pr.']['.$i.']'; 
    387            
     388 
    388389          $res .= 
    389390          '<li>'.form::hidden(array($iname.'[id]'),html::escapeHTML($w->id())). 
     
    399400          '<div class="widgetSettings hidden-if-drag">'.$w->formSettings($iname,$j).'</div>'. 
    400401          '</li>'; 
    401            
     402 
    402403          $i++; 
    403404          $j++; 
    404405     } 
    405       
     406 
    406407     $res .= '</ul>'; 
    407       
     408 
    408409     $res .= '<ul class="sortable-delete"'.($i > 0 ? '':' style="display: none;"').'><li class="sortable-delete-placeholder">'. 
    409410               __('Drag widgets here to remove.').'</li></ul>'; 
    410       
     411 
    411412     return $res; 
    412413} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map