-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alex Barth
committed
Oct 10, 2010
0 parents
commit 2c31266
Showing
4 changed files
with
1,169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; $Id: text.info,v 1.8 2010/08/16 20:57:22 dries Exp $ | ||
name = Text | ||
description = Defines simple text field types. | ||
package = Core | ||
version = VERSION | ||
core = 7.x | ||
dependencies[] = field | ||
files[] = text.module | ||
files[] = text.test | ||
required = TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
// $Id: text.install,v 1.2 2010/09/29 01:37:02 dries Exp $ | ||
|
||
/** | ||
* @file | ||
* Install, update and uninstall functions for the text module. | ||
*/ | ||
|
||
/** | ||
* Implements hook_field_schema(). | ||
*/ | ||
function text_field_schema($field) { | ||
switch ($field['type']) { | ||
case 'text': | ||
$columns = array( | ||
'value' => array( | ||
'type' => 'varchar', | ||
'length' => $field['settings']['max_length'], | ||
'not null' => FALSE, | ||
), | ||
); | ||
break; | ||
|
||
case 'text_long': | ||
$columns = array( | ||
'value' => array( | ||
'type' => 'text', | ||
'size' => 'big', | ||
'not null' => FALSE, | ||
), | ||
); | ||
break; | ||
|
||
case 'text_with_summary': | ||
$columns = array( | ||
'value' => array( | ||
'type' => 'text', | ||
'size' => 'big', | ||
'not null' => FALSE, | ||
), | ||
'summary' => array( | ||
'type' => 'text', | ||
'size' => 'big', | ||
'not null' => FALSE, | ||
), | ||
); | ||
break; | ||
} | ||
$columns += array( | ||
'format' => array( | ||
'type' => 'int', | ||
'unsigned' => TRUE, | ||
'not null' => FALSE, | ||
), | ||
); | ||
return array( | ||
'columns' => $columns, | ||
'indexes' => array( | ||
'format' => array('format'), | ||
), | ||
'foreign keys' => array( | ||
'format' => array( | ||
'table' => 'filter_format', | ||
'columns' => array('format' => 'format'), | ||
), | ||
), | ||
); | ||
} |
Oops, something went wrong.