1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: /**
13: * @copyright XOOPS Project (http://xoops.org)
14: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
15: * @author trabis <lusopoemas@gmail.com>
16: * @version $Id$
17: */
18:
19: class CommentsUserconfigsPlugin extends Xoops\Module\Plugin\PluginAbstract implements UserconfigsPluginInterface
20: {
21:
22: /**
23: * Expects an array of arrays containing:
24: *
25: * name, Name of the category
26: * description, Description for the category, use constant
27: *
28: * The keys must be unique identifiers
29: */
30: public function categories()
31: {
32: return array();
33: }
34:
35: /**
36: * Expects an array of arrays containing:
37: *
38: * name, Name of the config
39: * title, Display name for the config, use constant
40: * description, Description for the config, use constant
41: * formtype, Form to use for the config
42: * default, Default value for the config
43: * options, Options available for the config
44: * category, Category for this config, use the unique identifier set on categories()
45: */
46: public function configs()
47: {
48: $i = 0;
49: $configs[$i]['name'] = 'com_mode';
50: $configs[$i]['title'] = '_MI_COMMENTS_MODE';
51: $configs[$i]['description'] = '_MI_COMMENTS_MODEDSC';
52: $configs[$i]['formtype'] = 'select';
53: $configs[$i]['valuetype'] = 'text';
54: $configs[$i]['options'] = array('XoopsLocale::NESTED' => 'nest', 'XoopsLocale::FLAT' => 'flat', 'XoopsLocale::THREADED' => 'thread');
55: $configs[$i]['default'] = 'flat';
56:
57: ++$i;
58: $configs[$i]['name'] = 'com_order';
59: $configs[$i]['title'] = '_MI_COMMENTS_ORDER';
60: $configs[$i]['description'] = '_MI_COMMENTS_ORDERDSC';
61: $configs[$i]['formtype'] = 'select';
62: $configs[$i]['valuetype'] = 'int';
63: $configs[$i]['options'] = array('XoopsLocale::OLDEST_FIRST' => 0, 'XoopsLocale::NEWEST_FIRST' => 1);
64: $configs[$i]['default'] = 0;
65: return $configs;
66: }
67: }
68: