home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (calendar_ical.module)

This example Drupal source code file (calendar_ical.module) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

array, calendar, check, div, function, ical, image, path, php, return, title, to, url, variables

The calendar_ical.module Drupal example source code

<?php
// $Id: calendar_ical.module,v 1.6 2010/08/22 02:23:48 karens Exp $

/**
 * Implementation of hook_views_api().
 *
 * This one is used as the base to reduce errors when updating.
 */
function calendar_ical_views_api() {
  return array(
    'api' => 2,
    'path' => drupal_get_path('module', 'calendar_ical'),
  );
}

/**
 * @file
 * Adds ical functionality to Calendar.
 */
function calendar_ical_theme() {
  return array(
    'calendar_ical_icon' => array(
      'variables' => array('url'),
      ),
    );
}

function theme_calendar_ical_icon($vars) {
  $url = $vars['url'];
  $variables = array(
    'path' => drupal_get_path('module', 'date_api') . '/images/ical16x16.gif', 
    'title' => t('Add to calendar'), t('Add to calendar'),
  );
  if ($image = theme('image', $variables)) {
    return '<div style="text-align:right"><a href="' . check_url($url) . '" class="ical-icon" title="ical">' . $image . '</a></div>';
  }
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal calendar_ical.module source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.