Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tablefield-3199886
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
tablefield-3199886
Commits
53348454
Commit
53348454
authored
14 years ago
by
Kevin Hankens
Browse files
Options
Downloads
Patches
Plain Diff
Handling for machine names instead of input format deltas
parent
07dbbc93
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tablefield.install
+57
-17
57 additions, 17 deletions
tablefield.install
tablefield.module
+8
-5
8 additions, 5 deletions
tablefield.module
with
65 additions
and
22 deletions
tablefield.install
+
57
−
17
View file @
53348454
...
...
@@ -2,35 +2,75 @@
// $Id$
/**
* @file
* Installation options for TableField
*/
* @file
* Installation options for TableField
*/
/*
* Implement
ation
of hook_install().
*/
/*
*
* Implement
s
of hook_install().
*/
function
tablefield_install
()
{
}
/**
* Implement
ation
of hook_uninstall().
*/
* Implement
s
of hook_uninstall().
*/
function
tablefield_uninstall
()
{
}
/**
* Implement
ation
of hook_enable().
*
* Notify content module when this module is enabled.
*/
* Implement
s
of hook_enable().
*
* Notify content module when this module is enabled.
*/
function
tablefield_enable
()
{
}
/**
* Implement
ation
of hook_disable().
*
* Notify content module when this module is disabled.
*/
* Implement
s
of hook_disable().
*
* Notify content module when this module is disabled.
*/
function
tablefield_disable
()
{
}
?>
/**
* Implements hook_update_dependencies().
*/
function
tablefield_update_dependencies
()
{
// Ensure that format columns are only changed after Filter module has changed
// the primary records.
$dependencies
[
'text'
][
7000
]
=
array
(
'filter'
=>
7010
,
);
return
$dependencies
;
}
/**
* Update schema to handle machine names of input filter formats.
*/
function
tablefield_update_7000
()
{
$spec
=
array
(
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
FALSE
,
);
$fields
=
_update_7000_field_read_fields
(
array
(
'module'
=>
'tablefield'
,
'storage_type'
=>
'field_sql_storage'
,
));
foreach
(
$fields
as
$field_name
=>
$field
)
{
if
(
$field
[
'deleted'
])
{
$table
=
"field_deleted_data_
{
$field
[
'id'
]
}
"
;
$revision_table
=
"field_deleted_revision_
{
$field
[
'id'
]
}
"
;
}
else
{
$table
=
"field_data_
{
$field
[
'field_name'
]
}
"
;
$revision_table
=
"field_revision_
{
$field
[
'field_name'
]
}
"
;
}
$column
=
$field
[
'field_name'
]
.
'_'
.
'format'
;
db_change_field
(
$table
,
$column
,
$column
,
$spec
);
db_change_field
(
$revision_table
,
$column
,
$column
,
$spec
);
}
}
This diff is collapsed.
Click to expand it.
tablefield.module
+
8
−
5
View file @
53348454
...
...
@@ -31,12 +31,14 @@ function tablefield_field_info() {
*/
function
tablefield_field_settings_form
(
$field
,
$instance
,
$has_data
)
{
$form
=
array
();
$options
=
array
(
0
=>
t
(
'Plain text'
),
1
=>
t
(
'Filtered text (user selects input format)'
));
$form
[
'cell_processing'
]
=
array
(
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Table cell processing'
),
'#default_value'
=>
isset
(
$field
[
'settings'
][
'cell_processing'
])
?
$field
[
'settings'
][
'cell_processing'
]
:
0
,
'#options'
=>
$options
,
'#options'
=>
array
(
t
(
'Plain text'
),
t
(
'Filtered text (user selects input format)'
)
),
);
$form
[
'default_message'
]
=
array
(
'#type'
=>
'markup'
,
...
...
@@ -57,9 +59,10 @@ function tablefield_field_schema($field) {
'size'
=>
'big'
,
),
'format'
=>
array
(
'type'
=>
'int'
,
'unsigned'
=>
TRUE
,
'not null'
=>
FALSE
,
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default value'
=>
''
,
),
),
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment