summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-27 04:12:39 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-27 04:12:39 +0000
commit0e05035b7104baa80614eefab90b6d90996ca3dc (patch)
treead6180c49c429e48e5d191077aa0b8de0fabb1eb
parentca7b56e7351a7fe57d2c1d4c6feef44e2879caf0 (diff)
downloadbrdo-0e05035b7104baa80614eefab90b6d90996ca3dc.tar.gz
brdo-0e05035b7104baa80614eefab90b6d90996ca3dc.tar.bz2
#610204 by effulgentsia, Gábor Hojtsy, sun, Damien Tournoud and ksenzee: API changes to support overlays: lays ground work for implementation.
-rw-r--r--includes/batch.inc13
-rw-r--r--includes/form.inc5
-rw-r--r--misc/drupal.js11
-rw-r--r--misc/tableheader.js8
-rw-r--r--modules/locale/locale.test2
-rw-r--r--modules/toolbar/toolbar.tpl.php12
6 files changed, 43 insertions, 8 deletions
diff --git a/includes/batch.inc b/includes/batch.inc
index 10fc2a737..9f094eab6 100644
--- a/includes/batch.inc
+++ b/includes/batch.inc
@@ -109,11 +109,15 @@ function _batch_progress_page_js() {
$current_set = _batch_current_set();
drupal_set_title($current_set['title'], PASS_THROUGH);
+ // Merge required query parameters for batch processing into those provided by
+ // batch_set() or hook_batch_alter().
+ $batch['url_options']['query']['id'] = $batch['id'];
+
$js_setting = array(
'batch' => array(
'errorMessage' => $current_set['error_message'] . '<br />' . $batch['error_message'],
'initMessage' => $current_set['init_message'],
- 'uri' => url($batch['url'], array('query' => array('id' => $batch['id']))),
+ 'uri' => url($batch['url'], $batch['url_options']),
),
);
drupal_add_js($js_setting, 'setting');
@@ -189,7 +193,12 @@ function _batch_progress_page_nojs() {
ob_end_clean();
}
- $url = url($batch['url'], array('query' => array('id' => $batch['id'], 'op' => $new_op)));
+ // Merge required query parameters for batch processing into those provided by
+ // batch_set() or hook_batch_alter().
+ $batch['url_options']['query']['id'] = $batch['id'];
+ $batch['url_options']['query']['op'] = $new_op;
+
+ $url = url($batch['url'], $batch['url_options']);
drupal_add_html_head('<meta http-equiv="Refresh" content="0; URL=' . $url . '">');
return theme('progress_bar', array('percent' => $percentage, 'message' => $message));
diff --git a/includes/form.inc b/includes/form.inc
index e2d281384..0de410ea5 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -2963,7 +2963,9 @@ function _form_set_class(&$element, $class = array()) {
* 'operations' and 'finished' functions, for instance if they don't
* reside in the original '.module' file. The path should be relative to
* the base_path(), and thus should be built using drupal_get_path().
- * 'css' : an array of paths to CSS files to be used on the progress page.
+ * 'css': an array of paths to CSS files to be used on the progress page.
+ * 'url_options': options passed to url() when constructing redirect
+ * URLs for the batch.
*
* Operations are added as new batch sets. Batch sets are used to ensure
* clean code independence, ensuring that several batches submitted by
@@ -3051,6 +3053,7 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = 'd
'current_set' => 0,
'progressive' => TRUE,
'url' => $url,
+ 'url_options' => array(),
'source_page' => $_GET['q'],
'redirect' => $redirect,
'theme' => $GLOBALS['theme_key'],
diff --git a/misc/drupal.js b/misc/drupal.js
index ea688a499..87a5972c6 100644
--- a/misc/drupal.js
+++ b/misc/drupal.js
@@ -344,4 +344,15 @@ Drupal.theme.prototype = {
}
};
+/**
+ * Return whether the given variable is an object.
+ *
+ * The HEAD version of jQuery (http://code.jquery.com/jquery-nightly.js)
+ * includes an isObject() function, so when that gets released and incorporated
+ * into Drupal, this can be removed.
+ */
+$.extend({isObject: function(value) {
+ return (value !== null && typeof value === 'object');
+}});
+
})(jQuery);
diff --git a/misc/tableheader.js b/misc/tableheader.js
index 813e4c7ca..0192d30b2 100644
--- a/misc/tableheader.js
+++ b/misc/tableheader.js
@@ -18,8 +18,9 @@ Drupal.behaviors.tableHeader = {
var headers = [];
$('table.sticky-enabled thead', context).once('tableheader', function () {
- // Clone thead so it inherits original jQuery properties.
- var headerClone = $(this).clone(true).insertBefore(this.parentNode).wrap('<table class="sticky-header"></table>').parent().css({
+ // Clone the table header so it inherits original jQuery properties. Hide
+ // the table to avoid a flash of the header clone upon page load.
+ var headerClone = $(this).clone(true).hide().insertBefore(this.parentNode).wrap('<table class="sticky-header"></table>').parent().css({
position: 'fixed',
top: '0px'
});
@@ -32,6 +33,9 @@ Drupal.behaviors.tableHeader = {
headerClone.table = table;
// Finish initializing header positioning.
tracker(headerClone);
+ // We hid the header to avoid it showing up erroneously on page load;
+ // we need to unhide it now so that it will show up when expected.
+ $(headerClone).children('thead').show();
$(table).addClass('sticky-table');
});
diff --git a/modules/locale/locale.test b/modules/locale/locale.test
index bb6a2de86..75e96a0b7 100644
--- a/modules/locale/locale.test
+++ b/modules/locale/locale.test
@@ -237,7 +237,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
$this->clickLink(t('edit'));
// We save the lid from the path.
$matches = array();
- preg_match('!admin/config/regional/translate/edit/(\d)+!', $this->getUrl(), $matches);
+ preg_match('!admin/config/regional/translate/edit/(\d+)!', $this->getUrl(), $matches);
$lid = $matches[1];
// No t() here, it's surely not translated yet.
$this->assertText($name, t('name found on edit screen.'));
diff --git a/modules/toolbar/toolbar.tpl.php b/modules/toolbar/toolbar.tpl.php
index 64576ceaf..41e7696d2 100644
--- a/modules/toolbar/toolbar.tpl.php
+++ b/modules/toolbar/toolbar.tpl.php
@@ -6,15 +6,23 @@
* Default template for admin toolbar.
*
* Available variables:
+ * - $classes: String of classes that can be used to style contextually through
+ * CSS. It can be manipulated through the variable $classes_array from
+ * preprocess functions. The default value has the following:
+ * - toolbar: The current template type, i.e., "theming hook".
* - $toolbar['toolbar_user']: User account / logout links.
* - $toolbar['toolbar_menu']: Top level management menu links.
* - $toolbar['toolbar_drawer']: A place for extended toolbar content.
*
+ * Other variables:
+ * - $classes_array: Array of html class attribute values. It is flattened
+ * into a string within the variable $classes.
+ *
* @see template_preprocess()
- * @see template_preprocess_admin_toolbar()
+ * @see template_preprocess_toolbar()
*/
?>
-<div id="toolbar" class="clearfix">
+<div id="toolbar" class="<?php print $classes; ?> clearfix">
<div class="toolbar-menu clearfix">
<?php if ($toolbar['toolbar_drawer']):?>
<span class="toggle toggle-active"><?php print t('Open'); ?></span>