function libraries_admin_directory_layout in Libraries API 7.2
Returns the directory layout of the library, if possible.
The result of this function can help users to verify that they have uploaded the library to the correct location.
Parameters
array $library: A library information array.
Return value
array|false A renderable array containing the directory layout of the library or FALSE if a directory layout could not be generated.
3 calls to libraries_admin_directory_layout()
- libraries_admin_instructions_missing in ./
libraries.admin.inc - Returns instructions for dealing with a missing library.
- libraries_admin_instructions_undetected in ./
libraries.admin.inc - Returns instructions for dealing with an undetected library.
- libraries_admin_instructions_unsupported in ./
libraries.admin.inc - Returns instructions for dealing with an unsupported library.
File
- ./
libraries.admin.inc, line 453 - Provides administrative page and form callbacks for Libraries module.
Code
function libraries_admin_directory_layout(array $library) {
$build = array(
'#theme' => 'item_list',
'#type' => 'ul',
'#items' => array(),
);
$items =& $build['#items'];
if ($library['path']) {
$items =& libraries_admin_path_to_tree($items, $library['path']);
}
foreach (array(
'js',
'css',
'php',
) as $type) {
if (!empty($library['files'][$type])) {
$files = array_keys($library['files'][$type]);
foreach ($files as $file) {
// Skip JavaScript settings.
if (is_int($file)) {
continue;
}
$children =& $items;
libraries_admin_path_to_tree($children, $file);
}
}
}
return $build['#items'] ? $build : FALSE;
}