--- flvmediaplayer.module 2009-07-13 14:12:26.000000000 -0500 +++ flvmediaplayer.module.fixed 2010-02-03 01:24:12.000000000 -0600 @@ -1120,4 +1120,19 @@ function theme_flvmediaplayer_display($n if ($data) { return theme('flvmediaplayer_render_player', $data['player_path'], $data['params'], $data['flashvars']); } -} \ No newline at end of file +} + +/** + * Implementation of HOOK_ctools_plugin_directory + * @param string $module + * module requesting plugin directory information + * @param string $plugin_type + * type of plugin within the module + * @return relative location of the plugins/content_type directory + */ +function flvmediaplayer_ctools_plugin_directory($module, $plugin_type) { + if ($module == 'ctools' && $plugin_type == 'content_types') { + return 'plugins/content_types'; + } +} + --- plugins/content_types/flvmediaplayer.inc.absent 1969-12-31 18:00:00.000000000 -0600 +++ plugins/content_types/flvmediaplayer.inc 2010-02-03 01:08:33.000000000 -0600 @@ -0,0 +1,63 @@ + t('flvmediaplayer'), + 'content_types' => 'flvmediaplayer', + 'single' => TRUE, + 'render callback' => 'flvmediaplayer_flvmediaplayer_content_type_render', + 'edit form' => 'flvmediaplayer_flvmediaplayer_content_type_edit_form', + 'icon' => 'icon_node.png', // TODO: choose different icon + 'description' => t('Flash Media Player'), + 'required context' => new ctools_context_required(t('Node'), 'node'), + 'category' => t('Contributed modules'), + ); +} + +/** + * Render a pane of the 'flvmediaplayer' content type. + * + * Outputs the flvmediaplayer based on a given nid, as provided by the $context. + */ +function flvmediaplayer_flvmediaplayer_content_type_render($subtype, $conf, $panel_args, &$context) { + $node = isset($context->data) ? drupal_clone($context->data) : NULL; + $block = new stdClass(); + $block->module = 'flvmediaplayer'; + $block->subject = ''; + + $enabled_types = variable_get('flvmediaplayer_types', array()); + // is this node type enabled to have players displayed on it? + if ($enabled_types[$node->type]) { + // get the configuration values for this node + if ($node->flvmediaplayer_config = flvmediaplayer_node_configuration_values($node)) { + // get a player if one exists for this node + if ($player = theme('flvmediaplayer_node_display', $node)) { + // insert the player into the node body + $block->delta = $node->nid; + $block->content = $player; + // add the player on the node object for themers + $node->flvmediaplayer_display = $player; + } + } + } + + return $block; +} + +/** + * Return an edit form for the flvmediaplayer content type. + */ +function flvmediaplayer_flvmediaplayer_content_type_edit_form($id, $parents, $conf = array()) { + $form['id'] = array( + '#type' => 'value', + '#value' => $id, + ); + return $form; +} + + +