? .cvsignore
? soundcloud_filter-wysiwyg.patch
? theme
? wysiwyg
Index: soundcloud_filter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/soundcloud_filter/soundcloud_filter.module,v
retrieving revision 1.2
diff -u -p -r1.2 soundcloud_filter.module
--- soundcloud_filter.module	31 Aug 2010 17:41:36 -0000	1.2
+++ soundcloud_filter.module	17 Oct 2010 18:53:45 -0000
@@ -2,6 +2,69 @@
 // $Id: soundcloud_filter.module,v 1.2 2010/08/31 17:41:36 attilafekete Exp $
 
 /**
+ * Implementation of hook_menu().
+ *
+ * @return An array of menu items.
+ */
+function soundcloud_filter_menu() {
+  $items = array();
+
+  $items['soundcloud-filter/wysiwyg'] = array(
+    'title' => 'Wysiwyg Popup',
+    'description' => 'description',
+    'page callback' => 'soundcloud_filter_wysiwyg_popup',
+    'page arguments' => array('callback_arg'),
+    'access arguments' => array('access soundcloud filter wysiwyg popup'),
+  );
+
+  return $items;
+}
+
+/**
+ * Implementation of hook_perm().
+ *
+ * @return array An array of valid permissions for the soundcloud_filter module
+ */
+function soundcloud_filter_perm() {
+  return array('access soundcloud filter wysiwyg popup');
+}
+
+/**
+ * Load the WYSIWYG popup window.
+ *
+ * @return NULL
+ */
+function soundcloud_filter_wysiwyg_popup() {
+  $path = base_path() . drupal_get_path('module', 'soundcloud_filter');
+  $tinymce_path = base_path() .'sites/all/libraries';
+  $tinymce_js = $tinymce_path .'/tinymce/jscripts/tiny_mce/tiny_mce_popup.js';
+
+  echo theme('soundcloud_filter_wysiwyg_popup', $path, $tinymce_path, $tinymce_js);
+
+  return NULL;
+}
+
+/**
+ * Implementation of hook_wysiwyg_plugin().
+ */
+function soundcloud_filter_wysiwyg_plugin($editor, $version) {
+  switch ($editor) {
+    case 'tinymce':
+      if ($version > 3) {
+        return array(
+          'soundcloud_filter' => array(
+            'path' => drupal_get_path('module', 'soundcloud_filter') .'/wysiwyg/tinymce/editor_plugin.js',
+            'buttons' => array('soundcloud_filter' => t('Soundcloud filter')),
+            'url' => 'http://drupal.org/project/soundcloud_filter',
+            'load' => TRUE,
+          ),
+        );
+      }
+      break;
+  }
+}
+
+/**
  * Implementation of hook_filter().
  */
 function soundcloud_filter_filter($op, $delta = 0, $format = -1, $text = '') {
@@ -68,6 +131,15 @@ function soundcloud_filter_theme() {
         'host' => NULL,
       ),
     ),
+    'soundcloud_filter_wysiwyg_popup' => array(
+      'arguments' => array(
+        'path' => NULL,
+        'tinymce_path' => NULL,
+        'tinymce_js' => NULL,
+      ),
+      'template' => 'soundcloud-filter-wysiwyg-popup',
+      'path' => drupal_get_path('module', 'soundcloud_filter') . '/theme',
+    ),
   );
 }
 
