* This is normally only invoked upon submit without javascript enabled.
*/
function ctools_jump_menu_submit($form, &$form_state) {
- $redirect = $form_state['values']['jump'];
+ // If the path we are redirecting to contains the string :: then treat the
+ // the string after the double colon as the path to redirect to.
+ // This allows duplicate paths to be used in jump menus for multiple options.
+ $redirect_array = explode("::", $form_state['values']['jump']);
+
+ if(isset($redirect_array[1]) && !empty($redirect_array[1])){
+ $redirect = $redirect_array[1];
+ }
+ else {
+ $redirect = $form_state['values']['jump'];
+ }
// If the path we are redirecting to starts with the base path (for example,
// "/somepath/node/1"), we need to strip the base path off before passing it
.addClass('ctools-jump-menu-processed')
.change(function() {
var loc = $(this).val();
- if (loc) {
+ var urlArray = loc.split('::');
+ if (urlArray[1]) {
+ location.href = urlArray[1];
+ }
+ else {
location.href = loc;
}
return false;
// Find our sibling value.
var $select = $(this).parents('form').find('.ctools-jump-menu-select');
var loc = $select.val();
- if (loc) {
+ var urlArray = loc.split('::');
+ if (urlArray[1]) {
+ location.href = urlArray[1];
+ }
+ else {
location.href = loc;
}
return false;