Dotclear


Ignore:
Timestamp:
08/30/18 16:26:16 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Mainly every areas on the dashboard are now sortable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/services.php

    r3819 r3833  
    2525$core->rest->addFunction('setSectionFold', array('dcRestMethods', 'setSectionFold')); 
    2626$core->rest->addFunction('getModuleById', array('dcRestMethods', 'getModuleById')); 
     27$core->rest->addFunction('setDashboardPositions', array('dcRestMethods', 'setDashboardPositions')); 
    2728 
    2829$core->rest->serve(); 
     
    566567    } 
    567568 
     569    public static function setDashboardPositions($core, $get, $post) 
     570    { 
     571        if (empty($post['id'])) { 
     572            throw new Exception('No zone name'); 
     573        } 
     574        if (empty($post['list'])) { 
     575            throw new Exception('No sorted list of id'); 
     576        } 
     577 
     578        if ($core->auth->user_prefs->dashboard === null) { 
     579            $core->auth->user_prefs->addWorkspace('dashboard'); 
     580        } 
     581 
     582        $zone  = $post['id']; 
     583        $order = $post['list']; 
     584 
     585        $core->auth->user_prefs->dashboard->put($zone, $order); 
     586        return true; 
     587    } 
     588 
    568589    public static function getModuleById($core, $get, $post) 
    569590    { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map