/[drupal]/contributions/modules/uts/plugins/uts_path/uts_path.module
ViewVC logotype

Diff of /contributions/modules/uts/plugins/uts_path/uts_path.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.17, Tue May 26 16:10:21 2009 UTC revision 1.18, Sat May 30 02:36:10 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: uts_path.module,v 1.16 2009/01/15 06:54:28 boombatower Exp $  // $Id: uts_path.module,v 1.17 2009/05/26 16:10:21 boombatower Exp $
3  /**  /**
4   * @file   * @file
5   * Collect the user path taken to complete a task and compare to defined ideal path.   * Collect the user path taken to complete a task and compare to defined ideal path.
# Line 211  function uts_path_form_uts_task_node_for Line 211  function uts_path_form_uts_task_node_for
211    $form['uts_path']['record'] = array(    $form['uts_path']['record'] = array(
212      '#type' => 'submit',      '#type' => 'submit',
213      '#value' => t('Record steps'),      '#value' => t('Record steps'),
214          '#submit' => array('node_form_submit', 'uts_path_open_record_ideal'),      '#submit' => array('node_form_submit', 'uts_path_open_record_ideal'),
215      '#weight' => -9,      '#weight' => -9,
216    );    );
217    $form['uts_path']['clear'] = array(    $form['uts_path']['clear'] = array(
# Line 230  function uts_path_open_record_ideal($for Line 230  function uts_path_open_record_ideal($for
230    $form_state['rebuild'] = FALSE; // Reset changed rebuild attribute, so that #redirect still works.    $form_state['rebuild'] = FALSE; // Reset changed rebuild attribute, so that #redirect still works.
231    
232    variable_set('uts_path_ideal_recorder', UTS_PATH_RECORDER_OPEN);    variable_set('uts_path_ideal_recorder', UTS_PATH_RECORDER_OPEN);
233    variable_set('uts_path_ideal_recorder_task_nid', $node->nid);    variable_set('uts_path_ideal_recorder_task_nid', $form_state['nid']);
234    
235    // TODO Figure out how to make ideal path recorder work cleanly in base environment.    // TODO Figure out how to make ideal path recorder work cleanly in base environment.
236  /*  /*
# Line 260  function uts_path_open_record_ideal($for Line 260  function uts_path_open_record_ideal($for
260   * @return string HTML output.   * @return string HTML output.
261   */   */
262  function uts_path_render_ideal($task_nid) {  function uts_path_render_ideal($task_nid) {
   $result = db_query('SELECT path, breadcrumb, title  
                       FROM {uts_path_ideal}  
                       WHERE task_nid = %d  
                       ORDER BY weight ASC', $task_nid);  
   $header = array(t('Path'), t('Breadcrumb'), t('Title'));  
263    $rows = array();    $rows = array();
264    while ($record = db_fetch_array($result)) {    if ($task_nid) {
265      $rows[] = $record;      $result = db_query('SELECT path, breadcrumb, title
266                            FROM {uts_path_ideal}
267                            WHERE task_nid = %d
268                            ORDER BY weight ASC', $task_nid);
269        $header = array(t('Path'), t('Breadcrumb'), t('Title'));
270        while ($record = db_fetch_array($result)) {
271          $rows[] = $record;
272        }
273    }    }
274    return (count($rows) > 0 ? theme('table', $header, $rows) : t('No path to display.'));    return (count($rows) > 0 ? theme('table', $header, $rows) : t('No path to display.'));
275  }  }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.2