Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.542
diff -u -r1.542 theme.inc
--- includes/theme.inc 23 Oct 2009 22:24:11 -0000 1.542
+++ includes/theme.inc 27 Oct 2009 19:04:18 -0000
@@ -1860,7 +1860,43 @@
* Returns code that emits the 'more help'-link.
*/
function theme_more_help_link($variables) {
- return '
' . t('
More help', array('@link' => check_url($variables['url']))) . '
';
+ // Prepare the variables.
+ $link = check_url($variables['url']);
+ $id = drupal_html_id('popup-' . $variables['url']);
+ $link_id = drupal_html_id('link-' . $variables['url']);
+
+ // Create a dialog box for the help text.
+ drupal_add_ui(array(
+ 'library' => 'ui.dialog',
+ 'selector' => '',
+ 'options' => array(
+ 'width' => 500,
+ 'height' => 400,
+ 'title' => t('Help'),
+ 'autoOpen' => FALSE,
+ ),
+ ));
+
+ // Open the dialog box when the link is clicked.
+ drupal_add_ui(array(
+ 'library' => 'ui.dialog',
+ 'selector' => '#' . $id,
+ 'options' => 'open',
+ 'event' => 'click',
+ 'bound_element' => '#' . $link_id,
+ ));
+
+ // When the dialog box opens, load the help content.
+ drupal_add_ui(array(
+ 'library' => 'jquery.load',
+ 'selector' => '#' . $id,
+ 'options' => $variables['url'] . '/dialog',
+ 'event' => 'dialogopen',
+ 'bound_element' => '#' . $id,
+ ));
+
+ // Create the markup.
+ return '' . t('
More help', array('@link_id' => $link_id, '@link' => $link)) . '
';
}
/**
Index: modules/help/help.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/help/help.admin.inc,v
retrieving revision 1.11
diff -u -r1.11 help.admin.inc
--- modules/help/help.admin.inc 13 Oct 2009 05:26:57 -0000 1.11
+++ modules/help/help.admin.inc 27 Oct 2009 19:04:18 -0000
@@ -45,6 +45,14 @@
return $output;
}
+/**
+ * Menu callback; prints the help content and then exits.
+ */
+function help_dialog($name) {
+ echo help_page($name);
+ exit;
+}
+
function help_links_as_list() {
$empty_arg = drupal_help_arg();
$module_info = system_rebuild_module_data();
Index: modules/help/help.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/help/help.module,v
retrieving revision 1.91
diff -u -r1.91 help.module
--- modules/help/help.module 10 Sep 2009 06:32:54 -0000 1.91
+++ modules/help/help.module 27 Oct 2009 19:04:18 -0000
@@ -27,6 +27,14 @@
'type' => MENU_CALLBACK,
'file' => 'help.admin.inc',
);
+ $items['admin/help/' . $module . '/dialog'] = array(
+ 'title' => $module,
+ 'page callback' => 'help_dialog',
+ 'page arguments' => array(2),
+ 'access arguments' => array('access administration pages'),
+ 'type' => MENU_CALLBACK,
+ 'file' => 'help.admin.inc',
+ );
}
return $items;