diff options
Diffstat (limited to 'modules/node/node.admin.inc')
-rw-r--r-- | modules/node/node.admin.inc | 71 |
1 files changed, 21 insertions, 50 deletions
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index 4214573b2..b3413a959 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -148,7 +148,7 @@ function node_filter_form() { $form['filters'] = array( '#type' => 'fieldset', '#title' => t('Show only items where'), - '#theme' => 'node_filters', + '#theme' => 'exposed_filters__node', ); foreach ($session as $filter) { list($type, $value) = $filter; @@ -163,11 +163,12 @@ function node_filter_form() { else { $value = $filters[$type]['options'][$value]; } + $t_args = array('%property' => $filters[$type]['title'], '%value' => $value); if ($i++) { - $form['filters']['current'][] = array('#markup' => t('<em>and</em> where <strong>%type</strong> is <strong>%value</strong>', array('%type' => $filters[$type]['title'], '%value' => $value))); + $form['filters']['current'][] = array('#markup' => t('and where %property is %value', $t_args)); } else { - $form['filters']['current'][] = array('#markup' => t('<strong>%type</strong> is <strong>%value</strong>', array('%type' => $filters[$type]['title'], '%value' => $value))); + $form['filters']['current'][] = array('#markup' => t('where %property is %value', $t_args)); } if (in_array($type, array('type', 'language'))) { // Remove the option if it is already being filtered on. @@ -175,9 +176,17 @@ function node_filter_form() { } } + $form['filters']['status'] = array( + '#type' => 'container', + '#attributes' => array('class' => array('clearfix')), + '#prefix' => ($i ? '<div class="additional-filters">' . t('and where') . '</div>' : ''), + ); + $form['filters']['status']['filters'] = array( + '#type' => 'container', + '#attributes' => array('class' => array('filters')), + ); foreach ($filters as $key => $filter) { - $names[$key] = $filter['title']; - $form['filters']['status'][$key] = array( + $form['filters']['status']['filters'][$key] = array( '#type' => 'select', '#options' => $filter['options'], '#title' => $filter['title'], @@ -185,15 +194,17 @@ function node_filter_form() { ); } - $form['filters']['actions'] = array( + $form['filters']['status']['actions'] = array( '#type' => 'actions', - '#id' => 'node-admin-buttons', '#attributes' => array('class' => array('container-inline')), ); - $form['filters']['actions']['submit'] = array('#type' => 'submit', '#value' => (count($session) ? t('Refine') : t('Filter'))); + $form['filters']['status']['actions']['submit'] = array( + '#type' => 'submit', + '#value' => count($session) ? t('Refine') : t('Filter'), + ); if (count($session)) { - $form['filters']['actions']['undo'] = array('#type' => 'submit', '#value' => t('Undo')); - $form['filters']['actions']['reset'] = array('#type' => 'submit', '#value' => t('Reset')); + $form['filters']['status']['actions']['undo'] = array('#type' => 'submit', '#value' => t('Undo')); + $form['filters']['status']['actions']['reset'] = array('#type' => 'submit', '#value' => t('Reset')); } drupal_add_js('misc/form.js'); @@ -202,46 +213,6 @@ function node_filter_form() { } /** - * Returns HTML for a node administration filter selector. - * - * @param $variables - * An associative array containing: - * - form: A render element representing the form. - * - * @ingroup themeable - */ -function theme_node_filters($variables) { - $form = $variables['form']; - $output = ''; - - $output .= '<ul class="clearfix">'; - if (!empty($form['current'])) { - foreach (element_children($form['current']) as $key) { - $output .= '<li>' . drupal_render($form['current'][$key]) . '</li>'; - } - } - $output .= '</ul>'; - - $output .= '<div class="clearfix">'; - - $output .= '<dl class="multiselect">' . (!empty($form['current']) ? '<dt><em>' . t('and') . '</em> ' . t('where') . '</dt>' : ''); - - $output .= '<dd>'; - - foreach (element_children($form['status']) as $key) { - $output .= drupal_render($form['status'][$key]); - } - $output .= '</dd>'; - - $output .= '</dl>'; - $output .= drupal_render($form['actions']); - - $output .= '</div>'; - - return $output; -} - -/** * Process result from node administration filter form. */ function node_filter_form_submit($form, &$form_state) { |