You are here

function asset_directory_options in Asset 5.2

Related topics

4 calls to asset_directory_options()
asset_form in ./asset.module
Generate the asset add/edit form array.
asset_import_form in contrib/asset_import/asset_import.module
asset_widget in modules/asset_content.inc
Implementation of hook_widget().
asset_widget_settings in modules/asset_content.inc
Implementation of hook_widget_settings().

File

./asset.module, line 527
Main module.

Code

function asset_directory_options() {
  $options = $children = array();
  $options[0] = '<none>';
  $result = db_query('SELECT aid, pid, title FROM {asset} WHERE type="directory" ORDER BY title');
  while ($asset = db_fetch_object($result)) {
    $list = isset($children[$asset->pid]) ? $children[$asset->pid] : array();
    $list[] = $asset;
    $children[$asset->pid] = $list;
  }
  $options += asset_directory_options_recurse(0, $children);
  return $options;
}