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: * Debugbar core preloads
14: *
15: * @category Debugbar
16: * @package Debugbar
17: * @author Richard Griffith <richard@geekwright.com>
18: * @copyright 2013 XOOPS Project (http://xoops.org)
19: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
20: * @link http://xoops.org
21: */
22: class DebugbarUserconfigsPlugin extends Xoops\Module\Plugin\PluginAbstract implements UserconfigsPluginInterface
23: {
24: /**
25: * Build an array of configurable item categories.
26: *
27: * Each category consists of an array with the following key - value pairs
28: * name, Name of the category
29: * description, Description for the category, use constant
30: *
31: * Each category must have a unique key that can be specified in
32: * each related configurable item.
33: *
34: * @return array of categories
35: */
36: public function categories()
37: {
38: $categories['cat_options'] = array(
39: 'name' => _MI_DEBUGBAR_UCONF_CAT_OPT,
40: 'title' => _MI_DEBUGBAR_UCONF_CAT_OPT_DESC
41: );
42: return $categories;
43: }
44:
45: /**
46: * Build an array of user configurable items.
47: *
48: * Each item consists of an array with the following key - value pairs
49: * - name Name of the config
50: * - title Display name for the config, use constant
51: * - description Description for the config, use constant
52: * - formtype Form to use for the config
53: * - default Default value for the config
54: * - options Options available for the config
55: * - category Category for this config, use the unique identifier set on categories()
56: *
57: * @return array of user configurable items
58: */
59: public function configs()
60: {
61: $config[]=array(
62: 'name' => 'debugbar_enable',
63: 'title' => '_MI_DEBUGBAR_UCONF_ENABLE_BAR',
64: 'description' => '',
65: 'formtype' => 'yesno',
66: 'valuetype' => 'int',
67: 'default' => 0,
68: 'options' => array(),
69: 'category' => 'cat_options'
70: );
71:
72: $config[]=array(
73: 'name' => 'debug_smarty_enable',
74: 'title' => '_MI_DEBUGBAR_UCONF_ENABLE_SMARTY',
75: 'description' => '',
76: 'formtype' => 'yesno',
77: 'valuetype' => 'int',
78: 'default' => 0,
79: 'options' => array(),
80: 'category' => 'cat_options'
81: );
82:
83: return $config;
84: }
85: }
86: