0 && stormproject_access('update', $form['project']['#value'])) { drupal_add_tabledrag('tasks', 'match', 'parent', 'task-parent-nid', 'task-parent-nid', 'task-nid', TRUE); drupal_add_tabledrag('tasks', 'order', 'sibling', 'task-weight'); } $header = array(); $row = array(); $header = $form['header']['#value']; unset($form['header']); foreach (element_children($form['tasks']) as $key) { $form['tasks'][$key]['task_parent-nid_'. $key]['#attributes']['class'] = 'task-parent-nid'; $form['tasks'][$key]['task_nid_'. $key]['#attributes']['class'] = 'task-nid'; $form['tasks'][$key]['task_weight_'. $key]['#attributes']['class'] = 'task-weight'; $durationunit = $form['tasks'][$key]['task_durationunit_'. $key]['#value']; $data = array( theme('indentation', $form['tasks'][$key]['task_depth_'. $key]['#value']) . drupal_render($form['tasks'][$key]['task_description_'. $key]), drupal_render($form['tasks'][$key]['task_category_'. $key]), drupal_render($form['tasks'][$key]['task_status_'. $key]), drupal_render($form['tasks'][$key]['task_priority_'. $key]), array( 'data' => sprintf('%.2f', drupal_render($form['tasks'][$key]['task_duration_'. $key])) .' '. substr($durationunit, 0, 1), 'style' => 'text-align: right'), drupal_render($form['tasks'][$key]['task_parent-nid_'. $key]) . drupal_render($form['tasks'][$key]['task_nid_'. $key]), drupal_render($form['tasks'][$key]['task_weight_'. $key]), array( 'data' => drupal_render($form['tasks'][$key]['task_operations_'. $key]), 'class' => 'storm_list_operations', ), ); if (!stormproject_access('update', $form['project']['#value'])) { unset($data[5]); unset($data[6]); } $row['data'] = $data; if (stormproject_access('update', $form['project']['#value'])) { $row['class'] = empty($row['class']) ? 'draggable' : $row['class'] .' draggable'; } $rows[] = $row; } $o = theme('table', $header, $rows, array('id' => 'tasks')); return $o; } function theme_stormtask_list($header, $tasks) { $rows = array(); foreach ($tasks as $task) { $rows[] = array( // Add classes to each row in table. // Allows customisation of row via css depending on the task's attributes (category, status, priority) 'class' => 'storm_category_'. preg_replace('/[^a-zA-Z]/', '', $task->taskcategory) . ' ' . 'storm_status_'. preg_replace('/[^a-zA-Z]/', '', $task->taskstatus) . ' ' . 'storm_priority_'. preg_replace('/[^a-zA-Z]/', '', $task->taskpriority), 'data' => array( l($task->organization_title, 'node/'. $task->organization_nid), l($task->project_title, 'node/'. $task->project_nid), l($task->title, 'node/'. $task->nid) . theme('mark', node_mark($task->nid, $task->changed)), storm_icon('category_'. check_plain($task->taskcategory), check_plain($task->taskcategory)), storm_icon('status_'. check_plain($task->taskstatus), check_plain($task->taskstatus)), storm_icon('priority_'. check_plain($task->taskpriority), check_plain($task->taskpriority)), array( 'data' => storm_icon_edit_node($task, $_GET) .' '. storm_icon_delete_node($task, $_GET), 'class' => 'storm_list_operations', ), ), ); } $o = theme('table', $header, $rows); return $o; } function theme_stormtask_view($node, $teaser = FALSE, $page = FALSE) { drupal_add_css(drupal_get_path('module', 'storm') . '/storm-node.css', 'module'); $node = node_prepare($node, $teaser); $l_pos = 1; // Used to increase the link position number (see issue 814820) $node->content['links'] = array( '#prefix' => '