<?php
/**
 * @file
 * Code for the Panopoly Event feature.
 */

include_once 'panopoly_event.features.inc';

/**
 * @file
 * Code for the Panopoly Event feature.
 */
function panopoly_event_ctools_plugin_directory($owner, $plugin_type) {
  if ($owner == 'ctools' && $plugin_type == 'content_types') {
    return 'plugins/' . $plugin_type;
  }
}

function panopoly_event_ctools_render_alter(&$info, &$page, &$context) {
  if(isset($context['handler']) && is_object($context['handler'])) {
    $handler = $context['handler'];
    if(property_exists($handler, 'name') && $handler->name == 'node_edit_panel_context') {
      ctools_add_css('date_tweaks', 'panopoly_event', 'inc/css');
    }

  }
}

/**
 * Implementation of hook_apps_app_info()
 */
function panopoly_event_apps_app_info() {
  return array(
    'demo content description' => 'Demo content for Panopoly Event feature',
    'demo content module' => 'panopoly_event_demo',
    'demo content link path' => 'event-demo',
  	'configure form' => 'panopoly_event_configure_form',
  );
}

/*
 * App configure form
 */
function panopoly_event_configure_form() {
  return array();
}

/**
 * Implements hook_apps_servers_info()
 */
function panopoly_event_apps_servers_info() {
  //$info =  drupal_parse_info_file(drupal_get_path('module', 'panopoly_event') . '/panopoly_event.info');
  return array(
    'panopoly_event' => array(
      'title' => 'Panopoly Events',
      'description' => 'Apps for Panopoly Events Distro',
      //'manifest' => (empty($info['version']) || $info['version'] == '7.x-1.x-dev' || strpos($info['version'], '-dev')) ? 'http://apps.int3c.com/panopoly-event-dev' : 'http://apps.int3c.com/panopoly-event',
      'manifest' => 'http://apps.int3c.com/app/query/event'
    ),
  );
}
