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

Diff of /contributions/modules/news/news.module

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

revision 1.16, Wed May 20 21:06:53 2009 UTC revision 1.17, Wed Aug 26 17:48:04 2009 UTC
# Line 1  Line 1 
1  <?php // $Id: news.module,v 1.15 2009/05/15 14:35:15 vauxia Exp $  <?php // $Id: news.module,v 1.16 2009/05/20 21:06:53 vauxia Exp $
2    
3  /**  /**
4   * @file   * @file
# Line 22  function news_perm() { Line 22  function news_perm() {
22  }  }
23    
24  /**  /**
25     * Implementation of hook_elements().
26     */
27    function news_elements() {
28      // Add send element to select from available mailing list(s)
29      return array( 'news_mlm' => send_element_defaults() );
30    }
31    
32    /**
33   * Implementation of Send module's hook_send_profile_info().   * Implementation of Send module's hook_send_profile_info().
34   */   */
35  function news_send_profile_info() {  function news_send_profile_info() {
36    return array(    return array(
37      'news' => array(      'news' => array(
38        'title' => t('News'),        'title' => t('News'),
39        'mode' => 'mlm',        'mode' => 'news',
40        ),
41      );
42    }
43    
44    /**
45     * Implementation of Send module's hook_send_mode_info().
46     * Provide a "mailing list" delivery mode.
47     */
48    function news_send_mode_info() {
49      return array(
50        'news' => array(
51          'callback' => 'news_send_deliver',
52          'database columns' => array(
53            'lid' => array('type' => 'int', 'unsigned' => TRUE),
54          ),
55          'unique keys' => array('lid' => array('lid')),
56          'user only' => FALSE,
57      ),      ),
58    );    );
59  }  }
60    
61  /**  /**
62     * Delivery callback for MLM module's send handler.
63     */
64    function news_send_deliver($profile, $contact, $nids, &$message, $mode) {
65      if ($mlm = mlm_load($contact->lid)) {
66        $mlm->post($message);
67      }
68    }
69    
70    /**
71   * Implementation of hook_views_api().   * Implementation of hook_views_api().
72   */   */
73  function news_views_api() {  function news_views_api() {

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

  ViewVC Help
Powered by ViewVC 1.1.2