CMS
Version 3.9
open_data_form.inc
Go to the documentation of this file.
1
<?php
2
3
/**************************************************************
4
5
Copyright (c) 2010 Sonjara, Inc
6
7
Permission is hereby granted, free of charge, to any person
8
obtaining a copy of this software and associated documentation
9
files (the "Software"), to deal in the Software without
10
restriction, including without limitation the rights to use,
11
copy, modify, merge, publish, distribute, sublicense, and/or sell
12
copies of the Software, and to permit persons to whom the
13
Software is furnished to do so, subject to the following
14
conditions:
15
16
The above copyright notice and this permission notice shall be
17
included in all copies or substantial portions of the Software.
18
19
Except as contained in this notice, the name(s) of the above
20
copyright holders shall not be used in advertising or otherwise
21
to promote the sale, use or other dealings in this Software
22
without prior written authorization.
23
24
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
26
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
28
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
29
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
31
OTHER DEALINGS IN THE SOFTWARE.
32
33
*****************************************************************/
34
35
36
Fakoli::using
(
"open_data"
);
37
Fakoli::usingFeature
(
"data_view"
);
38
39
OpenDataManager::getOpenDataClasses
();
40
41
$menu_item
=
"Open Data"
;
42
$open_data_id
= checkNumeric($_GET[
"open_data_id"
]);
43
$class
= checkIdentifier($_GET[
"class"
]);
44
$field
= checkIdentifier($_GET[
"field"
]);
45
46
$openData
=
new
OpenData
();
47
48
if
(
$open_data_id
)
49
{
50
$openData
->load(
$open_data_id
);
51
$title
=
"Edit Open Data Details for {$openData->field}"
;
52
}
53
else
54
{
55
$obj
=
new
$class
;
56
57
$openData
->class =
$class
;
58
$openData
->field =
$field
;
59
$openData
->field_type =
$obj
->getType(
$field
);
60
}
61
62
$form
=
new
AutoForm(
$openData
);
63
$form
->allowDelete =
true
;
64
if
(
$method
==
"POST"
)
65
{
66
if
(
$form
->save())
67
{
68
redirect(
"open_data_items"
);
69
}
70
}
71
$form
->alias(
"private"
,
"Personally Identifiable Information"
);
72
$form
->alias(
"protected"
,
"Otherwise Protected"
);
73
74
$opendataselect
=
new
SelectFieldRenderer(
$form
,
"open_data_level"
,
"Open Data Level:"
,
OpenData::$open_data_level
);
75
$form
->drawForm();
76
77
78
?>
79
</div>
$obj
$obj
Definition:
data_import_select.inc:29
$title
$title
Definition:
session_details.inc:11
Fakoli\usingFeature
static usingFeature()
Uses the specified framework feature(s).
Definition:
core.inc:388
Fakoli\using
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition:
core.inc:116
OpenData
Definition:
open_data.inc:9
OpenData\$open_data_level
static $open_data_level
Definition:
open_data.inc:29
OpenDataManager\getOpenDataClasses
static getOpenDataClasses()
Definition:
open_data_manager.inc:25
$method
$method
Pull out a simple reference to the request method.
Definition:
core.inc:1573
$form
$form
Definition:
open_data_form.inc:62
$openData
$openData
Definition:
open_data_form.inc:46
$class
$class
Definition:
open_data_form.inc:43
$field
$field
Definition:
open_data_form.inc:44
$open_data_id
$open_data_id
Definition:
open_data_form.inc:42
$menu_item
$menu_item
Definition:
open_data_form.inc:41
$opendataselect
$opendataselect
Definition:
open_data_form.inc:74
code
cms.sonjara.com
cms
components
open_data
admin
open_data_form.inc
Generated on Tue Mar 23 2021 15:36:13 for CMS by
1.9.1