Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
8bd692d6
Commit
8bd692d6
authored
Nov 20, 2007
by
Gábor Hojtsy
Browse files
#193572
by Crell: fix drag and drop documentation and add drag and drop ordering to filter formats
parent
4c0a0006
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
8bd692d6
...
...
@@ -1957,6 +1957,16 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
* $form['my_elements'][$delta]['weight']['#attributes']['class'] = "my-elements-weight";
* @endcode
*
* Each row of the table must also have a class of "draggable" in order to enable the
* drag handles:
* @code
* $row = array(...);
* $rows[] = array(
* 'data' => $row,
* 'class' => 'draggable',
* );
* @endcode
*
* Calling drupal_add_tabledrag() would then be written as such:
* @code
* drupal_add_tabledrag('my-module-table', 'order', 'sibling', 'my-elements-weight');
...
...
modules/filter/filter.admin.inc
View file @
8bd692d6
...
...
@@ -357,13 +357,19 @@ function theme_filter_admin_order($form) {
foreach
(
element_children
(
$form
[
'names'
])
as
$id
)
{
// Don't take form control structures.
if
(
is_array
(
$form
[
'names'
][
$id
]))
{
$rows
[]
=
array
(
drupal_render
(
$form
[
'names'
][
$id
]),
drupal_render
(
$form
[
'weights'
][
$id
]));
$form
[
'weights'
][
$id
][
'#attributes'
][
'class'
]
=
'filter-order-weight'
;
$rows
[]
=
array
(
'data'
=>
array
(
drupal_render
(
$form
[
'names'
][
$id
]),
drupal_render
(
$form
[
'weights'
][
$id
])),
'class'
=>
'draggable'
,
);
}
}
$output
=
theme
(
'table'
,
$header
,
$rows
);
$output
=
theme
(
'table'
,
$header
,
$rows
,
array
(
'id'
=>
'filter-order'
)
);
$output
.
=
drupal_render
(
$form
);
drupal_add_tabledrag
(
'filter-order'
,
'order'
,
'sibling'
,
'filter-order-weight'
,
NULL
,
NULL
,
FALSE
);
return
$output
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment