/[drupal]/contributions/modules/tapatio/comms.module
ViewVC logotype

Diff of /contributions/modules/tapatio/comms.module

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

revision 1.1.4.21 by evoltech, Tue Sep 22 22:21:29 2009 UTC revision 1.1.4.22 by evoltech, Wed Sep 23 07:55:59 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: comms.module,v 1.1.4.20 2009/09/22 01:04:54 evoltech Exp $  // $Id: comms.module,v 1.1.4.21 2009/09/22 22:21:29 evoltech Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 1150  function comms_dedup_submit($form_id, &$ Line 1150  function comms_dedup_submit($form_id, &$
1150  //TODO: this is a total hack ... there has to be a correct way to do this  //TODO: this is a total hack ... there has to be a correct way to do this
1151  function comms_search() {  function comms_search() {
1152    $return = drupal_get_form('comms_search_page');    $return = drupal_get_form('comms_search_page');
1153    
   
1154    if ($_SESSION['comms']['submit'] == 1) {    if ($_SESSION['comms']['submit'] == 1) {
1155      $timeframe = (isset($_SESSION['comms']['timeframe']) &&      $timeframe = (isset($_SESSION['comms']['timeframe']) &&
1156        $_SESSION['comms']['timeframe'] != '') ?        $_SESSION['comms']['timeframe'] != '') ?
# Line 1192  function comms_search() { Line 1191  function comms_search() {
1191        $categorized = '1';        $categorized = '1';
1192      }      }
1193    
1194      $args = array($timeframe, $rating, $dispatched, $categorized);      //@todo Can't we just have the view use a username argument?
1195        $user = 'All';
1196        if ($_SESSION['comms']['user']) {
1197          $user = user_load(array('name' => $_SESSION['comms']['user']));
1198          $user = $user ? $user->uid : 'All';
1199        }
1200    
1201        $args = array($timeframe, $dispatched, $categorized, $user);
1202    
1203      if ($_SESSION['comms']['display']) {      if ($_SESSION['comms']['display']) {
1204        drupal_add_js(drupal_get_path('module', 'comms') .'/js/comms.slim.js');        drupal_add_js(drupal_get_path('module', 'comms') .'/js/comms.slim.js');
# Line 1253  function comms_search_page() { Line 1259  function comms_search_page() {
1259      '#description' => t('Specify the format of the display you would like'),      '#description' => t('Specify the format of the display you would like'),
1260      '#default_value' => isset($_SESSION['comms']['display']) ?      '#default_value' => isset($_SESSION['comms']['display']) ?
1261        $_SESSION['comms']['display'] : 0,        $_SESSION['comms']['display'] : 0,
1262        );
1263    
1264    
1265      $form['user'] = array(
1266        '#type' => 'textfield',
1267        '#title' => t('Only show posts from the following user'),
1268        '#default_value' => isset($_SESSION['comms']['user']) ?
1269          $_SESSION['comms']['user'] : null,
1270        '#options' => $users,
1271        '#autocomplete_path' => 'user/autocomplete',
1272    );    );
1273    
1274    $form['submit'] = array(    $form['submit'] = array(
1275      '#type' => 'submit',      '#type' => 'submit',
1276      '#value' => t('Search'),      '#value' => t('Search'),
# Line 1321  function comms_search_page_submit($form_ Line 1338  function comms_search_page_submit($form_
1338      unset($_SESSION['comms']['display']);      unset($_SESSION['comms']['display']);
1339    }    }
1340    
1341    if (isset($form_values['urgency']) && is_numeric($form_values['urgency'])) {    if (isset($form_values['user'])) {
1342      $urgency = taxonomy_get_term($form_values['urgency']);      $_SESSION['comms']['user'] = $form_values['user'];
     $_SESSION['comms']['urgency']['name'] = $urgency->name;  
     $_SESSION['comms']['urgency']['tid'] = $urgency->tid;  
1343    }    }
1344    else {    else {
1345      unset($_SESSION['comms']['urgency']);      unset($_SESSION['comms']['user']);
1346    }    }
1347    
1348  }  }
1349    
1350  /***************************************/  /***************************************/
# Line 2341  function comms_cron() { Line 2357  function comms_cron() {
2357      //TODO: this should be split out into two parts, each of which can be      //TODO: this should be split out into two parts, each of which can be
2358      //turned on/off.  They are adding messages sent to our groups, and      //turned on/off.  They are adding messages sent to our groups, and
2359      //adding messages sent by our groups followers      //adding messages sent by our groups followers
2360      //comms_add_twitter_tweets();      comms_add_twitter_tweets();
2361    }//if    }//if
2362    else if (variable_get('comms_addfromgetfollowers', 0)) {    else if (variable_get('comms_addfromgetfollowers', 0)) {
2363      comms_add_from_get_followers($all_followers);      comms_add_from_get_followers($all_followers);

Legend:
Removed from v.1.1.4.21  
changed lines
  Added in v.1.1.4.22

  ViewVC Help
Powered by ViewVC 1.1.3