mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
Add action links to asset importers on asset listing pages.
This commit is contained in:
parent
da5fa1bf6d
commit
822c9dbec0
1 changed files with 28 additions and 0 deletions
|
@ -14,3 +14,31 @@ function farm_import_ctools_plugin_api($module = NULL, $api = NULL) {
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements hook_farm_ui_actions().
|
||||||
|
*/
|
||||||
|
function farm_import_farm_ui_actions() {
|
||||||
|
$actions = array();
|
||||||
|
|
||||||
|
// Load entity UI information.
|
||||||
|
$ui_info = farm_ui_entities();
|
||||||
|
|
||||||
|
// Add action links to asset importers on asset listing pages.
|
||||||
|
if (!empty($ui_info['farm_asset'])) {
|
||||||
|
foreach ($ui_info['farm_asset'] as $bundle => $info) {
|
||||||
|
if (!empty($info['view'])) {
|
||||||
|
$actions[$bundle . '_import'] = array(
|
||||||
|
'title' => t('Import') . ' ' . strtolower($info['label_plural']),
|
||||||
|
'href' => 'import/farm_asset_' . $bundle,
|
||||||
|
'views' => array(
|
||||||
|
$info['view'],
|
||||||
|
),
|
||||||
|
'weight' => 100,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $actions;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue