allow various views to be added as tabs (but ensure we add required node type filter). honor exposed filters. allow tabs to be turned on/off & weighted.

Comments

aaron’s picture

Status: Active » Needs work

this one's done as soon as i tie in the exposed filters and add some admin/field settings.

aaron’s picture

exposed filters are in. just need some admin magic now!

kirilius’s picture

Some documentation will be good too. I haven't found any description on how to use custom views for the borwser yet.

aaron’s picture

i've got it working with some custom code, but need to make a ui for administering views w/ nrembrowser. that's next on my hit list.

something like:

// $Id$

/**
 * @file my_browser.module
 * Overrides the views & tabs of the nrembrowser media browser dialog.
 */

/**
 * Implementation of hook_nrembrowser_media().
 */
function my_browser_nrembrowser_media($field) {
  // Add a custom view that's been built for the browser.
  $view_name = 'my_browser_view';
  $view_display_id = 'default';

  // Add a tab for each required view.
  $view = views_get_view($view_name);
  if (!$view || !$view->access($view_display_id)) {
    // Don't display the tab if we don't have access.
    return array();
  }
  $tabs = array();
  $tabs['my_browser_nrembrowser_media_0'] = array(
    'title' => t($view->display[$view_display_id]->display_options['title']),
    'form' => 'nrembrowser_add_media_page_form',
    'options' => array(
      'view_name' => $view_name,
      'view_display_id' => $view_display_id,
      'view_arguments' => array(),
      'view' => $view,
    ),
  );
  return $tabs;
}

/**
 * Implementation of hook_nrembrowser_media_alter().
 */
function my_browser_nrembrowser_media_alter(&$tabs, $field) {
  // This will remove the 'All' tab.
  array_shift($tabs);

  // This will move the newly created tab and stick it in front.
  $tab = array_pop($tabs);
  array_unshift($tabs, $tab);
}

EgbertB’s picture

subscribing - would really love this feature so we can use nrem, as a predecessor for drupal 7 media, on drupal 6 sites which cannot yet be build in 7

3oheme’s picture

Also subscribing - It'd be great having views integration (and filtering by node title with autocomplete, for example)

grndlvl’s picture

You may use views with nrembrowser and also exposed filters using the example from #4 there just isn't an interface for adding views displays to the browser.

madjr’s picture

also subscribing :)

pribeh’s picture

subscribing.

varac’s picture

subscribing