Dotclear

Changeset 3992:716640bdb480


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

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_posts_actions.js

    r3880 r3992  
    1 /*global $, dotclear, usersList */ 
     1/*global $, dotclear, getData */ 
    22'use strict'; 
    33 
     
    55  const new_auth_id = $('#new_auth_id'); 
    66  if (new_auth_id.length) { 
     7    const usersList = getData('users_list'); 
    78    new_auth_id.autocomplete(usersList, { 
    89      delay: 1000, 
  • 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