Dotclear


Ignore:
Timestamp:
06/28/19 13:42:16 (6 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Switching from inline JS variables to JSON script, autocomplete system when changing author of selection of posts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/actions/class.dcactionposts.php

    r3874 r3992  
    347347            $ap->redirect(true); 
    348348        } else { 
    349             $usersList = ''; 
     349            $usersList = []; 
    350350            if ($core->auth->check('admin', $core->blog->id)) { 
    351351                $params = [ 
     
    359359                $rsStatic->lexicalSort('user_id'); 
    360360                while ($rsStatic->fetch()) { 
    361                     $usersList .= ($usersList != '' ? ',' : '') . '"' . $rsStatic->user_id . '"'; 
     361                    $usersList[] = $rsStatic->user_id; 
    362362                } 
    363363            } 
     
    369369                        __('Change author for this selection') => '']), 
    370370                dcPage::jsLoad('js/jquery/jquery.autocomplete.js') . 
    371                 '<script type="text/javascript">' . "\n" . 
    372                 'usersList = [' . $usersList . ']' . "\n" . 
    373                 "</script>\n" 
     371                dcPage::jsJson('users_list', $usersList) 
    374372            ); 
    375373 
Note: See TracChangeset for help on using the changeset viewer.

Sites map