Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit ce418dd

Browse files
author
David Barratt
committed
Issue #2462447 by davidwbarratt: Add the published status to the Draggable Table widget
1 parent e817f10 commit ce418dd

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

css/entityqueue.admin.css

+4
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@
1616
#entityqueue-overview-form td.operations .ctools-dropbutton {
1717
position: absolute;
1818
}
19+
20+
.entityqueue-dragtable .unpublished {
21+
color: #ff0000;
22+
}

entityqueue.module

+33
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,9 @@ function entityqueue_field_widget_form(&$form, &$form_state, $field, $instance,
936936
'js' => array(
937937
drupal_get_path('module', 'entityqueue') . '/js/entityqueue.widget.js' => array('type' => 'file'),
938938
),
939+
'css' => array(
940+
drupal_get_path('module', 'entityqueue') . '/css/entityqueue.admin.css' => array('type' => 'file'),
941+
),
939942
),
940943
);
941944

@@ -975,6 +978,36 @@ function entityqueue_field_widget_form(&$form, &$form_state, $field, $instance,
975978
$label = entity_label($target_type, $entities[$target_id]);
976979
$uri = entity_uri($target_type, $entities[$target_id]);
977980
$label = l($label, $uri['path']);
981+
982+
$published = TRUE;
983+
$types = array(
984+
'node',
985+
'comment',
986+
'user',
987+
);
988+
if (in_array($target_type, $types)) {
989+
if ($entities[$target_id]->status == 0) {
990+
$published = FALSE;
991+
}
992+
}
993+
elseif ($target_type == 'file') {
994+
if (isset($entities[$target_id]->published)) {
995+
if ($entities[$target_id]->published == 0) {
996+
$published = FALSE;
997+
}
998+
}
999+
}
1000+
1001+
if (!$published) {
1002+
if ($target_type == 'user') {
1003+
$status = t('Blocked');
1004+
}
1005+
else {
1006+
$status = t('Unpublished');
1007+
}
1008+
1009+
$label .= ' <span class="unpublished">(' . $status . ')<span>';
1010+
}
9781011
}
9791012
else {
9801013
$label = t('- Restricted access -');

0 commit comments

Comments
 (0)