? .DS_Store ? ctools_d7.patch Index: ctools.module =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/ctools.module,v retrieving revision 1.31 diff -u -p -r1.31 ctools.module --- ctools.module 17 Oct 2009 22:58:24 -0000 1.31 +++ ctools.module 18 Oct 2009 23:18:39 -0000 @@ -302,7 +302,7 @@ function ctools_break_phrase($str) { $object->operator = 'or'; $object->value = preg_split('/[+ ]/', $str); } - else if (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) { + elseif (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) { $object->operator = 'and'; $object->value = explode(',', $str); } Index: includes/content.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/includes/content.inc,v retrieving revision 1.15 diff -u -p -r1.15 content.inc --- includes/content.inc 17 Oct 2009 22:58:25 -0000 1.15 +++ includes/content.inc 18 Oct 2009 23:18:40 -0000 @@ -81,7 +81,7 @@ function ctools_content_defaults($info, $plugin['content types'] = array($plugin['name'] => $type); } // Otherwise, auto discover the function based upon pattern naming. - else if (function_exists($function_base . 'content_types')) { + elseif (function_exists($function_base . 'content_types')) { $plugin['content types'] = $function_base . 'content_types'; } } @@ -141,7 +141,7 @@ function ctools_content_get_subtypes($ty if (is_array($function)) { $subtypes = $function; } - else if (function_exists($function)) { + elseif (function_exists($function)) { // Cast to array to prevent errors from non-array returns. $subtypes = (array) $function($plugin); } @@ -324,7 +324,7 @@ function ctools_content_admin_title($typ if (is_array($type)) { $plugin = $type; } - else if (is_string($type)) { + elseif (is_string($type)) { $plugin = ctools_get_content_type($type); } else { @@ -339,10 +339,10 @@ function ctools_content_admin_title($typ return $function($subtype, $conf, $pane_context); } - else if (isset($plugin['admin title'])) { + elseif (isset($plugin['admin title'])) { return $plugin['admin title']; } - else if (isset($plugin['title'])) { + elseif (isset($plugin['title'])) { return $plugin['title']; } } @@ -377,7 +377,7 @@ function ctools_content_get_defaults($pl if (isset($plugin['defaults'])) { $defaults = $plugin['defaults']; } - else if (isset($subtype['defaults'])) { + elseif (isset($subtype['defaults'])) { $defaults = $subtype['defaults']; } if (isset($defaults)) { @@ -386,7 +386,7 @@ function ctools_content_get_defaults($pl return $return; } } - else if (is_array($defaults)) { + elseif (is_array($defaults)) { return $defaults; } } @@ -525,7 +525,7 @@ function ctools_content_form($op, $form_ _ctools_content_create_form_info($form_info, $plugin['add form'], $plugin, $subtype, $op); } // Use the edit form for the add form if add form was completely left off. - else if (isset($plugin['edit form'])) { + elseif (isset($plugin['edit form'])) { _ctools_content_create_form_info($form_info, $plugin['edit form'], $plugin, $subtype, $op); } @@ -543,7 +543,7 @@ function _ctools_content_create_form_inf if (empty($subtype['title'])) { $title = t('Configure'); } - else if ($op == 'add') { + elseif ($op == 'add') { $title = t('Configure new !subtype_title', array('!subtype_title' => $subtype['title'])); } else { @@ -558,7 +558,7 @@ function _ctools_content_create_form_inf ), ); } - else if (is_array($info)) { + elseif (is_array($info)) { $form_info['order'] = array(); $form_info['forms'] = array(); $count = 0; Index: includes/context-task-handler.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/includes/context-task-handler.inc,v retrieving revision 1.26 diff -u -p -r1.26 context-task-handler.inc --- includes/context-task-handler.inc 17 Oct 2009 22:58:25 -0000 1.26 +++ includes/context-task-handler.inc 18 Oct 2009 23:18:40 -0000 @@ -91,13 +91,15 @@ function ctools_context_handler_render($ } // Only directly output if $page was set to true. + /* if (!empty($info['no_blocks'])) { print theme('page', $info['content'], FALSE); return; } else { + */ return $info['content']; - } + /*}*/ } } } Index: includes/context.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/includes/context.inc,v retrieving revision 1.36 diff -u -p -r1.36 context.inc --- includes/context.inc 12 Oct 2009 12:42:53 -0000 1.36 +++ includes/context.inc 18 Oct 2009 23:18:40 -0000 @@ -452,7 +452,7 @@ function _ctools_context_get_converters( if (is_array($plugin['convert list'])) { $converters = $plugin['convert list']; } - else if ($function = ctools_plugin_get_function($plugin, 'convert list')) { + elseif ($function = ctools_plugin_get_function($plugin, 'convert list')) { $converters = (array) $function(); } @@ -1222,7 +1222,7 @@ function ctools_context_replace_form(&$f if (is_array($plugin['placeholder form'])) { $form[$cid] = $plugin['placeholder form']; } - else if (function_exists($plugin['placeholder form'])) { + elseif (function_exists($plugin['placeholder form'])) { $widget = $plugin['placeholder form']($info['settings']); if ($widget) { $form[$cid] = $widget; @@ -1337,7 +1337,7 @@ function ctools_access_group_summary($ac } /** - * Determine if the current user has access via plugin. + * Determine if the current user has access via a plugin. * * @param $settings * An array of settings theoretically set by the user. @@ -1382,7 +1382,7 @@ function ctools_access($settings, $conte // Pass if 'or' and this rule passed. return TRUE; } - else if (!$pass && $settings['logic'] == 'and') { + elseif (!$pass && $settings['logic'] == 'and') { // Fail if 'and' and htis rule failed. return FALSE; } @@ -1435,7 +1435,7 @@ function ctools_access_new_test($plugin) if (is_array($default)) { $test['settings'] = $default; } - else if (function_exists($default)) { + elseif (function_exists($default)) { $test['settings'] = $default(); } else { Index: includes/export.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/includes/export.inc,v retrieving revision 1.22 diff -u -p -r1.22 export.inc --- includes/export.inc 17 Oct 2009 22:58:25 -0000 1.22 +++ includes/export.inc 18 Oct 2009 23:18:41 -0000 @@ -121,7 +121,7 @@ function ctools_export_load_object($tabl if ($type == 'names') { $query->condition($export['key'], $args, 'IN'); } - else if ($type == 'conditions') { + elseif ($type == 'conditions') { foreach ($args as $key => $value) { if (isset($schema['fields'][$key])) { $query->condition($key, $value); @@ -162,7 +162,7 @@ function ctools_export_load_object($tabl } } } - else if ($type == 'names') { + elseif ($type == 'names') { if (!in_array($object->{$export['key']}, $args)) { continue; } @@ -383,7 +383,7 @@ function ctools_var_export($var, $prefix $output .= ')'; } } - else if (is_bool($var)) { + elseif (is_bool($var)) { $output = $var ? 'TRUE' : 'FALSE'; } else { @@ -587,7 +587,7 @@ function ctools_export_new_object($table if (isset($info['object default'])) { $object->$field = $info['object default']; } - else if (isset($info['default'])) { + elseif (isset($info['default'])) { $object->$field = $info['default']; } else { Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/includes/menu.inc,v retrieving revision 1.5 diff -u -p -r1.5 menu.inc --- includes/menu.inc 17 Oct 2009 22:58:25 -0000 1.5 +++ includes/menu.inc 18 Oct 2009 23:18:41 -0000 @@ -449,17 +449,15 @@ function ctools_menu_get_active_help() { $arg = drupal_help_arg(arg(NULL)); $empty_arg = drupal_help_arg(); - foreach (module_list() as $name) { - if (module_hook($name, 'help')) { - // Lookup help for this path. - if ($help = module_invoke($name, 'help', $router_path, $arg)) { - $output .= $help ."\n"; - } - // Add "more help" link on admin pages if the module provides a - // standalone help page. - if ($arg[0] == "admin" && module_exists('help') && module_invoke($name, 'help', 'admin/help#'. $arg[2], $empty_arg) && $help) { - $output .= theme("more_help_link", url('admin/help/'. $arg[2])); - } + foreach (module_implements('help') as $name) { + // Lookup help for this path. + if ($help = module_invoke($name, 'help', $router_path, $arg)) { + $output .= $help ."\n"; + } + // Add "more help" link on admin pages if the module provides a + // standalone help page. + if ($arg[0] == "admin" && module_exists('help') && module_invoke($name, 'help', 'admin/help#'. $arg[2], $empty_arg) && $help) { + $output .= theme("more_help_link", url('admin/help/'. $arg[2])); } } return $output; Index: includes/modal.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/includes/modal.inc,v retrieving revision 1.9 diff -u -p -r1.9 modal.inc --- includes/modal.inc 13 Oct 2009 20:06:56 -0000 1.9 +++ includes/modal.inc 18 Oct 2009 23:18:41 -0000 @@ -74,7 +74,7 @@ function ctools_modal_add_plugin_js($plu if (file_exists($file)) { $js[$file] = TRUE; } - else if (file(exists($subtype['path'] . '/' . $file))) { + elseif (file(exists($subtype['path'] . '/' . $file))) { $js[$subtype['path'] . '/' . $file] = TRUE; } } @@ -84,7 +84,7 @@ function ctools_modal_add_plugin_js($plu if (file_exists($file)) { $css[$file] = TRUE; } - else if (file(exists($subtype['path'] . '/' . $file))) { + elseif (file(exists($subtype['path'] . '/' . $file))) { $css[$subtype['path'] . '/' . $file] = TRUE; } } Index: includes/plugins.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/includes/plugins.inc,v retrieving revision 1.22 diff -u -p -r1.22 plugins.inc --- includes/plugins.inc 17 Oct 2009 22:58:25 -0000 1.22 +++ includes/plugins.inc 18 Oct 2009 23:18:41 -0000 @@ -112,9 +112,9 @@ function ctools_plugin_api_include($owne if (!isset($plugin_info['file'])) { $plugin_info['file'] = "$module.$api.inc"; } - if (file_exists("./$plugin_info[path]/$plugin_info[file]")) { + if (file_exists(DRUPAL_ROOT . "/$plugin_info[path]/$plugin_info[file]")) { $plugin_info[$module]['included'] = TRUE; - require_once "./$plugin_info[path]/$plugin_info[file]"; + require_once DRUPAL_ROOT . "/$plugin_info[path]/$plugin_info[file]"; } $info[$module] = $plugin_info; } @@ -225,7 +225,7 @@ function ctools_plugin_load_includes($in if (isset($info['extension'])) { $extension = $info['extension']; } - else if (isset($info['info file'])) { + elseif (isset($info['info file'])) { $extension = 'info'; } else { @@ -378,7 +378,7 @@ function _ctools_process_data($result, $ if (is_array($info['defaults'])) { $result[$name] += $info['defaults']; } - else if (function_exists($info['defaults'])) { + elseif (function_exists($info['defaults'])) { $info['defaults']($info, $result[$name]); } } Index: includes/wizard.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/includes/wizard.inc,v retrieving revision 1.14 diff -u -p -r1.14 wizard.inc --- includes/wizard.inc 8 Oct 2009 11:09:56 -0000 1.14 +++ includes/wizard.inc 18 Oct 2009 23:18:41 -0000 @@ -49,7 +49,7 @@ function ctools_wizard_multistep_form($form_info, $step, &$form_state) { // allow order array to be optional if (empty($form_info['order'])) { - foreach($form_info['forms'] as $step_id => $params) { + foreach ($form_info['forms'] as $step_id => $params) { $form_info['order'][$step_id] = $params['title']; } } @@ -139,7 +139,7 @@ function ctools_wizard_multistep_form($f return drupal_redirect_form(array(), $form_state['redirect']); } } - 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']); @@ -266,7 +266,7 @@ function ctools_wizard_wrapper(&$form, & '#attributes' => $button_attributes, ); } - else if (empty($form_state['next'])) { + elseif (empty($form_state['next'])) { $form['buttons']['return'] = array( '#type' => 'submit', '#value' => $form_info['finish text'], @@ -337,13 +337,13 @@ function ctools_wizard_submit(&$form, &$ 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']); } - 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']; } } @@ -378,7 +378,7 @@ function ctools_wizard_defaults(&$form_i ); $form_info = $form_info + $defaults; // set form callbacks if they aren't defined - foreach($form_info['forms'] as $step => $params) { + foreach ($form_info['forms'] as $step => $params) { if (!$params['form id']) { $form_callback = $hook . '_' . $step . '_form'; $form_info['forms'][$step]['form id'] = $form_callback; @@ -394,7 +394,7 @@ function ctools_wizard_defaults(&$form_i 'finish callback' => '_finish', ); - foreach($callbacks as $key => $callback) { + foreach ($callbacks as $key => $callback) { // never overwrite if explicity defined if (empty($form_info[$key])) { $wizard_callback = $hook . $callback; Index: js/collapsible-div.js =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/js/collapsible-div.js,v retrieving revision 1.9 diff -u -p -r1.9 collapsible-div.js --- js/collapsible-div.js 12 Oct 2009 12:42:53 -0000 1.9 +++ js/collapsible-div.js 18 Oct 2009 23:18:42 -0000 @@ -230,9 +230,11 @@ /** * Support Drupal's 'behaviors' system for binding. */ - Drupal.behaviors.CToolsCollapsible = function(context) { - $('.ctools-collapsible-container:not(.ctools-collapsible-processed)', context) - .each(Drupal.CTools.bindCollapsible) - .addClass('ctools-collapsible-processed'); - } + Drupal.behaviors.CToolsCollapsible = { + attach: function(context) { + $('.ctools-collapsible-container:not(.ctools-collapsible-processed)', context) + .each(Drupal.CTools.bindCollapsible) + .addClass('ctools-collapsible-processed'); + } + }; })(jQuery); Index: js/dependent.js =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/js/dependent.js,v retrieving revision 1.6 diff -u -p -r1.6 dependent.js --- js/dependent.js 12 Oct 2009 12:42:53 -0000 1.6 +++ js/dependent.js 18 Oct 2009 23:18:42 -0000 @@ -180,23 +180,25 @@ } } - Drupal.behaviors.CToolsDependent = function (context) { - Drupal.CTools.dependent.autoAttach(); + Drupal.behaviors.CToolsDependent = { + attach: function (context) { + Drupal.CTools.dependent.autoAttach(); - // Really large sets of fields are too slow with the above method, so this - // is a sort of hacked one that's faster but much less flexible. - $("select.ctools-master-dependent:not(.ctools-processed)") - .addClass('ctools-processed') - .change(function() { - var val = $(this).val(); - if (val == 'all') { - $('.ctools-dependent-all').show(0); - } - else { - $('.ctools-dependent-all').hide(0); - $('.ctools-dependent-' + val).show(0); - } - }) - .trigger('change'); - } + // Really large sets of fields are too slow with the above method, so this + // is a sort of hacked one that's faster but much less flexible. + $("select.ctools-master-dependent:not(.ctools-processed)") + .addClass('ctools-processed') + .change(function() { + var val = $(this).val(); + if (val == 'all') { + $('.ctools-dependent-all').show(0); + } + else { + $('.ctools-dependent-all').hide(0); + $('.ctools-dependent-' + val).show(0); + } + }) + .trigger('change'); + } + }; })(jQuery); Index: js/dropdown.js =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/js/dropdown.js,v retrieving revision 1.5 diff -u -p -r1.5 dropdown.js --- js/dropdown.js 12 Oct 2009 12:42:53 -0000 1.5 +++ js/dropdown.js 18 Oct 2009 23:18:42 -0000 @@ -23,64 +23,66 @@ */ (function ($) { - Drupal.behaviors.CToolsDropdown = function() { - $('div.ctools-dropdown:not(.ctools-dropdown-processed)') - .removeClass('ctools-dropdown-no-js') - .addClass('ctools-dropdown-processed') - .each(function() { - var $dropdown = $(this); - var open = false; - var hovering = false; - var timerID = 0; - - var toggle = function(close) { - // if it's open or we're told to close it, close it. - if (open || close) { - // If we're just toggling it, close it immediately. - if (!close) { - open = false; - $("div.ctools-dropdown-container", $dropdown).slideUp(100); + Drupal.behaviors.CToolsDropdown = { + attach: function() { + $('div.ctools-dropdown:not(.ctools-dropdown-processed)') + .removeClass('ctools-dropdown-no-js') + .addClass('ctools-dropdown-processed') + .each(function() { + var $dropdown = $(this); + var open = false; + var hovering = false; + var timerID = 0; + + var toggle = function(close) { + // if it's open or we're told to close it, close it. + if (open || close) { + // If we're just toggling it, close it immediately. + if (!close) { + open = false; + $("div.ctools-dropdown-container", $dropdown).slideUp(100); + } + else { + // If we were told to close it, wait half a second to make + // sure that's what the user wanted. + // Clear any previous timer we were using. + if (timerID) { + clearTimeout(timerID); + } + timerID = setTimeout(function() { + if (!hovering) { + open = false; + $("div.ctools-dropdown-container", $dropdown).slideUp(100); + }}, 500); + } } else { - // If we were told to close it, wait half a second to make - // sure that's what the user wanted. - // Clear any previous timer we were using. - if (timerID) { - clearTimeout(timerID); - } - timerID = setTimeout(function() { - if (!hovering) { - open = false; - $("div.ctools-dropdown-container", $dropdown).slideUp(100); - }}, 500); + // open it. + open = true; + $("div.ctools-dropdown-container", $dropdown) + .animate({height: "show", opacity: "show"}, 100); } } - else { - // open it. - open = true; - $("div.ctools-dropdown-container", $dropdown) - .animate({height: "show", opacity: "show"}, 100); - } - } - $("a.ctools-dropdown-link", $dropdown).click(function() { - toggle(); - return false; - }); - - $dropdown.hover( - function() { - hovering = true; - }, // hover in - function() { // hover out - hovering = false; - toggle(true); - return false; - }); - // @todo -- just use CSS for this noise. - $("div.ctools-dropdown-container a").hover( - function() { $(this).addClass('ctools-dropdown-hover'); }, - function() { $(this).removeClass('ctools-dropdown-hover'); } - ); - }); + $("a.ctools-dropdown-link", $dropdown).click(function() { + toggle(); + return false; + }); + + $dropdown.hover( + function() { + hovering = true; + }, // hover in + function() { // hover out + hovering = false; + toggle(true); + return false; + }); + // @todo -- just use CSS for this noise. + $("div.ctools-dropdown-container a").hover( + function() { $(this).addClass('ctools-dropdown-hover'); }, + function() { $(this).removeClass('ctools-dropdown-hover'); } + ); + }); + } }; })(jQuery); Index: js/modal.js =================================================================== RCS file: /cvs/drupal/contributions/modules/ctools/js/modal.js,v retrieving revision 1.20 diff -u -p -r1.20 modal.js --- js/modal.js 13 Oct 2009 20:06:56 -0000 1.20 +++ js/modal.js 18 Oct 2009 23:18:42 -0000 @@ -189,39 +189,41 @@ /** * Bind links that will open modals to the appropriate function. */ - Drupal.behaviors.CToolsModal = function(context) { - // Bind links - $('a.ctools-use-modal:not(.ctools-use-modal-processed)', context) - .addClass('ctools-use-modal-processed') - .click(Drupal.CTools.Modal.clickAjaxLink); - - // Bind buttons - $('input.ctools-use-modal:not(.ctools-use-modal-processed), button.ctools-use-modal:not(.ctools-use-modal-processed)', context) - .addClass('ctools-use-modal-processed') - .click(Drupal.CTools.Modal.clickAjaxButton); - - if ($(context).attr('id') == 'modal-content') { - // Bind submit links in the modal form. - $('form:not(.ctools-use-modal-processed)', context) + Drupal.behaviors.CToolsModal = { + attach: function(context) { + // Bind links + $('a.ctools-use-modal:not(.ctools-use-modal-processed)', context) .addClass('ctools-use-modal-processed') - .submit(Drupal.CTools.Modal.submitAjaxForm); - // add click handlers so that we can tell which button was clicked, - // because the AJAX submit does not set the values properly. - - $('input[type="submit"]:not(.ctools-use-modal-processed), button:not(.ctools-use-modal-processed)', context) + .click(Drupal.CTools.Modal.clickAjaxLink); + + // Bind buttons + $('input.ctools-use-modal:not(.ctools-use-modal-processed), button.ctools-use-modal:not(.ctools-use-modal-processed)', context) .addClass('ctools-use-modal-processed') - .click(function() { - if (Drupal.autocompleteSubmit && !Drupal.autocompleteSubmit()) { - return false; - } - - // Make sure it knows our button. - if (!$(this.form).hasClass('ctools-ajaxing')) { - this.form.clk = this; - $(this).after('