class MailhandlerFetcher in Mailhandler 6.2
Same name and namespace in other branches
- 7.2 plugins/feeds/plugins/MailhandlerFetcher.class.php \MailhandlerFetcher
Hierarchy
- class \FeedsConfigurable
- class \FeedsPlugin implements FeedsSourceInterface
- class \FeedsFetcher
- class \MailhandlerFetcher
- class \FeedsFetcher
- class \FeedsPlugin implements FeedsSourceInterface
Expanded class hierarchy of MailhandlerFetcher
3 string references to 'MailhandlerFetcher'
- MailhandlerFetcher.inc in plugins/
feeds/ plugins/ MailhandlerFetcher.inc - mailhandler_default_feeds_importer_default in modules/
mailhandler_default/ mailhandler_default.feeds_importer_default.inc - Implementation of hook_feeds_importer_default().
- mailhandler_update_6203 in ./
mailhandler.install - Update filter plugin names.
File
- plugins/
feeds/ plugins/ MailhandlerFetcher.class.php, line 37 - Checks for new messages in a mailbox (IMAP, POP3, etc...).
View source
class MailhandlerFetcher extends FeedsFetcher {
/**
* Implementation of FeedsFetcher::fetch().
*/
public function fetch(FeedsSource $source) {
$source_config = $source
->getConfigFor($this);
return new MailhandlerImportBatch($source_config['source'], $this->config['filter']);
}
/**
* Source form.
*/
public function sourceForm($source_config) {
include_once drupal_get_path('module', 'mailhandler') . '/mailhandler.module';
$form = array();
$form['source'] = array(
'#type' => 'select',
'#title' => t('Mailbox'),
'#description' => t('Select a mailbox to use'),
'#default_value' => isset($source_config['source']) ? $source_config['source'] : '',
'#options' => _mailhandler_build_options(mailhandler_mailbox_load_all(FALSE), 'admin_title'),
);
return $form;
}
/**
* Define defaults.
*/
public function sourceDefaults() {
return array(
'source' => '',
);
}
/**
* Override parent::configDefaults().
*/
public function configDefaults() {
return array(
'filter' => 'MailhandlerFilters',
);
}
/**
* Config form.
*/
public function configForm(&$form_state) {
$form = array();
// Select message filter (to differentiate nodes/comments/etc)
$form['filter'] = array(
'#type' => 'select',
'#title' => t('Message filter'),
'#description' => t('Select which types of messages to import. This is a heuristic filter, and may fail in some scenarios. For instance, messages from a mailing list will almost always look like comments. Thus, the safest setting is <em>all</em>.'),
'#default_value' => $this->config['filter'],
'#options' => _mailhandler_build_options(mailhandler_get_plugins('mailhandler', 'filters')),
);
return $form;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedsConfigurable:: |
protected | property | ||
FeedsConfigurable:: |
protected | property | CTools export enabled status of this object. | |
FeedsConfigurable:: |
protected | property | ||
FeedsConfigurable:: |
protected | property | ||
FeedsConfigurable:: |
public | function | Similar to setConfig but adds to existing configuration. | 1 |
FeedsConfigurable:: |
public | function | Submission handler for configForm(). | 3 |
FeedsConfigurable:: |
public | function | Validation handler for configForm(). | 3 |
FeedsConfigurable:: |
public | function | Copy a configuration. | 1 |
FeedsConfigurable:: |
public | function | Determine whether this object is persistent and enabled. I. e. it is defined either in code or in the database and it is enabled. | 1 |
FeedsConfigurable:: |
public | function | Implementation of getConfig(). | 1 |
FeedsConfigurable:: |
public static | function | Instantiate a FeedsConfigurable object. | 1 |
FeedsConfigurable:: |
public | function | Set configuration. | 1 |
FeedsConfigurable:: |
public | function | Override magic method __get(). Make sure that $this->config goes through getConfig() | |
FeedsConfigurable:: |
public | function | Override magic method __isset(). This is needed due to overriding __get(). | |
FeedsFetcher:: |
public | function | Clear all caches for results for given source. | 1 |
FeedsFetcher:: |
public | function | Override import period settings. This can be used to force a certain import interval. | 1 |
FeedsFetcher:: |
public | function | Menu item definition for fetchers of this class. Note how the path component in the item definition matches the return value of FeedsFetcher::path(); | |
FeedsFetcher:: |
public | function | Construct a path for a concrete fetcher/source combination. The result of this method matches up with the general path definition in FeedsFetcher::menuItem(). For example usage look at FeedsHTTPFetcher. | |
FeedsFetcher:: |
public | function | Request handler invoked if callback URL is requested. Locked down by default. For a example usage see FeedsHTTPFetcher. | 1 |
FeedsFetcher:: |
public | function | Subscribe to a source. Only implement if fetcher requires subscription. | 1 |
FeedsFetcher:: |
public | function | Unsubscribe from a source. Only implement if fetcher requires subscription. | 1 |
FeedsPlugin:: |
public | function |
Returns TRUE if $this->sourceForm() returns a form. Overrides FeedsSourceInterface:: |
|
FeedsPlugin:: |
protected static | function | Loads on-behalf implementations from mappers/ directory. | |
FeedsPlugin:: |
public | function |
Save changes to the configuration of this object.
Delegate saving to parent (= Feed) which will collect
information from this object by way of getConfig() and store it. Overrides FeedsConfigurable:: |
|
FeedsPlugin:: |
public | function |
A source is being deleted. Overrides FeedsSourceInterface:: |
1 |
FeedsPlugin:: |
public | function |
Validation handler for sourceForm. Overrides FeedsSourceInterface:: |
2 |
FeedsPlugin:: |
public | function |
A source is being saved. Overrides FeedsSourceInterface:: |
1 |
FeedsPlugin:: |
protected | function |
Constructor. Overrides FeedsConfigurable:: |
|
MailhandlerFetcher:: |
public | function |
Override parent::configDefaults(). Overrides FeedsConfigurable:: |
|
MailhandlerFetcher:: |
public | function |
Config form. Overrides FeedsConfigurable:: |
|
MailhandlerFetcher:: |
public | function |
Implementation of FeedsFetcher::fetch(). Overrides FeedsFetcher:: |
|
MailhandlerFetcher:: |
public | function |
Define defaults. Overrides FeedsPlugin:: |
|
MailhandlerFetcher:: |
public | function |
Source form. Overrides FeedsPlugin:: |