CMS  Version 3.9
setting_list.inc
Go to the documentation of this file.
1 <?php
2 /**************************************************************
3 
4  Copyright (c) 2010 Sonjara, Inc
5 
6  Permission is hereby granted, free of charge, to any person
7  obtaining a copy of this software and associated documentation
8  files (the "Software"), to deal in the Software without
9  restriction, including without limitation the rights to use,
10  copy, modify, merge, publish, distribute, sublicense, and/or sell
11  copies of the Software, and to permit persons to whom the
12  Software is furnished to do so, subject to the following
13  conditions:
14 
15  The above copyright notice and this permission notice shall be
16  included in all copies or substantial portions of the Software.
17 
18  Except as contained in this notice, the name(s) of the above
19  copyright holders shall not be used in advertising or otherwise
20  to promote the sale, use or other dealings in this Software
21  without prior written authorization.
22 
23  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
25  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
27  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
30  OTHER DEALINGS IN THE SOFTWARE.
31 
32 *****************************************************************/
33 
34 /*
35  * Systems Administrator view of settings.
36  *
37  * CMS Classification feature for component settings.
38  * Lists all component settings and allows user to modify settings
39  * definition.
40  *
41  */
42 
43 Fakoli::using("settings");
44 Fakoli::usingFeature("data_view");
45 
46 $title = "Settings Options";
47 $menu_item = "Define Settings Options";
48 
49 $settings = Query::create(Settings, "ORDER BY component, name")->execute();
50 
51 $table = new DataListView($settings, "settings");
52 $table->column("Component", "{component}", true)
53  ->column("Name", "<a href='/admin/setting_form?settings_id={settings_id}'>{name}</a>", true)
54  ->column("Field Annotation", "{annotation}", true)
55  ->column("Field Type", "{field_type}", true)
56  ;
57 
58 $table->sortable = true;
59 $table->filter = true;
60 $table->pageSize = 10;
61 $table->emptyMessage = "There are no application settings defined.";
62 $script .= $table->writeScript();
63 ?>
64 <h4>This features allows you to define the system's application setting options. It is designed for use by systems administrators. CMS Users can modify <a href="/admin/settings">Application Settings</a> under CMS Site Configuration.</h4>
65 <p>To create a new setting, perform the following steps:</p>
66 <ul>
67 <li>In your component's manifest, subscribe to the event "ComponentScanComplete", calling a function in your component's manager class called "setDefaults"</li>
68 <li>Add the static function setDefaults to your component's manager class</li>
69 <li>For each setting, call Settings::setDefaultValue and provide the setting default values</li>
70 </ul>
71 
72 <?php
73 $table->drawView();
74 ?>
static usingFeature()
Uses the specified framework feature(s).
Definition: core.inc:388
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
The Settings class provides components with a common API for specifying application settings and conf...
Definition: settings.inc:49
static setDefaultValue($component, $name, $value, $field_type="String", $annotation="", $category="", $options="", $weight=0)
Sets the default value of the given component setting.
Definition: settings.inc:174
$forumRequest to
$menu_item
$settings
$title
$table
$script