You are here

function _media_browser_plus_folder_hierarchy_list in Media Browser Plus 7

Same name and namespace in other branches
  1. 7.2 media_browser_plus.module \_media_browser_plus_folder_hierarchy_list()

Creates the folder media tree.

1 call to _media_browser_plus_folder_hierarchy_list()
media_browser_plus_grid_view_form in ./media_browser_plus.module
Appends main grid view form.

File

./media_browser_plus.module, line 1081
Adds fields to the media browser forms for better UX

Code

function _media_browser_plus_folder_hierarchy_list($list) {
  if (!isset($list['parents']) || !isset($list['children'])) {
    return;
  }
  if (count($list['parents']) == 0) {
    return t('No folders created yet');
  }
  else {
    if (_media_browser_plus_has_unsorted_media()) {
      $all_folders = array();
      $all_folders[0] = new stdClass();
      $all_folders[0]->name = t('Unsorted');
      $all_folders[0]->tid = 0;
      $list['parents'] = array_merge($all_folders, $list['parents']);
    }
    return _media_browser_plus_folder_hierarchy_list_helper($list['parents'], $list['children']);
  }
}