Skip to content

Instantly share code, notes, and snippets.

View cyberswat's full-sized avatar

Kevin Bridges cyberswat

View GitHub Profile
@cyberswat
cyberswat / gist:799489
Created January 27, 2011 23:02
_complex_widget_installed_instances()
<?php
/**
* Return a structured array defining the instances for this content type.
*
* This is provided as a function so that it can be used in both hook_install()
* and hook_uninstall().
*/
function _complex_widget_installed_instances() {
$types = array(t('number'), t('string'));
return array(
@cyberswat
cyberswat / gist:799451
Created January 27, 2011 22:39
_complex_widget_installed_fields()
<?php
/**
* Return a structured array defining the fields created by this content type.
*
* This is packaged in a function so it can be used in both
* node_example_install() and node_example_uninstall().
*/
function _complex_widget_installed_fields() {
return array(
'complex_widget_variable' => array(
@cyberswat
cyberswat / gist:799394
Created January 27, 2011 22:11
hook_install
<?php
/**
* Implements hook_install().
*/
function complex_widget_install() {
// Create the content type using node_content as the base.
$t = get_t();
$node_type = array(
'type' => 'my_node_type',
'name' => $t('Complex widget example'),
@cyberswat
cyberswat / complex_widget.info
Created January 27, 2011 22:05
complex_widget.info
; $Id$
name = complex widget
description = Example content type with a complex widget.
package = examples
core = 7.x
files[] = complex_widget.install
files[] = complex_widget.module