3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2020 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2020
33 * Generated from {$smarty.template}
36 class CRM_Core_I18n_SchemaStructure {ldelim}
39 * Get translatable columns.
42 * A table-indexed array of translatable columns.
44 public static function &columns() {ldelim}
45 static $result = NULL;
46 if (!$result) {ldelim}
48 {foreach from=$columns key=table item=types}
50 {foreach from=$types key=column item=type}
51 '{$column}' => "{$type}",
52 {/foreach}{* /foreach from=$types item=type *}
54 {/foreach}{* /foreach from=$columns item=types *}
61 * Get a table indexed array of the indices for translatable fields.
64 * Indices for translatable fields.
66 public static function &indices() {ldelim}
67 static $result = NULL;
68 if (!$result) {ldelim}
70 {foreach from=$indices key=table item=tableIndices}
72 {foreach from=$tableIndices key=name item=info}
74 'name' => '{$info.name}',
76 {foreach from=$info.field item=field}
78 {/foreach}{* foreach from=$info.field item=field *}
80 {if $info.unique}'unique' => 1,{/if}
83 {/foreach}{* /foreach from=$tableIndices item=info *}
85 {/foreach}{* /foreach from=$indices item=tableIndices *}
92 * Get tables with translatable fields.
95 * Array of names of tables with fields that can be translated.
97 public static function &tables() {ldelim}
98 static $result = NULL;
99 if (!$result) {ldelim}
100 $result = array_keys(self::columns());
106 * Get a list of widgets for editing translatable fields.
109 * Array of the widgets for editing translatable fields.
111 public static function &widgets() {ldelim}
112 static $result = NULL;
113 if (!$result) {ldelim}
115 {foreach from=$widgets key=table item=columns}
117 {foreach from=$columns key=column item=widget}
119 {foreach from=$widget key=name item=value}
120 '{$name}' => "{$value}",
121 {/foreach}{* /foreach from=$widget item=value *}
123 {/foreach}{* /foreach from=$columns item=widget *}
125 {/foreach}{* /foreach from=$widgets item=columns *}