| 1 |
<?php |
<?php |
| 2 |
// $Id: mailhandler.module,v 1.96.2.2 2008/08/09 11:54:43 weitzman Exp $ |
// $Id: mailhandler.module,v 1.96 2008/05/02 12:58:16 weitzman Exp $ |
| 3 |
|
|
| 4 |
|
|
| 5 |
/** |
/** |
| 8 |
function mailhandler_cron() { |
function mailhandler_cron() { |
| 9 |
|
|
| 10 |
// Include mailhandler retrieval functions |
// Include mailhandler retrieval functions |
| 11 |
module_load_include('inc', 'mailhandler', 'mailhandler.retrieve'); |
module_load_include('inc', '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'); |
| 59 |
'file' => 'mailhandler.admin.inc', |
'file' => 'mailhandler.admin.inc', |
| 60 |
); |
); |
| 61 |
|
|
|
$items['admin/content/mailhandler/clone/%'] = array( |
|
|
'title' => t('Add mailbox'), |
|
|
'page callback' => 'drupal_get_form', |
|
|
'page arguments' => array('mailhandler_add_edit_mailbox', 4, TRUE), |
|
|
'access arguments' => array('administer mailhandler'), |
|
|
'type' => MENU_CALLBACK, |
|
|
'file' => 'mailhandler.admin.inc', |
|
|
); |
|
|
|
|
| 62 |
$items['admin/content/mailhandler/retrieve/%'] = array( |
$items['admin/content/mailhandler/retrieve/%'] = array( |
| 63 |
'title' => t('Retrieve'), |
'title' => t('Retrieve'), |
| 64 |
'page callback' => 'mailhandler_admin_retrieve', |
'page callback' => 'mailhandler_admin_retrieve', |
| 106 |
$output = ''; |
$output = ''; |
| 107 |
$link->add = l(t('Add mailbox'), 'admin/content/mailhandler/add'); |
$link->add = l(t('Add mailbox'), 'admin/content/mailhandler/add'); |
| 108 |
|
|
|
// Gather examples of useful commands, and build a definition list with them: |
|
|
$commands[] = array('command' => 'taxonomy: [term1, term2]', |
|
|
'description' => t('Use this to add the terms <em>term1</em> and <em>term2</em> to the node.<br /> |
|
|
Both of the terms should already exist. In case they do not exist already, they will be quietly ommitted')); |
|
|
$commands[] = array('command' => 'taxonomy[v]: [term1, term2]', |
|
|
'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 /> |
|
|
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')); |
|
|
|
|
|
$commands_list = '<dl>'; |
|
|
foreach ($commands as $command) { |
|
|
$commands_list .= '<dt>'. $command['command'] .'</dt>'; |
|
|
$commands_list .= '<dl>'. $command['description'] .'</dl>'; |
|
|
} |
|
|
$commands_list .= '</dl>'; |
|
|
|
|
| 109 |
switch ($path) { |
switch ($path) { |
| 110 |
case 'admin/help#mailhandler': |
case 'admin/help#mailhandler': |
| 111 |
$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>'; |
| 126 |
'@admin-mailhandler' => url('admin/content/mailhandler'), |
'@admin-mailhandler' => url('admin/content/mailhandler'), |
| 127 |
'@admin-mailhandler-settings' => url('admin/settings/mailhandler'), |
'@admin-mailhandler-settings' => url('admin/settings/mailhandler'), |
| 128 |
)); |
)); |
|
$output .= '<h3 id="commands">'. t('Useful Commands') .'</h3>'; |
|
|
$output .= $commands_list; |
|
| 129 |
$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>'; |
| 130 |
return $output; |
return $output; |
| 131 |
case 'admin/content/mailhandler': |
case 'admin/content/mailhandler': |