1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8namespace Tiki\MailIn\Provider;
9
10use Tiki\MailIn\Action;
11
12class ArticlePutProvider implements ProviderInterface
13{
14	function isEnabled()
15	{
16		global $prefs;
17		return $prefs['feature_submissions'] == 'y';
18	}
19
20	function getType()
21	{
22		return 'article-put';
23	}
24
25	function getLabel()
26	{
27		return tr('Create or update article');
28	}
29
30	function getActionFactory(array $acc)
31	{
32		return new Action\DirectFactory('Tiki\MailIn\Action\ArticlePut', [
33			'topic' => $acc['article_topicId'],
34			'type' => $acc['article_type'],
35		]);
36	}
37}
38