| 1 |
<?php |
<?php |
| 2 |
// $Id: mailhandler.module,v 1.96 2008/05/02 12:58:16 weitzman Exp $ |
// $Id: mailhandler.module,v 1.96.2.1 2008/05/15 10:43:55 weitzman Exp $ |
| 3 |
|
|
| 4 |
|
|
| 5 |
/** |
/** |
| 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 |
|
|
| 109 |
|
// Gather examples of useful commands, and build a definition list with them: |
| 110 |
|
$commands[] = array('command' => 'taxonomy: [term1, term2]', |
| 111 |
|
'description' => t('Use this to add the terms <em>term1</em> and <em>term2</em> to the node.<br /> |
| 112 |
|
Both of the terms should already exist. In case they do not exist already, they will be quietly ommitted')); |
| 113 |
|
$commands[] = array('command' => 'taxonomy[v]: [term1, term2]', |
| 114 |
|
'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 /> |
| 115 |
|
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')); |
| 116 |
|
|
| 117 |
|
$commands_list = '<dl>'; |
| 118 |
|
foreach ($commands as $command) { |
| 119 |
|
$commands_list .= '<dt>'. $command['command'] .'</dt>'; |
| 120 |
|
$commands_list .= '<dl>'. $command['description'] .'</dl>'; |
| 121 |
|
} |
| 122 |
|
$commands_list .= '</dl>'; |
| 123 |
|
|
| 124 |
switch ($path) { |
switch ($path) { |
| 125 |
case 'admin/help#mailhandler': |
case 'admin/help#mailhandler': |
| 126 |
$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>'; |
| 141 |
'@admin-mailhandler' => url('admin/content/mailhandler'), |
'@admin-mailhandler' => url('admin/content/mailhandler'), |
| 142 |
'@admin-mailhandler-settings' => url('admin/settings/mailhandler'), |
'@admin-mailhandler-settings' => url('admin/settings/mailhandler'), |
| 143 |
)); |
)); |
| 144 |
|
$output .= '<h3 id="commands">'. t('Useful Commands') .'</h3>'; |
| 145 |
|
$output .= $commands_list; |
| 146 |
$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>'; |
| 147 |
return $output; |
return $output; |
| 148 |
case 'admin/content/mailhandler': |
case 'admin/content/mailhandler': |