You are here

function media_browser_plus_folder_admin_list in Media Browser Plus 7

Same name and namespace in other branches
  1. 7.2 includes/media_browser_plus.folders.inc \media_browser_plus_folder_admin_list()

@todo Document what this function does.

1 call to media_browser_plus_folder_admin_list()
media_browser_plus_folder_list in includes/media_browser_plus.folders.inc
@todo Document what this function does.

File

includes/media_browser_plus.folders.inc, line 100
Folder manipulation functions

Code

function media_browser_plus_folder_admin_list() {
  $vocabulary = taxonomy_vocabulary_machine_name_load('media_folders');
  $categories = array();
  $result = taxonomy_get_tree($vocabulary->vid);
  $destination = drupal_get_destination();
  $rows = array();
  foreach ($result as $key => $item) {
    $element['plid']['#attributes']['class'] = array(
      'menu-plid',
    );
    $element['mlid']['#attributes']['class'] = array(
      'menu-mlid',
    );
    $element['weight']['#attributes']['class'] = array(
      'menu-weight',
    );

    // Create row.
    $row = array();
    $row[] = theme('indentation', array(
      'size' => $item->depth,
    )) . $item->name;
    $row[] = media_browser_plus_folder_theme_folder_weight_column($item->weight, $item->tid, $item->parents[0]);
    $row[] = $item->description;
    $row[] = l(t('edit'), 'admin/content/media/folder/' . $item->tid . '/edit', array(
      'query' => $destination,
    ));
    $row[] = l(t('delete'), 'admin/content/media/folder/' . $item->tid . '/delete', array(
      'query' => $destination,
    ));

    // Change formate of row.
    $row = array(
      'data' => $row,
    );
    $row['class'][] = 'draggable';
    $rows[] = $row;
  }
  return $rows;
}