Conjunto de cambios 2efe680 en sipes para modules_contrib/ctools/ctools.module
- Fecha y hora:
- 26/05/2016 18:16:05 (hace 8 años)
- Branches:
- stable, version-3.0
- Children:
- dafc8d8
- Parents:
- 49072ea
- Fichero:
-
- 1 editado
Leyenda
- No modificado
- Añadido
- Eliminado
-
modules_contrib/ctools/ctools.module
r177a560 r2efe680 1 1 <?php 2 // $Id: ctools.module,v 1.27.2.50 2010/10/15 22:11:09 merlinofchaos Exp $3 2 4 3 /** … … 11 10 */ 12 11 13 define('CTOOLS_API_VERSION', '1. 8');12 define('CTOOLS_API_VERSION', '1.9'); 14 13 15 14 /** … … 331 330 */ 332 331 function 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 } 333 336 $string = '<!-- ctools-page-' . $token . ' -->'; 334 337 ctools_set_page_token($string, 'callback', $callback); … … 392 395 ctools_include('utility'); 393 396 $items = array(); 394 _ctools_passthrough($items, 'theme');397 ctools_passthrough('ctools', 'theme', $items); 395 398 return $items; 396 399 } … … 402 405 ctools_include('utility'); 403 406 $items = array(); 404 _ctools_passthrough($items, 'menu');407 ctools_passthrough('ctools', 'menu', $items); 405 408 return $items; 406 409 } … … 411 414 function ctools_cron() { 412 415 ctools_include('utility'); 413 _ctools_passthrough($items, 'cron'); 416 $items = array(); 417 ctools_passthrough('ctools', 'cron', $items); 414 418 } 415 419 … … 440 444 441 445 return $forms; 446 } 447 448 /** 449 * Implements hook_form_alter(). 450 */ 451 function 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 */ 458 function 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; 442 466 } 443 467 … … 486 510 foreach ($replacements as $type => $type_replacements) { 487 511 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"; 489 513 } 490 514 } … … 542 566 $tokens = ctools_set_page_token(); 543 567 if (!empty($tokens)) { 568 $temp_tokens = array(); 544 569 foreach ($tokens as $token => $key) { 545 570 list($type, $argument) = $key; 546 571 switch ($type) { 547 572 case 'variable': 548 $t okens[$token] = isset($variables[$argument]) ? $variables[$argument] : '';573 $temp_tokens[$token] = isset($variables[$argument]) ? $variables[$argument] : ''; 549 574 break; 550 575 case 'callback': 551 576 if (is_string($argument) && function_exists($argument)) { 552 $t okens[$token] = $argument($variables);577 $temp_tokens[$token] = $argument($variables); 553 578 } 554 579 if (is_array($argument) && function_exists($argument[0])) { 555 580 $function = array_shift($argument); 556 581 $argument = array_merge(array(&$variables), $argument); 557 $t okens[$token] = call_user_func_array($function, $argument);582 $temp_tokens[$token] = call_user_func_array($function, $argument); 558 583 } 559 584 break; 560 585 } 561 586 } 587 $tokens = $temp_tokens; 588 unset($temp_tokens); 562 589 $variables['content'] = strtr($variables['content'], $tokens); 563 590 }
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.