Conjunto de cambios 2efe680 en sipes para modules_contrib/ctools/ctools.module


Ignorar:
Fecha y hora:
26/05/2016 18:16:05 (hace 8 años)
Autor:
José Gregorio Puentes <jpuentes@…>
Branches:
stable, version-3.0
Children:
dafc8d8
Parents:
49072ea
Mensaje:

se actualizo el modulo

Fichero:
1 editado

Leyenda

No modificado
Añadido
Eliminado
  • modules_contrib/ctools/ctools.module

    r177a560 r2efe680  
    11<?php
    2 // $Id: ctools.module,v 1.27.2.50 2010/10/15 22:11:09 merlinofchaos Exp $
    32
    43/**
     
    1110 */
    1211
    13 define('CTOOLS_API_VERSION', '1.8');
     12define('CTOOLS_API_VERSION', '1.9');
    1413
    1514/**
     
    331330 */
    332331function ctools_set_callback_token($token, $callback) {
     332  // If the callback uses arguments they are considered in the token.
     333  if (is_array($callback)) {
     334    $token .= '-' . md5(serialize($callback));
     335  }
    333336  $string = '<!-- ctools-page-' . $token . ' -->';
    334337  ctools_set_page_token($string, 'callback', $callback);
     
    392395  ctools_include('utility');
    393396  $items = array();
    394   _ctools_passthrough($items, 'theme');
     397  ctools_passthrough('ctools', 'theme', $items);
    395398  return $items;
    396399}
     
    402405  ctools_include('utility');
    403406  $items = array();
    404   _ctools_passthrough($items, 'menu');
     407  ctools_passthrough('ctools', 'menu', $items);
    405408  return $items;
    406409}
     
    411414function ctools_cron() {
    412415  ctools_include('utility');
    413   _ctools_passthrough($items, 'cron');
     416  $items = array();
     417  ctools_passthrough('ctools', 'cron', $items);
    414418}
    415419
     
    440444
    441445  return $forms;
     446}
     447
     448/**
     449 * Implements hook_form_alter().
     450 */
     451function ctools_form_alter(&$form, $form_state, $form_id) {
     452  $form['#after_build'][] = 'ctools_ajax_form_after_build';
     453}
     454
     455/**
     456 * #after_build callback: Mark the $form['#action'] as a trusted URL for Ajax.
     457 */
     458function ctools_ajax_form_after_build($form, $form_state) {
     459  $settings = array(
     460    'CToolsUrlIsAjaxTrusted' => array(
     461      $form['#action'] => TRUE,
     462    ),
     463  );
     464  drupal_add_js($settings, 'setting');
     465  return $form;
    442466}
    443467
     
    486510    foreach ($replacements as $type => $type_replacements) {
    487511      foreach ($type_replacements as $old_path => $new_filename) {
    488         $replacements[$type][$old_path] = JQUERY_UPDATE_REPLACE_PATH . "/$new_filename";
     512        $replacements[$type][$old_path] = drupal_get_path('module', 'jquery_update') . "/replace/$new_filename";
    489513      }
    490514    }
     
    542566  $tokens = ctools_set_page_token();
    543567  if (!empty($tokens)) {
     568    $temp_tokens = array();
    544569    foreach ($tokens as $token => $key) {
    545570      list($type, $argument) = $key;
    546571      switch ($type) {
    547572        case 'variable':
    548           $tokens[$token] = isset($variables[$argument]) ? $variables[$argument] : '';
     573          $temp_tokens[$token] = isset($variables[$argument]) ? $variables[$argument] : '';
    549574          break;
    550575        case 'callback':
    551576          if (is_string($argument) && function_exists($argument)) {
    552             $tokens[$token] = $argument($variables);
     577            $temp_tokens[$token] = $argument($variables);
    553578          }
    554579          if (is_array($argument) && function_exists($argument[0])) {
    555580            $function = array_shift($argument);
    556581            $argument = array_merge(array(&$variables), $argument);
    557             $tokens[$token] = call_user_func_array($function, $argument);
     582            $temp_tokens[$token] = call_user_func_array($function, $argument);
    558583          }
    559584          break;
    560585      }
    561586    }
     587    $tokens = $temp_tokens;
     588    unset($temp_tokens);
    562589    $variables['content'] = strtr($variables['content'], $tokens);
    563590  }
Nota: Vea TracChangeset para ayuda en el uso del visor de conjuntos de cambios.