/[drupal]/contributions/modules/comment_info/comment_info.module
ViewVC logotype

Diff of /contributions/modules/comment_info/comment_info.module

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

revision 1.1.2.1.2.5, Tue Mar 20 23:33:38 2007 UTC revision 1.1.2.1.2.6, Sun Apr 1 21:43:16 2007 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: comment_info.module,v 1.1.2.1.2.4 2007/03/20 22:07:39 mfer Exp $  // $Id: comment_info.module,v 1.1.2.1.2.5 2007/03/20 23:33:38 mfer Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 69  function comment_info_form_alter($form_i Line 69  function comment_info_form_alter($form_i
69    if ($user->uid || ($form_id != 'comment_form')) {    if ($user->uid || ($form_id != 'comment_form')) {
70      return;      return;
71    }    }
72      $form['comment_info']['optin'] = array(
   if (variable_get('comment_info_setting', 0) == 1 || variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED) {  
     drupal_add_js(drupal_get_path('module', 'comment_info').'/comment_info.js');  
     $form['comment_info']['optin'] = array(  
73       '#type' => 'checkbox',       '#type' => 'checkbox',
74        '#title' => t('Save my Comment Information for next time.'),       '#title' => t('Save my Comment Information for next time.'),
       '#default_value' => $_SESSION['comment_info']['optin'] ,  
       '#attributes' => array('style' => 'display:none;'),  
75      );      );
76      if (variable_get('comment_info_setting', 0) == 1 || variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED) {
77        drupal_add_js(drupal_get_path('module', 'comment_info').'/comment_info.js');
78        $form['comment_info']['optin']['#attributes'] = array('style' => 'display:none;');
79    }    }
80    
81    else {    else {
# Line 89  function comment_info_form_alter($form_i Line 87  function comment_info_form_alter($form_i
87    
88      $form['#validate']['comment_info_validate'] = array();      $form['#validate']['comment_info_validate'] = array();
89    
90      $form['comment_info']['optin'] = array(      $form['comment_info']['optin']['#default_value'] = $_SESSION['comment_info']['optin'];
      '#type' => 'checkbox',  
       '#title' => t('Save my Comment Information for next time.'),  
       '#default_value' => $_SESSION['comment_info']['optin']  
     );  
91    }    }
92  }  }
93    

Legend:
Removed from v.1.1.2.1.2.5  
changed lines
  Added in v.1.1.2.1.2.6

  ViewVC Help
Powered by ViewVC 1.1.2