Projet

Général

Profil

Révision 76e2e7c3

Ajouté par Assos Assos il y a environ 10 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/flag/flag_actions.module
379 379
  $fieldset = array(
380 380
    '#type' => 'fieldset',
381 381
    '#title' => t('Add a new flag action'),
382
    '#children' => '<div class="container-inline">'. drupal_render($form['flag']) . drupal_render($form['submit']) .'</div>',
382
    '#children' => '<div class="container-inline">' . drupal_render($form['flag']) . drupal_render($form['submit']) . '</div>',
383 383
    '#parents' => array('add_action'),
384 384
    '#attributes' => array(),
385 385
    '#groups' => array('add_action' => array()),
......
397 397
 *   If editing an action, an action ID must be passed in.
398 398
 * @param $flag_name
399 399
 *   If adding a new action to a flag, a flag name must be specified.
400
 *
401 400
 */
402 401
function flag_actions_form($form, &$form_state, $aid = NULL, $flag_name = NULL) {
403 402
  // This is a multistep form. Get the callback value if set and continue.
......
422 421

  
423 422
  $form['new'] = array(
424 423
    '#type' => 'value',
425
    '#value' => isset($callback) ? FALSE: TRUE,
424
    '#value' => isset($callback) ? FALSE : TRUE,
426 425
  );
427 426

  
428 427
  if (!isset($callback)) {
......
430 429

  
431 430
    $actions = $flag->get_valid_actions();
432 431
    $options = array();
433
    foreach($actions as $key => $action) {
432
    foreach ($actions as $key => $action) {
434 433
      $options[$key] = $action['label'];
435 434
    }
436 435

  
......
449 448
  }
450 449
  elseif (!isset($action)) {
451 450
    $actions = $flag->get_valid_actions();
452
    $action = (object)$actions[$callback];
451
    $action = (object) $actions[$callback];
453 452
    $action->parameters = array();
454 453
    $action->event = 'flag';
455 454
    $action->threshold = 10;
......
512 511
  }
513 512

  
514 513
  // Merge in the standard flag action form.
515
  $action_form = $callback .'_form';
514
  $action_form = $callback . '_form';
516 515
  $edit = array();
517 516
  if (function_exists($action_form)) {
518 517
    $edit += $action->parameters;
......
524 523
  }
525 524

  
526 525
  // Add a few customizations to existing flag actions.
527
  $flag_actions_form = 'flag_actions_'. $callback .'_form';
526
  $flag_actions_form = 'flag_actions_' . $callback . '_form';
528 527
  if (function_exists($flag_actions_form)) {
529 528
    $flag_actions_form($form, $flag, $edit);
530 529
  }

Formats disponibles : Unified diff