You are here

function asset_wizard_main in Asset 6

Same name and namespace in other branches
  1. 5.2 asset_wizard.module \asset_wizard_main()
1 string reference to 'asset_wizard_main'
asset_wizard_menu in ./asset_wizard.module
Implementation of hook_menu().

File

./asset_wizard.module, line 394
Wizard-style interface for Asset.

Code

function asset_wizard_main() {
  $config = asset_wizard_get_config();
  $items = array();
  foreach (asset_wizard_methods() as $key => $method) {
    $items[] = tbl($method['name'], 'asset/wizard/method/' . $key) . '<br/>' . $method['description'];
  }
  $create = array();
  foreach (asset_get_types() as $type) {
    if (!$config['allowed_types'] || $config['allowed_types'][$type->type] && asset_access('create', $type->type)) {
      $type_url_str = str_replace('_', '-', $type->type);
      $text = t('New !type', array(
        '!type' => drupal_ucfirst($type->name),
      ));
      $create[] = tbl($text, 'asset/wizard/add/' . $type_url_str, array(), NULL, NULL, FALSE, TRUE) . '<br />' . $type->description;
    }
  }
  $items[] = array(
    'data' => '<h3>' . t('Create...') . '</h3>',
    'children' => $create,
  );
  $content = theme('asset_wizard_main', $items);
  return theme('asset_wizard_page', $content);
}