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

Diff of /contributions/modules/mailhandler/mailhandler.module

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

revision 1.96, Fri May 2 12:58:16 2008 UTC revision 1.96.2.3, Sun Oct 26 21:43:24 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: mailhandler.module,v 1.94 2007/10/23 02:08:28 weitzman Exp $  // $Id: mailhandler.module,v 1.96.2.2 2008/08/09 11:54:43 weitzman Exp $
3    
4    
5  /**  /**
# Line 8  Line 8 
8  function mailhandler_cron() {  function mailhandler_cron() {
9    
10    // Include mailhandler retrieval functions    // Include mailhandler retrieval functions
11    module_load_include('inc', 'mailhandler', 'retrieve');    module_load_include('inc', 'mailhandler', 'mailhandler.retrieve');
12    
13    // Retrieve messages    // Retrieve messages
14    $result = db_query('SELECT * FROM {mailhandler} WHERE enabled = 1 ORDER BY mail');    $result = db_query('SELECT * FROM {mailhandler} WHERE enabled = 1 ORDER BY mail');
# Line 59  function mailhandler_menu() { Line 59  function mailhandler_menu() {
59      'file' => 'mailhandler.admin.inc',      'file' => 'mailhandler.admin.inc',
60    );    );
61    
62      $items['admin/content/mailhandler/clone/%'] = array(
63        'title' => t('Add mailbox'),
64        'page callback' => 'drupal_get_form',
65        'page arguments' => array('mailhandler_add_edit_mailbox', 4, TRUE),
66        'access arguments' => array('administer mailhandler'),
67        'type' => MENU_CALLBACK,
68        'file' => 'mailhandler.admin.inc',
69      );
70    
71    $items['admin/content/mailhandler/retrieve/%'] = array(    $items['admin/content/mailhandler/retrieve/%'] = array(
72      'title' => t('Retrieve'),      'title' => t('Retrieve'),
73      'page callback' => 'mailhandler_admin_retrieve',      'page callback' => 'mailhandler_admin_retrieve',
# Line 106  function mailhandler_help($path = 'admin Line 115  function mailhandler_help($path = 'admin
115    $output = '';    $output = '';
116    $link->add = l(t('Add mailbox'), 'admin/content/mailhandler/add');    $link->add = l(t('Add mailbox'), 'admin/content/mailhandler/add');
117    
118      // Gather examples of useful commands, and build a definition list with them:
119      $commands[] = array('command' => 'taxonomy: [term1, term2]',
120                          'description' => t('Use this to add the terms <em>term1</em> and <em>term2</em> to the node.<br />
121                          Both of the terms should already exist. In case they do not exist already, they will be quietly ommitted'));
122      $commands[] = array('command' => 'taxonomy[v]: [term1, term2]',
123                          'description' => t('Similar to the above: adds the terms <em>term1</em> and <em>term2</em> to the node, but uses the vocabulary with the vocabulary id <em>v</em>. For example <em>taxonomy[3]</em> will chose only terms from the vocabulary which id is 3.<br />
124                          In case some of the terms do not exist already, the behavior will depend on whether the vocabulary is a free tagging vocabulary or not. If it is a free tagging vocabulary, the term will be added, otherwise, it will be quietly ommitted'));
125    
126      $commands_list = '<dl>';
127      foreach ($commands as $command) {
128        $commands_list .= '<dt>'. $command['command'] .'</dt>';
129        $commands_list .= '<dl>'. $command['description'] .'</dl>';
130      }
131      $commands_list .= '</dl>';
132    
133    switch ($path) {    switch ($path) {
134      case 'admin/help#mailhandler':      case 'admin/help#mailhandler':
135        $output = '<p>'. t('The mailhandler module allows registered users to create or edit nodes and comments via e-mail. Users may post taxonomy terms, teasers, and other post attributes using the mail commands capability.  This module is useful because e-mail is the preferred method of communication by community members.') .'</p>';        $output = '<p>'. t('The mailhandler module allows registered users to create or edit nodes and comments via e-mail. Users may post taxonomy terms, teasers, and other post attributes using the mail commands capability.  This module is useful because e-mail is the preferred method of communication by community members.') .'</p>';
# Line 126  function mailhandler_help($path = 'admin Line 150  function mailhandler_help($path = 'admin
150       '@admin-mailhandler' => url('admin/content/mailhandler'),       '@admin-mailhandler' => url('admin/content/mailhandler'),
151       '@admin-mailhandler-settings' => url('admin/settings/mailhandler'),       '@admin-mailhandler-settings' => url('admin/settings/mailhandler'),
152     ));     ));
153          $output .= '<h3 id="commands">'. t('Useful Commands') .'</h3>';
154          $output .= $commands_list;
155        $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%mailhandler">Mailhandler page</a>.', array('%mailhandler' => 'http://www.drupal.org/handbook/modules/mailhandler/')) .'</p>';        $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%mailhandler">Mailhandler page</a>.', array('%mailhandler' => 'http://www.drupal.org/handbook/modules/mailhandler/')) .'</p>';
156        return $output;        return $output;
157      case 'admin/content/mailhandler':      case 'admin/content/mailhandler':

Legend:
Removed from v.1.96  
changed lines
  Added in v.1.96.2.3

  ViewVC Help
Powered by ViewVC 1.1.2