CMS
Version 3.9
text_translations.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
* Show all text translations for a given text item and
36
* allow the user to create another translation or
37
* edit an existing one.
38
*
39
* @author Janice Gallant for Sonjara, Inc.
40
*
41
* 5/24/2011
42
*/
43
44
45
Fakoli::using
(
"text_lookup"
);
46
Fakoli::usingFeature
(
"data_view"
);
47
Fakoli::usingFile
(
"framework/tab_bar.inc"
);
48
49
$text_id
= checkNumeric($_GET[
"text_id"
]);
50
51
if
(!
$text_id
)
52
redirect(
"/text_lookup_list"
);
53
54
$menu_item
=
"Text Lookup"
;
55
56
$text
=
new
TextLookup
(
$text_id
);
57
$title
=
"Text Translations for "
.
$text
->code;
58
59
$texts
= Query::create(
TextTranslation
,
"WHERE text_id=:text_id ORDER BY language"
)
60
->bind(
":text_id"
,
$text_id
)
61
->execute();
62
63
$table
=
new
DataListView(
$texts
,
"textTranslations"
);
64
$table
->column(
"Code"
,
"{TextLookup.code}"
,
true
)
65
->column(
"Text"
,
"{TextLookup.text}"
,
true
)
66
->column(
"Language"
,
"{language}"
,
true
)
67
->column(
"Translation"
,
"<a href='/admin/text_translation_form?text_translation_id={text_translation_id}'>{text}</a>"
,
true
)
68
;
69
70
$table
->sortable =
true
;
71
$table
->filter =
true
;
72
$table
->pageSize = 10;
73
$table
->emptyMessage =
"No text translations have been defined."
;
74
75
76
$tabs
=
TextLookupManager::getTabs
(
$text_id
);
77
78
$script
.=
$table
->writeScript();
79
$tabs
->writeHTML();
80
?>
81
<div
id
=
"tab_border"
>
82
<p><label
for
=
"text"
>Text:&
nbsp
;</label><?php echo
$text
->text ?></p>
83
<?php
84
$table
->drawView();
85
?>
86
<br/>
87
<a
class
=
'button'
href=
'/admin/text_translation_form?text_id=<?php echo $text_id ?>'
>Add a Translation</a>
88
<br><br></div>
nbsp
& nbsp
Definition:
index.inc:49
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
Fakoli\usingFile
static usingFile()
Uses the specified framework file(s) from the framework directory.
Definition:
core.inc:369
TextLookup
Definition:
text_lookup.inc:42
TextLookupManager\getTabs
static getTabs($key="")
Definition:
text_lookup_manager.inc:87
TextTranslation
Definition:
text_lookup.inc:212
$tabs
$tabs
Definition:
text_translations.inc:76
$menu_item
$menu_item
Definition:
text_translations.inc:54
$text_id
$text_id
Definition:
text_translations.inc:49
$title
$title
Definition:
text_translations.inc:57
$text
$text
Definition:
text_translations.inc:56
$texts
$texts
Definition:
text_translations.inc:59
$table
$table
Definition:
text_translations.inc:63
$script
$script
Definition:
text_translations.inc:78
code
cms.sonjara.com
cms
components
text_lookup
admin
text_translations.inc
Generated on Tue Mar 23 2021 15:36:15 for CMS by
1.9.1