Closed (fixed)
Project:
Workflow
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Jul 2008 at 16:14 UTC
Updated:
15 Jan 2009 at 23:50 UTC
Jump to comment: Most recent file
The following code can be changed from:
/**
* Theme the workflow permissions view.
*/
function theme_workflow_permissions($header, $all) {
$output = '';
foreach ($all as $role => $value) {
$output .= '<h3>'. t("%role may do these transitions:", array('%role' => $value['name'])) .'</h3>';
if (!empty($value['transitions'])) {
$output .= theme('table', $header, $value['transitions']) . '<p></p>';
}
else {
$output .= '<table><tbody><tr class="even"><td>' . t('None') . '</td><td></tr></tbody></table><p></p>';
}
}
return $output;
}
to:
/**
* Theme the workflow permissions view.
*/
function theme_workflow_permissions($header, $all) {
$output = '';
foreach ($all as $role => $value) {
$rows = array();
$output .= '<h3>'. t("%role may do these transitions:", array('%role' => $value['name'])) .'</h3>';
if (empty($value['transitions'])) {
$rows[] = array(array('data' => t('None'), 'colspan' => 2));
}
else {
$rows = $value['transitions'];
}
$output .= theme('table', $header, $rows) . '<p></p>';
}
return $output;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Picture 1.png | 12.35 KB | avpaderno |
Comments
Comment #1
avpadernoThis version corrects a little "glitch" in the UI.
Comment #2
jvandyk commentedOptimization is not a concern on the edit workflow page.
I'm not sure what glitch in the UI you are referring to. Perhaps the fact that the first row of the table showing no transitions is not dark. I have changed the class to "odd" to make this happen. The code above makes "To" and "From" headers above the rows with no transitions, which I find confusing.
Comment #3
avpadernoThat is how Drupal core modules show a table; if there aren't rows in the table, the table headers are always shown.
Comment #4
avpadernoYou can see it in the comments page, like the screenshot shows.