updated etxlink, ctools, colorbox, computed_field
This commit is contained in:
@@ -47,7 +47,7 @@ function ctools_wizard_multistep_form($form_info, $step, &$form_state) {
|
||||
// with form caching.
|
||||
ctools_form_include($form_state, 'wizard');
|
||||
|
||||
// allow order array to be optional
|
||||
// Allow order array to be optional.
|
||||
if (empty($form_info['order'])) {
|
||||
foreach ($form_info['forms'] as $step_id => $params) {
|
||||
$form_info['order'][$step_id] = $params['title'];
|
||||
@@ -83,7 +83,7 @@ function ctools_wizard_multistep_form($form_info, $step, &$form_state) {
|
||||
$form_info['cache location'] = 'storage';
|
||||
}
|
||||
|
||||
// If absolutely nothing was set for the cache area to work on
|
||||
// If absolutely nothing was set for the cache area to work on.
|
||||
if (!isset($form_state[$form_info['cache location']])) {
|
||||
ctools_include('cache');
|
||||
$form_state[$form_info['cache location']] = ctools_cache_get($form_info['cache mechanism'], $form_info['cache key']);
|
||||
@@ -199,7 +199,7 @@ function ctools_wizard_multistep_form($form_info, $step, &$form_state) {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (isset($form_state['ajax next'])) {
|
||||
elseif (isset($form_state['ajax next'])) {
|
||||
// Clear a few items off the form state so we don't double post:
|
||||
$next = $form_state['ajax next'];
|
||||
unset($form_state['ajax next']);
|
||||
@@ -299,7 +299,7 @@ function ctools_wizard_wrapper($form, &$form_state) {
|
||||
'#wizard type' => 'next',
|
||||
'#weight' => -2000,
|
||||
'#limit_validation_errors' => array(),
|
||||
// hardcode the submit so that it doesn't try to save data.
|
||||
// Hardcode the submit so that it doesn't try to save data.
|
||||
'#submit' => array('ctools_wizard_submit'),
|
||||
'#attributes' => $button_attributes,
|
||||
);
|
||||
@@ -325,19 +325,18 @@ function ctools_wizard_wrapper($form, &$form_state) {
|
||||
// end of the form list (i.e, there is a next) then it's "update and return"
|
||||
// to be clear. If this is the end of the path and there is no next, we
|
||||
// call it 'Finish'.
|
||||
|
||||
// Even if there is no direct return path (some forms may not want you
|
||||
// leaving in the middle) the final button is always a Finish and it does
|
||||
// whatever the return action is.
|
||||
if (!empty($form_info['show return']) && !empty($form_state['next'])) {
|
||||
$form['buttons']['return'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => $form_info['return text'],
|
||||
'#value' => $form_info['return text'],
|
||||
'#wizard type' => 'return',
|
||||
'#attributes' => $button_attributes,
|
||||
);
|
||||
}
|
||||
else if (empty($form_state['next']) || !empty($form_info['free trail'])) {
|
||||
elseif (empty($form_state['next']) || !empty($form_info['free trail'])) {
|
||||
$form['buttons']['return'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => $form_info['finish text'],
|
||||
@@ -352,7 +351,7 @@ function ctools_wizard_wrapper($form, &$form_state) {
|
||||
'#type' => 'submit',
|
||||
'#value' => $form_info['cancel text'],
|
||||
'#wizard type' => 'cancel',
|
||||
// hardcode the submit so that it doesn't try to save data.
|
||||
// Hardcode the submit so that it doesn't try to save data.
|
||||
'#limit_validation_errors' => array(),
|
||||
'#submit' => array('ctools_wizard_submit'),
|
||||
'#attributes' => $button_attributes,
|
||||
@@ -370,7 +369,6 @@ function ctools_wizard_wrapper($form, &$form_state) {
|
||||
|
||||
// Set up our submit handler after theirs. Since putting something here will
|
||||
// skip Drupal's autodetect, we autodetect for it.
|
||||
|
||||
// We make sure ours is after theirs so that they get to change #next if
|
||||
// the want to.
|
||||
$form['#submit'] = array();
|
||||
@@ -398,7 +396,7 @@ function ctools_wizard_wrapper($form, &$form_state) {
|
||||
|
||||
$params = array($url, $options);
|
||||
}
|
||||
$form['#action'] = call_user_func_array('url', $params);
|
||||
$form['#action'] = call_user_func_array('url', $params);
|
||||
}
|
||||
|
||||
if (isset($info['wrapper']) && function_exists($info['wrapper'])) {
|
||||
@@ -418,7 +416,7 @@ function ctools_wizard_submit(&$form, &$form_state) {
|
||||
if (isset($form_state['clicked_button']['#wizard type'])) {
|
||||
$type = $form_state['clicked_button']['#wizard type'];
|
||||
|
||||
// if AJAX enabled, we proceed slightly differently here.
|
||||
// If AJAX enabled, we proceed slightly differently here.
|
||||
if (!empty($form_state['ajax'])) {
|
||||
if ($type == 'next') {
|
||||
$form_state['ajax next'] = $form_state['clicked_button']['#next'];
|
||||
@@ -428,7 +426,7 @@ function ctools_wizard_submit(&$form, &$form_state) {
|
||||
if ($type == 'cancel' && isset($form_state['form_info']['cancel path'])) {
|
||||
$form_state['redirect'] = $form_state['form_info']['cancel path'];
|
||||
}
|
||||
else if ($type == 'next') {
|
||||
elseif ($type == 'next') {
|
||||
$form_state['redirect'] = ctools_wizard_get_path($form_state['form_info'], $form_state['clicked_button']['#next']);
|
||||
if (!empty($_GET['destination'])) {
|
||||
// We don't want drupal_goto redirect this request
|
||||
@@ -437,10 +435,10 @@ function ctools_wizard_submit(&$form, &$form_state) {
|
||||
unset($_GET['destination']);
|
||||
}
|
||||
}
|
||||
else if (isset($form_state['form_info']['return path'])) {
|
||||
elseif (isset($form_state['form_info']['return path'])) {
|
||||
$form_state['redirect'] = $form_state['form_info']['return path'];
|
||||
}
|
||||
else if ($type == 'finish' && isset($form_state['form_info']['cancel path'])) {
|
||||
elseif ($type == 'finish' && isset($form_state['form_info']['cancel path'])) {
|
||||
$form_state['redirect'] = $form_state['form_info']['cancel path'];
|
||||
}
|
||||
}
|
||||
@@ -469,10 +467,8 @@ function ctools_wizard_get_path($form_info, $step) {
|
||||
if (!isset($path[1]) || !is_array($path[1])) {
|
||||
$path[1] = array();
|
||||
}
|
||||
// Ensure that the query part of options is an array.
|
||||
$path[1] += array('query' => array());
|
||||
// Add the destination parameter, if not set already.
|
||||
$path[1]['query'] += drupal_get_destination();
|
||||
$path[1] += drupal_get_destination();
|
||||
}
|
||||
|
||||
return $path;
|
||||
@@ -505,15 +501,15 @@ function ctools_wizard_defaults(&$form_info) {
|
||||
}
|
||||
|
||||
$form_info = $form_info + $defaults;
|
||||
// set form callbacks if they aren't defined
|
||||
// Set form callbacks if they aren't defined.
|
||||
foreach ($form_info['forms'] as $step => $params) {
|
||||
if (!$params['form id']) {
|
||||
$form_callback = $hook . '_' . $step . '_form';
|
||||
$form_info['forms'][$step]['form id'] = $form_callback;
|
||||
if (empty($params['form id'])) {
|
||||
$form_callback = $hook . '_' . $step . '_form';
|
||||
$form_info['forms'][$step]['form id'] = $form_callback;
|
||||
}
|
||||
}
|
||||
|
||||
// set button callbacks
|
||||
// Set button callbacks.
|
||||
$callbacks = array(
|
||||
'back callback' => '_back',
|
||||
'next callback' => '_next',
|
||||
@@ -523,10 +519,10 @@ function ctools_wizard_defaults(&$form_info) {
|
||||
);
|
||||
|
||||
foreach ($callbacks as $key => $callback) {
|
||||
// never overwrite if explicity defined
|
||||
// Never overwrite if explicity defined.
|
||||
if (empty($form_info[$key])) {
|
||||
$wizard_callback = $hook . $callback;
|
||||
if (function_exists($wizard_callback)) {
|
||||
if (function_exists($wizard_callback)) {
|
||||
$form_info[$key] = $wizard_callback;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user