You are here

function video_filter_dashboard_page in Video Filter 7.3

Same name and namespace in other branches
  1. 6.3 video_filter.module \video_filter_dashboard_page()

Creates the dashboard.

1 string reference to 'video_filter_dashboard_page'
video_filter_menu in ./video_filter.module
Implements hook_menu().

File

./video_filter.module, line 505

Code

function video_filter_dashboard_page($editor) {
  module_invoke('admin_menu', 'suppress');

  // Add CSS.
  drupal_add_css(drupal_get_path('module', 'video_filter') . '/css/video_filter.css');
  switch ($editor) {
    case 'wysiwyg_tinymce':

      // Add JavaScript.  First, we'll need to determine what version we're on.
      $has_added_js = FALSE;

      // Solves bug that causes tinymce.inc to not be loaded.
      wysiwyg_load_includes('editors', 'editor', 'tinymce');

      // Check for TinyMCE 4.x first.
      if (function_exists('wysiwyg_tinymce_editor')) {
        $loaded_editor = wysiwyg_tinymce_editor();
        $version = wysiwyg_tinymce_version($loaded_editor['tinymce']);
        if (version_compare($version, '4', '>=')) {
          drupal_add_js(drupal_get_path('module', 'video_filter') . '/editors/tinymce/video_filter-4.js');
          $has_added_js = TRUE;
        }
      }

      // Add JS for <= TinyMCE 3.x.
      if (!$has_added_js) {
        drupal_add_js(wysiwyg_get_path('tinymce') . '/jscripts/tiny_mce/tiny_mce_popup.js');
        drupal_add_js(drupal_get_path('module', 'video_filter') . '/editors/tinymce/video_filter.js');
      }
      break;
    case 'ckeditor':
    case 'wysiwyg_ckeditor':

      // Add JavaScript.
      drupal_add_js(drupal_get_path('module', 'video_filter') . '/editors/ckeditor/video_filter_dialog.js');
      break;
    case 'fckeditor':
    case 'wysiwyg_fckeditor':

      // Add JavaScript.
      drupal_add_js(drupal_get_path('module', 'video_filter') . '/editors/fckeditor/video_filter/video_filter_dialog.js');
      break;
  }
  $form = drupal_get_form('_video_filter_form');
  print theme('video_filter_dashboard', array(
    'form' => render($form),
  ));
  exit;
}