? themeability.patch
Index: nodeformpopup.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/nodeformpopup/nodeformpopup.module,v
retrieving revision 1.21
diff -u -F^f -r1.21 nodeformpopup.module
--- nodeformpopup.module 4 Oct 2006 14:59:12 -0000 1.21
+++ nodeformpopup.module 7 Oct 2006 12:22:34 -0000
@@ -181,6 +181,10 @@ function _nodeformpopup_attach_noderefer
if ($field['widget']['type'] == 'nodereference_autocomplete') {
$links = array();
+
+ // Set a query key in form array to pass a query string and let other modules alters it
+ $query = $form[$name]['nodeformpopup']['#attributes'];
+
foreach ($field['referenceable_types'] as $type) {
$node = new stdClass();
$node->type = $type;
@@ -190,7 +194,7 @@ function _nodeformpopup_attach_noderefer
}
if (count($links)) {
$form[$name]['nodeformpopup']['#prefix'] = '
';
}
}
@@ -205,10 +209,13 @@ function _nodeformpopup_attach_noderefer
/**
* Creates a link to a popup node form
*/
-function nodeformpopup_l($label, $type, $class = NULL, $html = FALSE) {
+function nodeformpopup_l($label, $type, $class = NULL, $query = NULL, $html = FALSE) {
+ if ($query == NULL) {
+ $query = 'destination=nodeformpopup/submitted';
+ }
drupal_add_js(drupal_get_path('module', 'nodeformpopup'). '/nodeformpopup.js');
$class = 'nodeformpopup' . ($class ? ' '.$class : '');
- return l($label, 'nodeformpopup/add/'. check_plain($type), array('class' => $class), 'destination=nodeformpopup/submitted', NULL, FALSE, $html);
+ return l($label, 'nodeformpopup/add/'. check_plain($type), array('class' => $class), $query, NULL, FALSE, $html);
}
/**
@@ -266,3 +273,9 @@ function theme_nodeformpopup_bookmarklet
return ''. $label . '';
}
+/**
+ * Creates a link to a popup node form
+ */
+function theme_nodeformpopup_links($links) {
+ return t('Create new: %links', array('%links' => theme('links', $links, ', ')));
+}