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

Diff of /contributions/modules/ezmlm/ezmlm.module

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

revision 1.18.4.1.2.4, Tue Dec 16 22:10:26 2008 UTC revision 1.18.4.1.2.5, Fri Aug 21 22:22:33 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: ezmlm.module,v 1.18.4.1.2.3 2008/07/01 15:14:55 hutch Exp $  // $Id: ezmlm.module,v 1.18.4.1.2.4 2008/12/16 22:10:26 hutch Exp $
3  // $Name:  $  // $Name: DRUPAL-6--1 $
4  // for drupal 6.x  // for drupal 6.x
5    
6  /**  /**
# Line 141  function ezmlm_block($op = 'list', $delt Line 141  function ezmlm_block($op = 'list', $delt
141            case 0:            case 0:
142              $block = "";              $block = "";
143              if (drupal_strlen(trim(variable_get('ezmlmmailinglists', '')))) {              if (drupal_strlen(trim(variable_get('ezmlmmailinglists', '')))) {
144                  $display = variable_get('ezmlm_block_display', 'email');
145                  $form = drupal_get_form('ezmlm_subscribe_form', 'DEFAULT', $display);
146                $block['subject'] = variable_get('ezmlm_block_title', t('Subscriptions'));                $block['subject'] = variable_get('ezmlm_block_title', t('Subscriptions'));
147                $block['content'] .= ezmlm_page(variable_get('ezmlm_block_display', 'email'));                $block['content'] .= theme('ezmlm_subscribe_page', $form, 'block');
148              }              }
149              return $block;              return $block;
150          }          }
# Line 256  function ezmlm_page($display = FALSE) { Line 258  function ezmlm_page($display = FALSE) {
258    if (! $display) {    if (! $display) {
259      $display = variable_get('ezmlm_display', 'email');      $display = variable_get('ezmlm_display', 'email');
260    }    }
261    $output = drupal_get_form('ezmlm_subscribe_form', 'DEFAULT', $display);    $form = drupal_get_form('ezmlm_subscribe_form', 'DEFAULT', $display);
262    return $output;    return theme('ezmlm_subscribe_page', $form, 'page');
263  }  }
264    
265  /**  /**
# Line 277  function _ezmlm_subscribe_process($subs, Line 279  function _ezmlm_subscribe_process($subs,
279          list($list_name, $list_domain) =  split('@', $list_email);          list($list_name, $list_domain) =  split('@', $list_email);
280          // subscribe address for list formatted below          // subscribe address for list formatted below
281          $to = trim($list_name) .'-subscribe-'. trim($user_name) .'='. trim($user_domain) .'@'. trim($list_domain);          $to = trim($list_name) .'-subscribe-'. trim($user_name) .'='. trim($user_domain) .'@'. trim($list_domain);
282          mail($to, '', '');          $lang = language_default();
283            drupal_mail('ezmlm', 'subscribe', $to, $lang);
284            // mail($to, '', '');
285          $mylists[] = trim($list_email);          $mylists[] = trim($list_email);
286        }        }
287      }      }
# Line 286  function _ezmlm_subscribe_process($subs, Line 290  function _ezmlm_subscribe_process($subs,
290  }  }
291    
292  /**  /**
293     * Implementation of hook_mail().
294     */
295    function ezmlm_mail($key, &$message, $params) {
296      switch($key) {
297        case 'subscribe':
298          $message['subject'] = '';
299          $message['body'] = '';
300        break;
301      }
302    }
303    
304    /**
305   * Return current number of lists.   * Return current number of lists.
306   * Use this instead of count(_ezmlm_get_lists()) because non-array counts as 1.   * Use this instead of count(_ezmlm_get_lists()) because non-array counts as 1.
307   */   */
# Line 314  function _ezmlm_get_lists($type='DEFAULT Line 330  function _ezmlm_get_lists($type='DEFAULT
330    }    }
331  }  }
332    
333    /**
334     * Implementation of hook_theme().
335     */
336    function ezmlm_theme() {
337      return array(
338        'ezmlm_subscribe_page' => array(
339          'arguments' => array(
340            $form = "",
341            $type = "",
342          ),
343        ),
344      );
345    }
346    
347    function theme_ezmlm_subscribe_page($form, $type = 'page') {
348      switch ($type) {
349        case 'block':
350          $output = $form;
351        break;
352        case 'page':
353          $output = $form;
354        break;
355      }
356      return $output;
357    }

Legend:
Removed from v.1.18.4.1.2.4  
changed lines
  Added in v.1.18.4.1.2.5

  ViewVC Help
Powered by ViewVC 1.1.2