Projet

Général

Profil

Révision 96a203dd

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ctools/ctools.module
298 298

  
299 299
/**
300 300
 * Set a token/value pair to be replaced later in the request, specifically in
301
 * ctools_preprocess_page().
301
 * ctools_page_token_processing().
302 302
 *
303 303
 * @param $token
304 304
 *   The token to be replaced later, during page rendering.  This should
......
654 654
      list($type, $argument) = $key;
655 655
      switch ($type) {
656 656
        case 'variable':
657
          $tokens[$token] = isset($variables[$argument]) ? $variables[$argument] : '';
657
          $tokens[$token] = isset($elements[$argument]) ? $elements[$argument] : '';
658 658
          break;
659 659
        case 'callback':
660 660
          if (is_string($argument) && function_exists($argument)) {
661
            $tokens[$token] = $argument($variables);
661
            $tokens[$token] = $argument($elements);
662 662
          }
663 663
          if (is_array($argument) && function_exists($argument[0])) {
664 664
            $function = array_shift($argument);
665
            $argument = array_merge(array(&$variables), $argument);
665
            $argument = array_merge(array(&$elements), $argument);
666 666
            $tokens[$token] = call_user_func_array($function, $argument);
667 667
          }
668 668
          break;

Formats disponibles : Unified diff