Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/multilanguage_helper.php
Show First 20 Lines • Show All 390 Lines • ▼ Show 20 Line(s) | |||||
$field_expression = sprintf($field_mask, $start_index); | $field_expression = sprintf($field_mask, $start_index); | ||||
$ret .= 'ADD COLUMN '.$field_expression.' AFTER `'.$prev_field.'`, '; | $ret .= 'ADD COLUMN '.$field_expression.' AFTER `'.$prev_field.'`, '; | ||||
if ($this->curIndexCount < 32 && ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang)) { | if ($this->curIndexCount < 32 && ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang)) { | ||||
// create index for primary language column + for all others (if multiple languages installed) | // create index for primary language column + for all others (if multiple languages installed) | ||||
list($field_name, $field_params) = explode(' ', $field_expression, 2); | list($field_name, $field_params) = explode(' ', $field_expression, 2); | ||||
$index_type = isset($this->curFields[$ml_field]['index_type']) ? $this->curFields[$prev_field]['index_type'] : 'string'; | if ( isset($this->curFields[$ml_field]['index_type']) ) { | ||||
$index_type = $this->curFields[$ml_field]['index_type']; | |||||
} | |||||
else { | |||||
$index_type = 'string'; | |||||
} | |||||
$ret .= $index_type == 'string' ? 'ADD INDEX (`'.$field_name.'` (5) ), ' : 'ADD INDEX (`'.$field_name.'`), '; | $ret .= $index_type == 'string' ? 'ADD INDEX (`'.$field_name.'` (5) ), ' : 'ADD INDEX (`'.$field_name.'`), '; | ||||
$this->curIndexCount++; | $this->curIndexCount++; | ||||
} | } | ||||
$start_index++; | $start_index++; | ||||
} | } | ||||
return preg_replace('/, $/', ';', $ret); | return preg_replace('/, $/', ';', $ret); | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |