function asset_wizard_toolbar in Asset 5
Same name and namespace in other branches
- 6 asset_wizard.inc \asset_wizard_toolbar()
- 6 inc/asset_wizard.inc \asset_wizard_toolbar()
Build a list of available asset_types that can be used.
1 call to asset_wizard_toolbar()
- theme_asset_wizard_form in ./
asset_wizard.inc - Main theme function for asset_wizard_form.
File
- ./
asset_wizard.inc, line 870
Code
function asset_wizard_toolbar($dir = '') {
$qarray = $_GET;
$qarray['dir'] = $dir;
$buttons = array();
// Create Choose button
$choose = t('Choose');
$html = theme('image', drupal_get_path('module', 'asset') . '/icon.png', $choose, $choose, NULL, FALSE) . '<br/>' . $choose;
$qstring = drupal_query_string_encode($qarray, array(
'q',
'aid',
'op',
));
$buttons[] = l($html, 'asset/wizard/' . arg(2), array(), $qstring, null, false, true);
// Create other buttons
foreach (module_implements('asset_type') as $module) {
$types = module_invoke($module, 'asset_type', 'info');
foreach ($types as $delta => $type) {
if (user_access('create ' . $delta . ' assets') || user_access('administer assets')) {
if ($type['src']) {
$html = theme('image', $type['src'], $type['value'], $type['value'], NULL, FALSE) . '<br/>' . $type['value'];
}
else {
$html = $type['value'];
}
$qarray['op'] = $type['value'];
$qstring = drupal_query_string_encode($qarray, array(
'q',
'aid',
));
$buttons[] = l($html, 'asset/wizard/' . arg(2), array(), $qstring, null, false, true);
}
}
// add class to last button from each module
$i = count($buttons) - 1;
if (!is_array($buttons[$i])) {
$buttons[$i] = array(
'data' => $buttons[$i],
'class' => 'last',
);
}
}
return theme('item_list', $buttons);
}