Index: branches/5.2.x/core/kernel/processors/main_processor.php =================================================================== diff -u -N -r14714 -r14745 --- branches/5.2.x/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 14714) +++ branches/5.2.x/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 14745) @@ -1,6 +1,6 @@ Load($phrase_key, 'PhraseKey') ) { $phrase->SetDBField('Phrase', $phrase_name); - $phrase->SetDBField('PhraseType', $this->Application->isAdmin ? 1 : 0); $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper'); /* @var $ml_helper kMultiLanguageHelper */ Index: branches/5.2.x/core/install/install_data.sql =================================================================== diff -u -N -r14730 -r14745 --- branches/5.2.x/core/install/install_data.sql (.../install_data.sql) (revision 14730) +++ branches/5.2.x/core/install/install_data.sql (.../install_data.sql) (revision 14745) @@ -905,42 +905,42 @@ (207, '0x046a', 'Yoruba (Nigeria)', 'yo-NG', '', ''), (208, '0x0435', 'Zulu/isiZulu (South Africa)', 'zu-ZA', 'Latn', '1252'); -INSERT INTO SearchConfig VALUES ('Category', 'NewItem', 0, 1, 'lu_fielddesc_category_newitem', 'lu_field_newitem', 'In-Portal', 'la_text_category', 18, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'PopItem', 0, 1, 'lu_fielddesc_category_popitem', 'lu_field_popitem', 'In-Portal', 'la_text_category', 19, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'HotItem', 0, 1, 'lu_fielddesc_category_hotitem', 'lu_field_hotitem', 'In-Portal', 'la_text_category', 17, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'MetaDescription', 0, 1, 'lu_fielddesc_category_metadescription', 'lu_field_metadescription', 'In-Portal', 'la_text_category', 16, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'ParentPath', 0, 1, 'lu_fielddesc_category_parentpath', 'lu_field_parentpath', 'In-Portal', 'la_text_category', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'ResourceId', 0, 1, 'lu_fielddesc_category_resourceid', 'lu_field_resourceid', 'In-Portal', 'la_text_category', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'CreatedById', 0, 1, 'lu_fielddesc_category_createdbyid', 'lu_field_createdbyid', 'In-Portal', 'la_text_category', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'CachedNavbar', 0, 1, 'lu_fielddesc_category_cachednavbar', 'lu_field_cachednavbar', 'In-Portal', 'la_text_category', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'CachedDescendantCatsQty', 0, 1, 'lu_fielddesc_category_cacheddescendantcatsqty', 'lu_field_cacheddescendantcatsqty', 'In-Portal', 'la_text_category', 11, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'MetaKeywords', 0, 1, 'lu_fielddesc_category_metakeywords', 'lu_field_metakeywords', 'In-Portal', 'la_text_category', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'Priority', 0, 1, 'lu_fielddesc_category_priority', 'lu_field_priority', 'In-Portal', 'la_text_category', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'Status', 0, 1, 'lu_fielddesc_category_status', 'lu_field_status', 'In-Portal', 'la_text_category', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'EditorsPick', 0, 1, 'lu_fielddesc_category_editorspick', 'lu_field_editorspick', 'In-Portal', 'la_text_category', 6, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'CreatedOn', 0, 1, 'lu_fielddesc_category_createdon', 'lu_field_createdon', 'In-Portal', 'la_text_category', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'Description', 1, 1, 'lu_fielddesc_category_description', 'lu_field_description', 'In-Portal', 'la_text_category', 4, DEFAULT, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'Name', 1, 1, 'lu_fielddesc_category_name', 'lu_field_name', 'In-Portal', 'la_text_category', 3, DEFAULT, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'ParentId', 0, 1, 'lu_fielddesc_category_parentid', 'lu_field_parentid', 'In-Portal', 'la_text_category', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'CategoryId', 0, 1, 'lu_fielddesc_category_categoryid', 'lu_field_categoryid', 'In-Portal', 'la_text_category', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'Modified', 0, 1, 'lu_fielddesc_category_modified', 'lu_field_modified', 'In-Portal', 'la_text_category', 20, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Category', 'ModifiedById', 0, 1, 'lu_fielddesc_category_modifiedbyid', 'lu_field_modifiedbyid', 'In-Portal', 'la_text_category', 21, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'NewItem', 0, 1, 'lu_fielddesc_category_newitem', 'lc_field_newitem', 'In-Portal', 'la_text_category', 18, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'PopItem', 0, 1, 'lu_fielddesc_category_popitem', 'lc_field_popitem', 'In-Portal', 'la_text_category', 19, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'HotItem', 0, 1, 'lu_fielddesc_category_hotitem', 'lc_field_hotitem', 'In-Portal', 'la_text_category', 17, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'MetaDescription', 0, 1, 'lu_fielddesc_category_metadescription', 'lc_field_MetaDescription', 'In-Portal', 'la_text_category', 16, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'ParentPath', 0, 1, 'lu_fielddesc_category_parentpath', 'lc_field_ParentPath', 'In-Portal', 'la_text_category', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'ResourceId', 0, 1, 'lu_fielddesc_category_resourceid', 'lc_field_resourceid', 'In-Portal', 'la_text_category', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'CreatedById', 0, 1, 'lu_fielddesc_category_createdbyid', 'lc_field_createdbyid', 'In-Portal', 'la_text_category', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'CachedNavbar', 0, 1, 'lu_fielddesc_category_cachednavbar', 'lc_field_CachedNavBar', 'In-Portal', 'la_text_category', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'CachedDescendantCatsQty', 0, 1, 'lu_fielddesc_category_cacheddescendantcatsqty', 'lc_field_CachedDescendantCatsQty', 'In-Portal', 'la_text_category', 11, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'MetaKeywords', 0, 1, 'lu_fielddesc_category_metakeywords', 'lc_field_MetaKeywords', 'In-Portal', 'la_text_category', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'Priority', 0, 1, 'lu_fielddesc_category_priority', 'lc_field_priority', 'In-Portal', 'la_text_category', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'Status', 0, 1, 'lu_fielddesc_category_status', 'lc_field_status', 'In-Portal', 'la_text_category', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'EditorsPick', 0, 1, 'lu_fielddesc_category_editorspick', 'lc_field_EditorsPick', 'In-Portal', 'la_text_category', 6, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'CreatedOn', 0, 1, 'lu_fielddesc_category_createdon', 'lc_field_createdon', 'In-Portal', 'la_text_category', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'Description', 1, 1, 'lu_fielddesc_category_description', 'lc_field_description', 'In-Portal', 'la_text_category', 4, DEFAULT, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'Name', 1, 1, 'lu_fielddesc_category_name', 'lc_field_name', 'In-Portal', 'la_text_category', 3, DEFAULT, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'ParentId', 0, 1, 'lu_fielddesc_category_parentid', 'lc_field_ParentId', 'In-Portal', 'la_text_category', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'CategoryId', 0, 1, 'lu_fielddesc_category_categoryid', 'lc_field_CategoryId', 'In-Portal', 'la_text_category', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'Modified', 0, 1, 'lu_fielddesc_category_modified', 'lc_field_modified', 'In-Portal', 'la_text_category', 20, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('Category', 'ModifiedById', 0, 1, 'lu_fielddesc_category_modifiedbyid', 'lc_field_modifiedbyid', 'In-Portal', 'la_text_category', 21, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'PortalUserId', -1, 0, 'lu_fielddesc_user_portaluserid', 'lu_field_portaluserid', 'In-Portal', 'la_text_user', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'Username', -1, 0, 'lu_fielddesc_user_login', 'lu_field_login', 'In-Portal', 'la_text_user', 1, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'Password', -1, 0, 'lu_fielddesc_user_password', 'lu_field_password', 'In-Portal', 'la_text_user', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'tz', -1, 0, 'lu_fielddesc_user_tz', 'lu_field_tz', 'In-Portal', 'la_text_user', 17, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'dob', -1, 0, 'lu_fielddesc_user_dob', 'lu_field_dob', 'In-Portal', 'la_text_user', 16, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Modified', -1, 0, 'lu_fielddesc_user_modified', 'lu_field_modified', 'In-Portal', 'la_text_user', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('PortalUser', 'Status', -1, 0, 'lu_fielddesc_user_status', 'lu_field_status', 'In-Portal', 'la_text_user', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('PortalUser', 'ResourceId', -1, 0, 'lu_fielddesc_user_resourceid', 'lu_field_resourceid', 'In-Portal', 'la_text_user', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Modified', -1, 0, 'lu_fielddesc_user_modified', 'lc_field_modified', 'In-Portal', 'la_text_user', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('PortalUser', 'Status', -1, 0, 'lu_fielddesc_user_status', 'lc_field_status', 'In-Portal', 'la_text_user', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('PortalUser', 'ResourceId', -1, 0, 'lu_fielddesc_user_resourceid', 'lc_field_resourceid', 'In-Portal', 'la_text_user', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'Country', -1, 0, 'lu_fielddesc_user_country', 'lu_field_country', 'In-Portal', 'la_text_user', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'Zip', -1, 0, 'lu_fielddesc_user_zip', 'lu_field_zip', 'In-Portal', 'la_text_user', 11, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'State', -1, 0, 'lu_fielddesc_user_state', 'lu_field_state', 'In-Portal', 'la_text_user', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'City', -1, 0, 'lu_fielddesc_user_city', 'lu_field_city', 'In-Portal', 'la_text_user', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'Street', -1, 0, 'lu_fielddesc_user_street', 'lu_field_street', 'In-Portal', 'la_text_user', 8, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'Phone', -1, 0, 'lu_fielddesc_user_phone', 'lu_field_phone', 'In-Portal', 'la_text_user', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('PortalUser', 'CreatedOn', -1, 0, 'lu_fielddesc_user_createdon', 'lu_field_createdon', 'In-Portal', 'la_text_user', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO SearchConfig VALUES ('PortalUser', 'CreatedOn', -1, 0, 'lu_fielddesc_user_createdon', 'lc_field_createdon', 'In-Portal', 'la_text_user', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'Email', -1, 0, 'lu_fielddesc_user_email', 'lu_field_email', 'In-Portal', 'la_text_user', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'LastName', -1, 0, 'lu_fielddesc_user_lastname', 'lu_field_lastname', 'In-Portal', 'la_text_user', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO SearchConfig VALUES ('PortalUser', 'FirstName', -1, 0, 'lu_fielddesc_user_firstname', 'lu_field_firstname', 'In-Portal', 'la_text_user', 3, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); Index: branches/5.2.x/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r14696 -r14745 --- branches/5.2.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 14696) +++ branches/5.2.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 14745) @@ -1,6 +1,6 @@ GetRecordsCount(false) != $object->GetRecordsCount() ) { - $of_phrase = $this->Application->Phrase('la_of'); + $of_phrase = $this->Application->Phrase('lc_of'); return $object->GetRecordsCount() . ' ' . $of_phrase . ' ' . $object->GetRecordsCount(false); } Index: branches/5.2.x/core/units/phrases/phrases_config.php =================================================================== diff -u -N -r14585 -r14745 --- branches/5.2.x/core/units/phrases/phrases_config.php (.../phrases_config.php) (revision 14585) +++ branches/5.2.x/core/units/phrases/phrases_config.php (.../phrases_config.php) (revision 14745) @@ -1,6 +1,6 @@ Array ('type' => 'int', 'not_null' => 1, 'default' => 0), 'Phrase' => Array ( 'type' => 'string', - 'formatter' => 'kFormatter', 'regexp' => '/^(la|lu)_[A-Z\d:_\-\.]+$/i', 'unique' => Array (), + 'formatter' => 'kFormatter', 'regexp' => '/^(la|lu|lc)_[A-Z\d:_\-\.]+$/i', 'unique' => Array (), 'not_null' => 1, 'required' => 1, 'default' => '', ), 'PhraseKey' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''), @@ -120,8 +120,8 @@ 'ColumnTranslation' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => NULL, 'db_type' => 'text'), 'PhraseType' => Array ( 'type' => 'int', - 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_PhraseType_Front', 1 => 'la_PhraseType_Admin', 2 => 'la_PhraseType_Both'), 'use_phrases' => 1, - 'not_null' => 1, 'required' => 1, 'default' => 0, + 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_PhraseType_Front', 1 => 'la_PhraseType_Admin', 2 => 'lc_PhraseType_Both'), 'use_phrases' => 1, + 'not_null' => 1, 'required' => 1, 'default' => Language::PHRASE_TYPE_COMMON, ), 'LastChanged' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL), 'LastChangeIP' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), Index: branches/5.2.x/core/admin_templates/regional/languages_edit_phrases.tpl =================================================================== diff -u -N -r14244 -r14745 --- branches/5.2.x/core/admin_templates/regional/languages_edit_phrases.tpl (.../languages_edit_phrases.tpl) (revision 14244) +++ branches/5.2.x/core/admin_templates/regional/languages_edit_phrases.tpl (.../languages_edit_phrases.tpl) (revision 14745) @@ -13,7 +13,7 @@ function edit() { Application.SetVar('regional', 1); - std_edit_temp_item('phrases', 'regional/phrases_edit'); + std_edit_item('phrases', 'regional/phrases_edit'); } a_toolbar = new ToolBar(); @@ -42,7 +42,7 @@ a_toolbar.AddButton( new ToolBarButton('new_item', '::', function() { Application.SetVar('regional', 1); - std_new_item('phrases', 'regional/phrases_edit') + std_precreate_item('phrases', 'regional/phrases_edit') } ) ); a_toolbar.AddButton( new ToolBarButton('edit', '::', edit) ); Index: branches/5.2.x/core/units/phrases/phrases_event_handler.php =================================================================== diff -u -N -r14596 -r14745 --- branches/5.2.x/core/units/phrases/phrases_event_handler.php (.../phrases_event_handler.php) (revision 14596) +++ branches/5.2.x/core/units/phrases/phrases_event_handler.php (.../phrases_event_handler.php) (revision 14745) @@ -1,6 +1,6 @@ getObject(); + /* @var $object kDBItem */ + + $this->_setPhraseModule($object); + } + + /** * Forces new label in case if issued from get link * * @param kEvent $event @@ -128,23 +145,18 @@ $label = $this->Application->GetVar($event->getPrefixSpecial() . '_label'); - if ($label) { + if ( $label ) { // phrase is created in language, used to display phrases $object->SetDBField('Phrase', $label); - $object->SetDBField('PhraseType', 1); // admin + $object->SetDBField('PhraseType', $this->_getPhraseType($label)); // to show on form $object->SetDBField('PrimaryTranslation', $this->_getPrimaryTranslation($label)); } - // set module from cookie - $last_module = $this->Application->GetVar('last_module'); + $this->_setPhraseModule($object); - if ($last_module) { - $object->SetDBField('Module', $last_module); - } - - if (($event->Special == 'export') || ($event->Special == 'import')) { + if ( $event->Special == 'export' || $event->Special == 'import' ) { $object->SetDBField('PhraseType', '|0|1|2|'); - $object->SetDBField('Module', '|' . implode('|', array_keys($this->Application->ModuleInfo)) . '|' ); + $object->SetDBField('Module', '|' . implode('|', array_keys($this->Application->ModuleInfo)) . '|'); } } @@ -153,8 +165,9 @@ * * @param string $phrase * @return string + * @access protected */ - function _getPrimaryTranslation($phrase) + protected function _getPrimaryTranslation($phrase) { $sql = 'SELECT l' . $this->Application->GetDefaultLanguageId() . '_Translation FROM ' . $this->Application->getUnitOption($this->Prefix, 'TableName') . ' @@ -164,6 +177,22 @@ } /** + * Sets new phrase module + * + * @param kDBItem $object + * @return void + * @access protected + */ + protected function _setPhraseModule(&$object) + { + $last_module = $this->Application->GetVar('last_module'); + + if ( $last_module ) { + $object->SetDBField('Module', $last_module); + } + } + + /** * Forces create to use live table * * @param kEvent $event @@ -270,7 +299,9 @@ $object =& $event->getObject(); /* @var $object kDBItem */ - $object->SetDBField('PhraseKey', mb_strtoupper($object->GetDBField('Phrase'))); + $label = $object->GetDBField('Phrase'); + $object->SetDBField('PhraseKey', mb_strtoupper($label)); + $object->SetDBField('PhraseType', $this->_getPhraseType($label)); if ( $this->translationChanged($object) ) { $object->SetDBField('LastChanged_date', adodb_mktime() ); @@ -282,8 +313,29 @@ } /** + * Returns phrase type, that corresponds given phrase label + * + * @param string $label + * @return int + * @access protected + */ + protected function _getPhraseType($label) + { + $phrase_type_map = Array ( + 'LU' => Language::PHRASE_TYPE_FRONT, + 'LA' => Language::PHRASE_TYPE_ADMIN, + 'LC' => Language::PHRASE_TYPE_COMMON + ); + + $label = mb_strtoupper($label); + $label_prefix = substr($label, 0, 2); + + return isset($phrase_type_map[$label_prefix]) ? $phrase_type_map[$label_prefix] : Language::PHRASE_TYPE_COMMON; + } + + /** * Checks, that at least one of phrase's translations was changed - * + * * @param kDBItem $object * @return bool */ Index: branches/5.2.x/core/kernel/constants.php =================================================================== diff -u -N -r14640 -r14745 --- branches/5.2.x/core/kernel/constants.php (.../constants.php) (revision 14640) +++ branches/5.2.x/core/kernel/constants.php (.../constants.php) (revision 14745) @@ -1,6 +1,6 @@ - + Index: branches/5.2.x/core/install/upgrades.sql =================================================================== diff -u -N -r14730 -r14745 --- branches/5.2.x/core/install/upgrades.sql (.../upgrades.sql) (revision 14730) +++ branches/5.2.x/core/install/upgrades.sql (.../upgrades.sql) (revision 14745) @@ -2236,4 +2236,49 @@ SET VariableValue = IF(VariableValue = 1, 0, 1) WHERE VariableName = 'RegistrationUsernameRequired'; -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PerformExactSearch', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_PerformExactSearch', 'checkbox', '', '', '10.10', 0, 0, 'la_hint_PerformExactSearch'); \ No newline at end of file +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'PerformExactSearch', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_PerformExactSearch', 'checkbox', '', '', '10.10', 0, 0, 'la_hint_PerformExactSearch'); + + +UPDATE Phrase +SET PhraseType = 1 +WHERE PhraseKey IN ( + 'LA_USERS_SUBSCRIBER_GROUP', 'LA_PROMPT_DUPREVIEWS', 'LA_PROMPT_DUPREVIEWS', 'LA_PROMPT_DUPRATING', + 'LA_PROMPT_OVERWRITEPHRASES', 'LA_TEXT_BACKUP_ACCESS', 'LA_PHRASETYPE_BOTH', 'LA_TOOLTIP_NEWLISTING' +); + +UPDATE Phrase +SET PhraseType = 0 +WHERE PhraseKey IN ('LU_TITLE_SHIPPINGINFORMATION', 'LU_COMM_LASTQUATER'); + +UPDATE Phrase +SET Phrase = REPLACE(Phrase, 'lu_', 'la_'), PhraseKey = UPPER(Phrase) +WHERE PhraseKey IN ('LU_OPT_AUTODETECT', 'LU_OPT_COOKIES', 'LU_OPT_QUERYSTRING'); + +UPDATE ConfigurationValues +SET ValueList = REPLACE(ValueList, 'lu_', 'la_') +WHERE VariableName = 'CookieSessions'; + +DELETE FROM Phrase WHERE PhraseKey IN ('LU_INVALID_PASSWORD', 'LA_OF', 'LU_TITLE_REVIEWPRODUCT'); + +UPDATE Phrase +SET PhraseType = 2 +WHERE PhraseType = 1 AND (PhraseKey LIKE 'lu_field_%' OR PhraseKey = 'LA_TEXT_VALID'); + +UPDATE Phrase +SET Phrase = REPLACE(Phrase, 'la_', 'lc_'), PhraseKey = UPPER(Phrase) +WHERE PhraseType = 2; + +UPDATE Phrase +SET Phrase = REPLACE(Phrase, 'lu_', 'lc_'), PhraseKey = UPPER(Phrase) +WHERE PhraseType = 2; + +UPDATE SearchConfig +SET DisplayName = REPLACE(DisplayName, 'lu_', 'lc_') +WHERE DisplayName IN ( + 'lu_field_newitem', 'lu_field_popitem', 'lu_field_hotitem', 'lu_field_resourceid', 'lu_field_createdbyid', + 'lu_field_priority', 'lu_field_status', 'lu_field_createdon', 'lu_field_description', 'lu_field_name', + 'lu_field_modified', 'lu_field_modifiedbyid', 'lu_field_ParentPath', 'lu_field_ParentId', 'lu_field_MetaKeywords', + 'lu_field_MetaDescription', 'lu_field_EditorsPick', 'lu_field_CategoryId', 'lu_field_CachedNavBar', + 'lu_field_CachedDescendantCatsQty', 'lu_field_hits', 'lu_field_cachedrating', 'lu_field_cachedvotesqty', + 'lu_field_cachedreviewsqty', 'lu_field_orgid' +); Index: branches/5.2.x/core/admin_templates/regional/phrases_edit.tpl =================================================================== diff -u -N -r14585 -r14745 --- branches/5.2.x/core/admin_templates/regional/phrases_edit.tpl (.../phrases_edit.tpl) (revision 14585) +++ branches/5.2.x/core/admin_templates/regional/phrases_edit.tpl (.../phrases_edit.tpl) (revision 14745) @@ -22,7 +22,7 @@ window_close(); - cancel_edit('phrases', 'OnCancel', '', ''); + cancel_edit('phrases', 'OnCancelEdit', '', ''); } ) @@ -84,7 +84,7 @@ - + Index: branches/5.2.x/core/install/english.lang =================================================================== diff -u -N -r14730 -r14745 --- branches/5.2.x/core/install/english.lang (.../english.lang) (revision 14730) +++ branches/5.2.x/core/install/english.lang (.../english.lang) (revision 14745) @@ -659,7 +659,6 @@ SG90 SFRNTA== SUQgRmllbGQ= - RW5hYmxpbmcgdGhpcyBvcHRpb24gd2lsbCB1bmRvIGFueSBjaGFuZ2VzIHlvdSBoYXZlIG1hZGUgdG8gZXhpc3RpbmcgcGhyYXNlcw== SW52YWxpZCBFLU1haWw= SW5jb3JyZWN0IGRhdGEgZm9ybWF0LCBwbGVhc2UgdXNlIGludGVnZXI= TWlzc2luZyBvciBpbnZhbGlkIEluLVBvcnRhbCBMaWNlbnNl @@ -715,7 +714,6 @@ Tm8= Tm9uZQ== Tm8gUGVybWlzc2lvbnM= - b2Y= T2Zm T24= T25lIFdheQ== @@ -726,13 +724,15 @@ QWRkcmVzcw== QWZ0ZXI= QWxsb3c= + QXV0by1EZXRlY3Q= QmVmb3Jl Qm91bmNlZA== Q2FuY2VsZWQ= Q2l0eQ== Q29sb24= Q29tbWE= Q29tbWVudCBUZXh0 + Q29va2llcw== Q291bnRyeQ== Q3JlYXRlZCBPbg== Q3VycmVudCBEb21haW4= @@ -776,6 +776,7 @@ UGhvbmU= UG9wdXAgV2luZG93 UHJvY2Vzc2Vk + UXVlcnkgU3RyaW5nIChTSUQp UmF0aW5n UmVjaXBpZW50IEUtbWFpbA== UmVjaXBpZW50IE5hbWU= @@ -883,8 +884,8 @@ RGlzYWJsZWQgU2VjdGlvbnM= RGlzcGxheSBpbiBHcmlk RGlzcGxheSBPcmRlcg== - QWxsb3cgRHVwbGljYXRlIFJhdGluZyBWb3Rlcw== - QWxsb3cgRHVwbGljYXRlIFJldmlld3M= + QWxsb3cgRHVwbGljYXRlIFJhdGluZyBWb3Rlcw== + QWxsb3cgRHVwbGljYXRlIFJldmlld3M= RWRpdG9yJ3MgUGljaw== VHlwZQ== VGhlIEVtYWlsIE1lc3NhZ2UgaGFzIGJlZW4gc2VudA== @@ -917,7 +918,7 @@ TmV3ZXN0IExpbmsgRGF0ZQ== TmV3ZXN0IFVzZXIgRGF0ZQ== Q3VycmVudGx5IEFjdGl2ZSBVc2VyIFNlc3Npb25z - T3ZlcndyaXRlIEV4aXN0aW5nIFBocmFzZXM= + T3ZlcndyaXRlIEV4aXN0aW5nIFBocmFzZXM= UGVuZGluZyBTZWN0aW9ucw== UGVuZGluZyBJdGVtcw== UGVyZm9ybSB0aGlzIG9wZXJhdGlvbiBub3c/ @@ -1127,7 +1128,7 @@ QWxs QXV0by1SZWZyZXNo QmFjayB1cCBoYXMgYmVlbiBjb21wbGV0ZWQuIFRoZSBiYWNrdXAgZmlsZSBpczo= - SW4tUG9ydGFsIGRvZXMgbm90IGhhdmUgYWNjZXNzIHRvIHdyaXRlIHRvIHRoaXMgZGlyZWN0b3J5 + SW4tUG9ydGFsIGRvZXMgbm90IGhhdmUgYWNjZXNzIHRvIHdyaXRlIHRvIHRoaXMgZGlyZWN0b3J5 VGhpcyB1dGlsaXR5IGFsbG93cyB5b3UgdG8gYmFja3VwIHlvdXIgSW4tUG9ydGFsIGRhdGFiYXNlIHNvIGl0IGNhbiBiZSByZXN0b3JlZCBhdCBsYXRlciBpbiBuZWVkZWQu Ynl0ZXM= Q2F0YWxvZw== @@ -1152,7 +1153,6 @@ SSBhZ3JlZSB0byB0aGUgdGVybXMgYW5kIGNvbmRpdGlvbnM= SW1wb3J0IFJlc3VsdHM= SW4gRGV2ZWxvcG1lbnQ= - SW52YWxpZA== SW52ZXJ0 S2V5d29yZA== TGluaw== @@ -1163,7 +1163,6 @@ TmV3 Tm9uZQ== Tm8gUGVybWlzc2lvbg== - Tm90IFZhbGlkYXRlZA== b3I= UGhvbmU= UG9wdWxhcg== @@ -1473,7 +1472,7 @@ QXNzaWduIHJlZ2lzdGVyZWQgdXNlcnMgdG8gZ3JvdXA= QXNzaWduIHBhc3N3b3JkIGF1dG9tYXRpY2FsbHk= TnVtYmVyIG9mIGRheXMgdG8gZGVueSBtdWx0aXBsZSBDb21tZW50cyBmcm9tIHRoZSBzYW1lIHVzZXI= - QXNzaWduIG1haWxpbmcgbGlzdCBzdWJzY3JpYmVycyB0byBncm91cA== + QXNzaWduIG1haWxpbmcgbGlzdCBzdWJzY3JpYmVycyB0byBncm91cA== TnVtYmVyIG9mIGRheXMgdG8gZGVueSBtdWx0aXBsZSB2b3RlcyBmcm9tIHRoZSBzYW1lIHVzZXI= VVMvVUs= RS1tYWlsIGFkZHJlc3M= @@ -1487,42 +1486,41 @@ V2luZG93cw== eWVhcg== WWVz - U3ViLXNlY3Rpb25zIFF1YW50aXR5 - TmF2aWdhdGlvbiBCYXI= - UmF0aW5n - TnVtYmVyIG9mIFJldmlld3M= - TnVtYmVyIG9mIFJhdGluZyBWb3Rlcw== - U2VjdGlvbiBJRA== - Q3JlYXRlZCBCeSBVc2VyIElE - RGF0ZSBDcmVhdGVk - RGVzY3JpcHRpb24= - RWRpdG9ycyBQaWNr - SGl0cw== - SXRlbSBJcyBIb3Q= - TGluayBJRA== - TWV0YSBEZXNjcmlwdGlvbg== - TWV0YSBLZXl3b3Jkcw== - TGFzdCBNb2RpZmllZCBEYXRl - TW9kaWZpZWQgQnkgVXNlciBJRA== - TmFtZQ== - SXRlbSBJcyBOZXc= - Tm90aWZ5IE93bmVyIG9mIENoYW5nZXM= - T3JpZ2luYWwgSXRlbSBJRA== - T3duZXIgVXNlciBJRA== - UGFyZW50IElE - UGFyZW50IFBhdGg= - SXRlbSBJcyBQb3B1bGFy - UHJpb3JpdHk= - UXR5IFNvbGQ= - UmVzb3VyY2UgSUQ= - U3RhdHVz - SXRlbSBJcyBhIFRvcCBTZWxsZXI= - VVJM - SW5jb3JyZWN0IFVzZXJuYW1lIG9yIFBhc3N3b3Jk - b2Y= - QXV0by1EZXRlY3Q= - Q29va2llcw== - UXVlcnkgU3RyaW5nIChTSUQp + U3ViLXNlY3Rpb25zIFF1YW50aXR5 + TmF2aWdhdGlvbiBCYXI= + UmF0aW5n + TnVtYmVyIG9mIFJldmlld3M= + TnVtYmVyIG9mIFJhdGluZyBWb3Rlcw== + U2VjdGlvbiBJRA== + Q3JlYXRlZCBCeSBVc2VyIElE + RGF0ZSBDcmVhdGVk + RGVzY3JpcHRpb24= + RWRpdG9ycyBQaWNr + SGl0cw== + SXRlbSBJcyBIb3Q= + TGluayBJRA== + TWV0YSBEZXNjcmlwdGlvbg== + TWV0YSBLZXl3b3Jkcw== + TGFzdCBNb2RpZmllZCBEYXRl + TW9kaWZpZWQgQnkgVXNlciBJRA== + TmFtZQ== + SXRlbSBJcyBOZXc= + Tm90aWZ5IE93bmVyIG9mIENoYW5nZXM= + T3JpZ2luYWwgSXRlbSBJRA== + T3duZXIgVXNlciBJRA== + UGFyZW50IElE + UGFyZW50IFBhdGg= + SXRlbSBJcyBQb3B1bGFy + UHJpb3JpdHk= + UXR5IFNvbGQ= + UmVzb3VyY2UgSUQ= + U3RhdHVz + SXRlbSBJcyBhIFRvcCBTZWxsZXI= + VVJM + RW5hYmxpbmcgdGhpcyBvcHRpb24gd2lsbCB1bmRvIGFueSBjaGFuZ2VzIHlvdSBoYXZlIG1hZGUgdG8gZXhpc3RpbmcgcGhyYXNlcw== + b2Y= + SW52YWxpZA== + Tm90IFZhbGlkYXRlZA== U3ViamVjdDogTmV3IENhdGVnb3J5ICI8aW5wMjpjX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIC0gQWRkZWQKCllvdXIgc3VnZ2VzdGVkIGNhdGVnb3J5ICI8aW5wMjpjX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIGhhcyBiZWVuIGFkZGVkLg== @@ -1872,4 +1870,4 @@ - \ No newline at end of file +