3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 * Generated from {$smarty.template}
20 class CRM_Core_I18n_SchemaStructure {ldelim}
23 * Get translatable columns.
26 * A table-indexed array of translatable columns.
28 public static function &columns() {ldelim}
29 static $result = NULL;
30 if (!$result) {ldelim}
32 {foreach from=$columns key=table item=types}
34 {foreach from=$types key=column item=type}
35 '{$column}' => "{$type}",
36 {/foreach}{* /foreach from=$types item=type *}
38 {/foreach}{* /foreach from=$columns item=types *}
45 * Get a table indexed array of the indices for translatable fields.
48 * Indices for translatable fields.
50 public static function &indices() {ldelim}
51 static $result = NULL;
52 if (!$result) {ldelim}
54 {foreach from=$indices key=table item=tableIndices}
56 {foreach from=$tableIndices key=name item=info}
58 'name' => '{$info.name}',
60 {foreach from=$info.field item=field}
62 {/foreach}{* foreach from=$info.field item=field *}
64 {if $info.unique}'unique' => 1,{/if}
67 {/foreach}{* /foreach from=$tableIndices item=info *}
69 {/foreach}{* /foreach from=$indices item=tableIndices *}
76 * Get tables with translatable fields.
79 * Array of names of tables with fields that can be translated.
81 public static function &tables() {ldelim}
82 static $result = NULL;
83 if (!$result) {ldelim}
84 $result = array_keys(self::columns());
90 * Get a list of widgets for editing translatable fields.
93 * Array of the widgets for editing translatable fields.
95 public static function &widgets() {ldelim}
96 static $result = NULL;
97 if (!$result) {ldelim}
99 {foreach from=$widgets key=table item=columns}
101 {foreach from=$columns key=column item=widget}
103 {foreach from=$widget key=name item=value}
104 '{$name}' => "{$value}",
105 {/foreach}{* /foreach from=$widget item=value *}
107 {/foreach}{* /foreach from=$columns item=widget *}
109 {/foreach}{* /foreach from=$widgets item=columns *}