summaryrefslogtreecommitdiff
path: root/calendario.module
blob: 23ae7b2ee3354fbfb7a55ed74054d90155eaaa9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php

/**
 * @file
 * Calendario de Movimentos Sociais.
 */

/**
 * Implements hook_theme()
 */
function calendario_theme($existing, $type, $theme, $path) {
  return array(
    /*
     *'forum_icon' => array(
     *  'variables' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0),
     *),
     *'status_report' => array(
     *  'render element' => 'requirements',
     *  'file' => 'system.admin.inc',
     *),
     */
    'embed-widget' => array(
      'template'   => 'calendario-embed-widget',
      'variables'  => array('' => NULL, '' => NULL),
    ),
  );
}

/**
 * Implements hook_entity_info_alter()
 */
function calendario_entity_info_alter(&$entity_info) {
  // Set the controller class for nodes to an alternate implementation of the
  // DrupalEntityController interface.
  /*
   *$entity_info['node']['controller class'] = 'MyCustomNodeController';
   */
  /* Your code here */
}

/**
 * Include a calendar widget.
 *
 * @todo: $period, $type
 */
function calendario_widget($view = NULL) {
  return theme('embed-widget');
}

/**
 * Implements hook_views_post_render()
 */
function calendario_views_post_render(&$view, &$output, &$cache) {
  if (substr($view->name, 0, 10) == 'calendario' && substr($view->name, 0, 17) != 'calendario_widget') {
    $output .= calendario_widget($view);
  }
}