array( {foreach from=$types key=column item=type} '{$column}' => "{$type}", {/foreach} ), {/foreach} ); {rdelim} return $result; {rdelim} /** * Get a table indexed array of the indices for translatable fields. * * @return array * Indices for translatable fields. */ public static function &indices() {ldelim} static $result = null; if (!$result) {ldelim} $result = array( {foreach from=$indices key=table item=tableIndices} '{$table}' => array( {foreach from=$tableIndices key=name item=info} '{$name}' => array( 'name' => '{$info.name}', 'field' => array( {foreach from=$info.field item=field} '{$field}', {/foreach} ), {if $info.unique}'unique' => 1,{/if} ), {/foreach} ), {/foreach} ); {rdelim} return $result; {rdelim} /** * Get tables with translatable fields. * * @return array * Array of names of tables with fields that can be translated. */ static function &tables() {ldelim} static $result = null; if (!$result) {ldelim} $result = array_keys(self::columns()); {rdelim} return $result; {rdelim} /** * Get a list of widgets for editing translatable fields. * * @return array * Array of the widgets for editing translatable fields. */ static function &widgets() {ldelim} static $result = null; if (!$result) {ldelim} $result = array( {foreach from=$widgets key=table item=columns} '{$table}' => array( {foreach from=$columns key=column item=widget} '{$column}' => array( {foreach from=$widget key=name item=value} '{$name}' => "{$value}", {/foreach} ), {/foreach} ), {/foreach} ); {rdelim} return $result; {rdelim} {rdelim}