Projet

Général

Profil

Révision 7e72b748

Ajouté par Assos Assos il y a plus de 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ctools/includes/context-access-admin.inc
245 245

  
246 246
// --------------------------------------------------------------------------
247 247
// AJAX menu entry points.
248

  
249 248
/**
250 249
 * AJAX callback to add a new access test to the list.
251 250
 */
251

  
252 252
function ctools_access_ajax_add($fragment = NULL, $name = NULL) {
253 253
  ctools_include('ajax');
254 254
  ctools_include('modal');
......
263 263
    ctools_ajax_render_error();
264 264
  }
265 265

  
266
  // Separate the fragment into 'module' and 'argument'
266
  // Separate the fragment into 'module' and 'argument'.
267 267
  if (strpos($fragment, '-') === FALSE) {
268 268
    $module = $fragment;
269 269
    $argument = NULL;
......
279 279

  
280 280
  list($access, $contexts) = $function($argument);
281 281

  
282
  // Make sure we have the logged in user context
282
  // Make sure we have the logged in user context.
283 283
  if (!isset($contexts['logged-in-user'])) {
284 284
    $contexts['logged-in-user'] = ctools_access_get_loggedin_context();
285 285
  }
......
306 306
  );
307 307

  
308 308
  $output = ctools_modal_form_wrapper('ctools_access_ajax_edit_item', $form_state);
309
  $access = $form_state['access'];
310
  $access['plugins'][$id] = $form_state['test'];
311

  
309 312
  if (!isset($output[0])) {
310 313
    $function = $module . '_ctools_access_set';
311 314
    if (function_exists($function)) {
......
333 336
    ctools_ajax_render_error();
334 337
  }
335 338

  
336
  // Separate the fragment into 'module' and 'argument'
339
  // Separate the fragment into 'module' and 'argument'.
337 340
  if (strpos($fragment, '-') === FALSE) {
338 341
    $module = $fragment;
339 342
    $argument = NULL;
......
353 356
    ctools_ajax_render_error();
354 357
  }
355 358

  
356
  // Make sure we have the logged in user context
359
  // Make sure we have the logged in user context.
357 360
  if (!isset($contexts['logged-in-user'])) {
358 361
    $contexts['logged-in-user'] = ctools_access_get_loggedin_context();
359 362
  }
......
372 375
  );
373 376

  
374 377
  $output = ctools_modal_form_wrapper('ctools_access_ajax_edit_item', $form_state);
378
  $access = $form_state['access'];
379
  $access['plugins'][$id] = $form_state['test'];
380

  
375 381
  if (!isset($output[0])) {
376 382
    $function = $module . '_ctools_access_set';
377 383
    if (function_exists($function)) {
......
451 457
    ajax_render_error();
452 458
  }
453 459

  
454
  // Separate the fragment into 'module' and 'argument'
460
  // Separate the fragment into 'module' and 'argument'.
455 461
  if (strpos($fragment, '-') === FALSE) {
456 462
    $module = $fragment;
457 463
    $argument = NULL;
......
471 477
    unset($access['plugins'][$id]);
472 478
  }
473 479

  
474
  // re-cache
480
  // re-cache.
475 481
  $function = $module . '_ctools_access_set';
476 482
  if (function_exists($function)) {
477 483
    $function($argument, $access);

Formats disponibles : Unified diff