You are here

function asset_wizard in Asset 5

Same name and namespace in other branches
  1. 6 asset.module \asset_wizard()

Menu callback to load the asset popup window.

1 string reference to 'asset_wizard'
asset_menu in ./asset.module
Implementation of hook_menu()

File

./asset.module, line 565

Code

function asset_wizard() {

  // all wizard related functionality first comes through this function so load the wizard inc
  require_once drupal_get_path('module', 'asset') . '/asset_wizard.inc';
  drupal_add_js(array(
    'asset' => array(
      'basePath' => base_path(),
    ),
  ), 'setting');
  drupal_add_js(drupal_get_path('module', 'asset') . '/asset.js');
  drupal_add_css(drupal_get_path('module', 'asset') . '/asset_wizard.css');
  list($sites, $site, $lost) = split("/", drupal_get_path('module', 'asset'), 3);
  $theme = variable_get('asset_wizard_theme', drupal_get_path('module', 'asset') . '/themes/default/asset_wizard.css');
  drupal_add_css($theme);
  switch (arg(2)) {
    case 'textarea':
      drupal_add_js(drupal_get_path('module', 'asset') . '/asset_textarea.js');
      break;
    case 'textfield':
      drupal_add_js(drupal_get_path('module', 'asset') . '/asset_textfield.js');
      break;
    case 'tinymce':
      drupal_add_js(drupal_get_path('module', 'tinymce') . '/tinymce/jscripts/tiny_mce/tiny_mce_popup.js');
      drupal_add_js(drupal_get_path('module', 'asset') . '/tinymce/asset_tinymce.js');
      break;
  }
  $output = drupal_get_form('asset_wizard_form');
  ob_end_clean();
  print theme('asset_popup', $output);
  exit;
}