diff --git a/css/dropdown.css b/css/dropdown.css index c02673c3b981e40265c88d6c29e28d2eeb543f7b..293dba7d016ae2d6101bab52b0fe4dd8230e342a 100644 --- a/css/dropdown.css +++ b/css/dropdown.css @@ -28,7 +28,7 @@ html.js div.ctools-dropdown div.ctools-dropdown-container ul li { /* Everything from here down is purely visual style and can be overridden. */ -html.js div.ctools-dropdown a.ctools-dropdown-link { +html.js div.ctools-dropdown a.ctools-dropdown-text-link { background: url(../images/collapsible-expanded.png) 3px 5px no-repeat; padding-left: 12px; } diff --git a/delegator/plugins/tasks/node_edit.inc b/delegator/plugins/tasks/node_edit.inc index fccda22d6014311d52a7f68ad12aada433a65329..32078c6fa77982aa66e1e921af0bbbd4f68b6133 100644 --- a/delegator/plugins/tasks/node_edit.inc +++ b/delegator/plugins/tasks/node_edit.inc @@ -76,8 +76,10 @@ function delegator_node_edit($node) { $output = ctools_context_handler_render($task, '', $contexts); if ($output === FALSE) { // Fall back! - module_load_include('inc', 'node', 'node.pages'); - $output = drupal_get_form($node->type . '_node_form', $node); + // We've already built the form with the context, so we can't build it again, or + // form_clean_id will mess up our ids. But we don't really need to, either: + $context = current($contexts); + $output = drupal_render_form($context->form_id, $context->form); } return $output; diff --git a/includes/dropdown.theme.inc b/includes/dropdown.theme.inc index c68cf9190881d16eccbc10612723b11685c4a0ba..0b5f22651bcaaf27df477e78213668d8eb41c6a1 100644 --- a/includes/dropdown.theme.inc +++ b/includes/dropdown.theme.inc @@ -34,7 +34,7 @@ */ function ctools_dropdown_theme(&$items) { $items['ctools_dropdown'] = array( - 'arguments' => array('title' => NULL, 'links' => NULL), + 'arguments' => array('title' => NULL, 'links' => NULL, 'image' => FALSE, 'class' => ''), 'file' => 'includes/dropdown.theme.inc', ); } @@ -47,12 +47,15 @@ function ctools_dropdown_theme(&$items) { * @param $links * A list of links to provide within the dropdown, suitable for use * in via Drupal's theme('links'). + * @param $image + * If true, the dropdown link is an image and will not get extra decorations + * that a text dropdown link will. * @param $class * An optional class to add to the dropdown's container div to allow you * to style a single dropdown however you like without interfering with * other dropdowns. */ -function theme_ctools_dropdown($title, $links, $class = '') { +function theme_ctools_dropdown($title, $links, $image = FALSE, $class = '') { // Provide a unique identifier for every dropdown on the page. static $id = 0; $id++; @@ -65,12 +68,20 @@ function theme_ctools_dropdown($title, $links, $class = '') { $output = ''; $output .= '<div class="' . $class . '" id="ctools-dropdown-' . $id . '">'; - $output .= '<div class="ctools-dropdown-link-wrapper">'; // Test fix for IE - $output .= '<a href="#" class="ctools-dropdown-link">' . check_plain($title) . '</a>'; + $output .= '<div class="ctools-dropdown-link-wrapper">'; + if ($image) { + $output .= '<a href="#" class="ctools-dropdown-link ctools-dropdown-image-link">' . $title . '</a>'; + } + else { + $output .= '<a href="#" class="ctools-dropdown-link ctools-dropdown-text-link">' . check_plain($title) . '</a>'; + } + $output .= '</div>'; // wrapper + $output .= '<div class="ctools-dropdown-container-wrapper">'; $output .= '<div class="ctools-dropdown-container">'; $output .= theme('links', $links); $output .= '</div>'; // container + $output .= '</div>'; // container wrapper $output .= '</div>'; // dropdown return $output; } diff --git a/plugins/contexts/node_add_form.inc b/plugins/contexts/node_add_form.inc index 63c6f6f8b94aa294579bf344533b3738c7f05e73..f30e724b5b4f799482f8b01ad649bce03a93ed42 100644 --- a/plugins/contexts/node_add_form.inc +++ b/plugins/contexts/node_add_form.inc @@ -48,8 +48,11 @@ function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE global $user; $node = array('uid' => $user->uid, 'name' => $user->name, 'type' => $type); - $form = drupal_retrieve_form($type . '_node_form', $node); - drupal_process_form($type . '_node_form', $form); + ctools_include('form'); + $form_id = $node->type . '_node_form'; + + $form_state = array('want form' => TRUE, 'args' => array($node)); + $form = ctools_build_form($form_id, $form_state); // In a form, $data is the object being edited. $context->data = $type; $context->title = $types[$type]->name;