You are here

function asset_wizard in Asset 6

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

Menu callback to load the asset popup window.

3 string references to 'asset_wizard'
asset_menu in ./asset.module
Implementation of hook_menu()
theme_asset_wizard_textarea_link in ./asset_wizard.module
Theme the textarea link
theme_asset_wizard_textfield_preview in ./asset_wizard.module

File

./asset.module, line 303

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') . '/inc/asset_wizard.inc';
  $theme = variable_get('asset_wizard_theme', drupal_get_path('module', 'asset') . '/misc/themes/default/asset_wizard.css');
  drupal_add_css($theme);
  switch (arg(2)) {
    case 'textarea':
      drupal_add_js(drupal_get_path('module', 'asset') . '/misc/asset_textarea.js');
      break;
    case 'textfield':
      drupal_add_js(drupal_get_path('module', 'asset') . '/misc/asset_textfield.js');
      break;
    case 'tinymce':
      if (module_exists('tinytinymce')) {
        $path = drupal_get_path('module', 'tinytinymce');
        drupal_add_js($path . '/tinymce/jscripts/tiny_mce/tiny_mce.js');
        drupal_add_js($path . '/tinymce/jscripts/tiny_mce/tiny_mce_popup.js');
      }
      else {
        drupal_add_js(drupal_get_path('module', 'asset') . '/misc/tinymce/jscripts/tiny_mce/tiny_mce_popup.js');
      }
      drupal_add_js(drupal_get_path('module', 'asset') . '/misc/tinymce/asset_tinymce.js');
      break;
  }
  drupal_add_js(drupal_get_path('module', 'asset') . '/misc/asset.js');
  drupal_add_css(drupal_get_path('module', 'asset') . '/misc/asset_wizard.css');
  $output = drupal_get_form('asset_wizard_form');
  ob_end_clean();
  print theme('asset_popup', $output);
  exit;
}