Attached Files |
unify_multilingual_custom_field_processing_core.patch [^] (16,195 bytes) 2011-04-03 09:19
[Show Content]
Index: admin_templates/categories/categories_edit_custom.tpl
===================================================================
--- admin_templates/categories/categories_edit_custom.tpl (revision 14318)
+++ admin_templates/categories/categories_edit_custom.tpl (working copy)
@@ -3,7 +3,7 @@
<inp2:m_include t="incs/header"/>
<inp2:m_include t="categories/categories_tabs"/>
-<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" title_preset="categories_custom" grid="SeparateTab" tab_preset="Default"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" title_preset="categories_custom" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -51,23 +51,23 @@
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
+ <inp2:m_RenderElement name="ml_selector" prefix="c"/>
</tr>
</tbody>
</table>
+<inp2:c_SaveWarning name="grid_save_warning"/>
+<inp2:c_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_RenderElement
- name="grid"
- PrefixSpecial="cf"
- SourcePrefix="c"
- value_field="Value"
- IdField="CustomFieldId"
- per_page="-1"
- grid="SeparateTab"
- header_block="grid_column_title_no_sorting"
- no_init="no_init"
- />
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf_PrintList render_as="cv_row_block" SourcePrefix="c" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:c_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: admin_templates/incs/custom_blocks.tpl
===================================================================
--- admin_templates/incs/custom_blocks.tpl (revision 14318)
+++ admin_templates/incs/custom_blocks.tpl (working copy)
@@ -110,7 +110,15 @@
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell" onmouseover="show_form_error('<inp2:m_Param name="SourcePrefix" js_escape="1"/>', '<inp2:m_Param name="virtual_field" js_escape="1"/>')" onmouseout="hide_form_error('<inp2:m_Param name="SourcePrefix" js_escape="1"/>')">
- <inp2:m_RenderElement name="grid_data_label_ml_td" grid="$grid" SourcePrefix="$SourcePrefix" virtual_field="$virtual_field" value_field="$value_field" ElementTypeField="ElementType" field="Prompt" PrefixSpecial="$PrefixSpecial"/>
+ <span class="<inp2:m_if check='{$SourcePrefix}_HasError' field='$virtual_field'>error-cell</inp2:m_if>"><inp2:Field field="Prompt" as_label="1"/></span><inp2:m_if check="{$SourcePrefix}_IsRequired" field="$virtual_field"><span class="field-required"> *</span></inp2:m_if>:
+
+ <inp2:m_if check="FieldEquals" field="ElementType" value="textarea">
+ <br/>
+ <inp2:{$SourcePrefix}_InputName field="$virtual_field" result_to_var="input_name"/>
+ <a href="<inp2:m_Link template='popups/editor' TargetField='$input_name' pass_through='TargetField' pass='m,$SourcePrefix'/>" onclick="openSelector('<inp2:m_Param name='SourcePrefix' js_escape='1'/>', this.href, '', '800x575'); return false;">
+ <img src="img/icons/icon24_link_editor.gif" border="0">
+ </a>
+ </inp2:m_if>
</td>
<td class="control-mid"> </td>
<script type="text/javascript">
Index: admin_templates/incs/grid_blocks.tpl
===================================================================
--- admin_templates/incs/grid_blocks.tpl (revision 14318)
+++ admin_templates/incs/grid_blocks.tpl (working copy)
@@ -247,25 +247,6 @@
<inp2:Field field="$field" grid="$grid" plus_or_as_label="1" no_special="no_special" format="$format"/>
</inp2:m_DefineElement>
-<inp2:m_DefineElement name="grid_data_label_ml_td" format="">
- <span class="<inp2:m_if check="{$SourcePrefix}_HasError" field="$virtual_field">error-cell</inp2:m_if>">
- <inp2:{$PrefixSpecial}_Field field="$field" grid="$grid" as_label="1" no_special="no_special" format="$format"/>
- </span><inp2:m_if check="{$SourcePrefix}_IsRequired" field="$virtual_field"><span class="field-required"> *</span></inp2:m_if>:<br />
-
- <inp2:m_if check="FieldEquals" field="$ElementTypeField" value="textarea">
- <inp2:m_if check="Field" name="MultiLingual" equals_to="1" db="db">
- <a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>, 1);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.png" style="cursor:hand;" width="24" height="24" border="0"></a>
- <inp2:m_else/>
- <inp2:Field name="FieldName" result_to_var="custom_field"/>
- <a href="javascript:OpenEditor('§ion=in-link:editlink_general', 'kernel_form', '<inp2:{$SourcePrefix}_InputName field="cust_{$custom_field}"/>');"><img src="img/icons/icon24_link_editor.gif" style="cursor: hand;" width="24" height="24" border="0"></a>
- </inp2:m_if>
- <inp2:m_else/>
- <inp2:m_if check="Field" name="MultiLingual" equals_to="1" db="db">
- <a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.png" style="cursor:hand;" width="24" height="24" border="0"></a>
- </inp2:m_if>
- </inp2:m_if>
-</inp2:m_DefineElement>
-
<inp2:m_DefineElement name="grid_empty_filter">
</inp2:m_DefineElement>
Index: admin_templates/users/users_edit_custom.tpl
===================================================================
--- admin_templates/users/users_edit_custom.tpl (revision 14318)
+++ admin_templates/users/users_edit_custom.tpl (working copy)
@@ -49,23 +49,24 @@
</script>
</td>
- <inp2:m_if check="u_DisplayOriginal" display_original="1">
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTabOriginal"/>
- <inp2:m_else/>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
- </inp2:m_if>
+ <inp2:m_RenderElement name="ml_selector" prefix="u"/>
</tr>
</tbody>
</table>
+<inp2:u_SaveWarning name="grid_save_warning"/>
+<inp2:u_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_if check="u_DisplayOriginal" display_original="1">
- <inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="u" value_field="Value" per_page="-1" grid="SeparateTabOriginal" header_block="grid_column_title_no_sorting" no_init="no_init" original_title="la_section_OriginalValues" display_original="1"/>
-<inp2:m_else/>
- <inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="u" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
-</inp2:m_if>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf_PrintList render_as="cv_row_block" SourcePrefix="u" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:u_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: kernel/db/dbitem.php
===================================================================
--- kernel/db/dbitem.php (revision 14318)
+++ kernel/db/dbitem.php (working copy)
@@ -1512,9 +1512,11 @@
return true;
}
- $cdata_key = rtrim($this->Prefix.'-cdata.'.$this->Special, '.');
- $cdata =& $this->Application->recallObject($cdata_key, null, Array('skip_autoload' => true, 'populate_ml_fields' => true));
+ $cdata_key = rtrim($this->Prefix . '-cdata.' . $this->Special, '.');
+ $cdata =& $this->Application->recallObject($cdata_key, null, Array('skip_autoload' => true));
+ /* @var $cdata kDBItem */
+
$resource_id = $this->GetDBField('ResourceId');
$cdata->Load($resource_id, 'ResourceId');
$cdata->SetDBField('ResourceId', $resource_id);
@@ -1522,9 +1524,25 @@
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
/* @var $ml_formatter kMultiLanguage */
+ $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
+ /* @var $ml_helper kMultiLanguageHelper */
+
foreach ($this->customFields as $custom_id => $custom_name) {
- $force_primary = isset($cdata->Fields['cust_'.$custom_id]['force_primary']) && $cdata->Fields['cust_'.$custom_id]['force_primary'];
- $cdata->SetDBField($ml_formatter->LangFieldName('cust_'.$custom_id, $force_primary), $this->GetDBField('cust_'.$custom_name));
+ $field_options = $cdata->GetFieldOptions('cust_' . $custom_id);
+ $force_primary = isset($field_options['force_primary']) && $field_options['force_primary'];
+
+ if ($force_primary) {
+ $cdata->SetDBField($ml_formatter->LangFieldName('cust_' . $custom_id, true), $this->GetDBField('cust_' . $custom_name));
+ }
+ else {
+ for ($language_id = 1; $language_id <= $ml_helper->languageCount; $language_id++) {
+ if (!$ml_helper->LanguageFound($language_id)) {
+ continue;
+ }
+
+ $cdata->SetDBField('l' . $language_id . '_cust_' . $custom_id, $this->GetDBField('l' . $language_id . '_cust_' . $custom_name));
+ }
+ }
}
return $cdata->isLoaded() ? $cdata->Update() : $cdata->Create();
Index: units/custom_data/custom_data_event_handler.php
===================================================================
--- units/custom_data/custom_data_event_handler.php (revision 14318)
+++ units/custom_data/custom_data_event_handler.php (working copy)
@@ -147,8 +147,7 @@
$virtual_fields = $this->Application->getUnitOption($prefix, 'VirtualFields', Array());
$cf_helper =& $this->Application->recallObject('InpCustomFieldsHelper');
- $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
- /* @var $ml_formatter kMultiLanguage */
+ /* @var $cf_helper InpCustomFieldsHelper */
$is_install = defined('IS_INSTALL') && IS_INSTALL;
@@ -157,10 +156,12 @@
$field_options = Array('type' => 'string', 'default' => $custom_params['DefaultValue']);
// raises warnings during 4.3.9 -> 5.0.0 upgrade, no fatal sqls though
- if ($custom_params['IsRequired']) {
+ if ( $custom_params['IsRequired'] ) {
$field_options['required'] = 1;
}
+ $calculated_fields['cust_' . $custom_name] = 'cust.l' . $this->Application->GetDefaultLanguageId() .'_cust_' . $custom_id;
+
switch ($custom_params['ElementType']) {
case 'date':
unset($field_options['options']);
@@ -187,19 +188,17 @@
default:
if ($custom_params['MultiLingual']) {
- $calculated_fields['cust_'.$custom_name.'_Primary'] = 'cust.'.$ml_formatter->LangFieldName('cust_'.$custom_id, true);
- $virtual_fields['cust_'.$custom_name.'_Primary'] = $field_options;
- $field_options['master_field'] = 'cust_'.$custom_name.'_Primary';
- $field_options['formatter'] = 'kCustomFieldFormatter';
+ $field_options['formatter'] = 'kMultiLanguage';
+ $calculated_fields['cust_' . $custom_name] = 'cust.l%2$s_cust_' . $custom_id;
}
break;
}
- $calculated_fields['cust_'.$custom_name] = 'cust.'.$ml_formatter->LangFieldName('cust_'.$custom_id, !$custom_params['MultiLingual']);
- if (!isset($virtual_fields['cust_'.$custom_name])) {
- $virtual_fields['cust_'.$custom_name] = Array();
+ if ( !isset($virtual_fields['cust_' . $custom_name]) ) {
+ $virtual_fields['cust_' . $custom_name] = Array ();
}
- $virtual_fields['cust_'.$custom_name] = array_merge_recursive2($field_options, $virtual_fields['cust_'.$custom_name]);
+
+ $virtual_fields['cust_' . $custom_name] = array_merge_recursive2($field_options, $virtual_fields['cust_' . $custom_name]);
$custom_fields[$custom_id] = $custom_name;
}
Index: units/custom_fields/custom_fields_config.php
===================================================================
--- units/custom_fields/custom_fields_config.php (revision 14318)
+++ units/custom_fields/custom_fields_config.php (working copy)
@@ -158,32 +158,5 @@
// 'IsSystem' => Array ('title' => 'la_col_IsSystem', 'filter_block' => 'grid_options_filter'),
),
),
-
- 'SeparateTab' => Array (
- 'Icons' => Array (
- 'default' => 'icon16_item.png',
- ),
- 'Selector' => '',
- 'Fields' => Array (
- 'FieldName' => Array ( 'title'=>'la_col_FieldName', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
- 'Prompt' => Array ( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter', 'width' => 200, ),
- 'Value' => Array ( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter', 'width' => 200, ),
- 'Error' => Array ( 'title'=>'la_col_Error', 'data_block' => 'custom_error_td', 'filter_block' => 'grid_empty_filter', 'width' => 100, ),
- ),
- ),
-
- 'SeparateTabOriginal' => Array (
- 'Icons' => Array (
- 'default' => 'icon16_item.png',
- ),
- 'Selector' => '',
- 'Fields' => Array (
- 'FieldName' => Array ( 'title'=>'la_col_FieldName', 'data_block' => 'grid_icon_td', 'filter_block' => 'grid_like_filter'),
- 'Prompt' => Array ( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter'),
- 'Value' => Array ( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter'),
- 'OriginalValue' => Array ( 'title'=>'la_col_OriginalValue', 'data_block' => 'grid_original_td', 'filter_block' => 'grid_like_filter'),
- ),
- ),
-
),
);
\ No newline at end of file
Index: units/custom_fields/custom_fields_tag_processor.php
===================================================================
--- units/custom_fields/custom_fields_tag_processor.php (revision 14318)
+++ units/custom_fields/custom_fields_tag_processor.php (working copy)
@@ -112,14 +112,25 @@
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
if ($source_prefix) {
- $list->SetDBField($params['value_field'], $source_object->GetDBField('cust_'.$list->GetDBField('FieldName')));
+ $options = $source_object->GetFieldOptions('cust_'.$list->GetDBField('FieldName'));
+
+ if ( isset($options['formatter']) && $options['formatter'] == 'kMultiLanguage' ) {
+ $language_prefix = 'l' . $this->Application->GetVar('m_lang') . '_';
+ }
+ else {
+ $language_prefix = '';
+ }
+
+ $list->SetDBField($params['value_field'], $source_object->GetDBField($language_prefix . 'cust_'.$list->GetDBField('FieldName')));
+
if ($display_original) {
$list->SetDBField('OriginalValue', $original_object->GetField('cust_'.$list->GetDBField('FieldName')));
}
+
$block_params['field'] = $block_params['virtual_field'] = 'cust_'.$list->GetDBField('FieldName');
$block_params['show_heading'] = ($prev_heading != $list->GetDBField('Heading') ) ? 1 : 0;
- $options = $source_object->GetFieldOptions('cust_'.$list->GetDBField('FieldName'));
+
$list->SetDBField('DirectOptions', isset($options['options']) ? $options['options'] : false);
}
unify_multilingual_custom_field_processing_modules.patch [^] (7,811 bytes) 2011-04-03 09:19
[Show Content]
Index: in-bulletin/admin_templates/topics/topics_custom.tpl
===================================================================
--- in-bulletin/admin_templates/topics/topics_custom.tpl (revision 14318)
+++ in-bulletin/admin_templates/topics/topics_custom.tpl (working copy)
@@ -1,7 +1,7 @@
<inp2:adm_SetPopupSize width="880" height="680"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" prefix="bb" section="in-portal:browse" grid="SeparateTab" title_preset="topics_custom" tab_preset="Default"/>
+<inp2:m_RenderElement name="combined_header" prefix="bb" section="in-portal:browse" title_preset="topics_custom" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -49,14 +49,24 @@
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
+ <inp2:m_RenderElement name="ml_selector" prefix="bb"/>
</tr>
</tbody>
</table>
+<inp2:bb_SaveWarning name="grid_save_warning"/>
+<inp2:bb_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="bb" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf_PrintList render_as="cv_row_block" SourcePrefix="bb" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:bb_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: in-commerce/admin_templates/products/products_custom.tpl
===================================================================
--- in-commerce/admin_templates/products/products_custom.tpl (revision 14318)
+++ in-commerce/admin_templates/products/products_custom.tpl (working copy)
@@ -1,7 +1,7 @@
<inp2:adm_SetPopupSize width="1000" height="680"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" prefix="p" section="in-portal:browse" grid="SeparateTab" title_preset="products_custom" tab_preset="Default"/>
+<inp2:m_RenderElement name="combined_header" prefix="p" section="in-portal:browse" title_preset="products_custom" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -52,15 +52,24 @@
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
+ <inp2:m_RenderElement name="ml_selector" prefix="p"/>
</tr>
</tbody>
</table>
+<inp2:p_SaveWarning name="grid_save_warning"/>
+<inp2:p_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="p" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf_PrintList render_as="cv_row_block" SourcePrefix="p" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:p_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: in-link/admin_templates/links/links_custom.tpl
===================================================================
--- in-link/admin_templates/links/links_custom.tpl (revision 14318)
+++ in-link/admin_templates/links/links_custom.tpl (working copy)
@@ -2,7 +2,7 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" prefix="l" section="in-portal:browse" grid="SeparateTab" title_preset="links_custom" tab_preset="Default"/>
+<inp2:m_RenderElement name="combined_header" prefix="l" section="in-portal:browse" title_preset="links_custom" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -50,22 +50,24 @@
</script>
</td>
- <inp2:m_if check="l_DisplayOriginal" display_original="1">
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTabOriginal"/>
- <inp2:m_else/>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
- </inp2:m_if>
+ <inp2:m_RenderElement name="ml_selector" prefix="l"/>
</tr>
</tbody>
</table>
+<inp2:l_SaveWarning name="grid_save_warning"/>
+<inp2:l_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_if check="l_DisplayOriginal" display_original="1">
- <inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="l" value_field="Value" per_page="-1" grid="SeparateTabOriginal" header_block="grid_column_title_no_sorting" no_init="no_init" original_title="la_section_OriginalValues" display_original="1"/>
-<inp2:m_else/>
- <inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="l" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
-</inp2:m_if>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf_PrintList render_as="cv_row_block" SourcePrefix="l" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:l_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: in-news/admin_templates/articles/articles_custom.tpl
===================================================================
--- in-news/admin_templates/articles/articles_custom.tpl (revision 14318)
+++ in-news/admin_templates/articles/articles_custom.tpl (working copy)
@@ -1,7 +1,7 @@
<inp2:adm_SetPopupSize width="880" height="680"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" prefix="n" section="in-portal:browse" title_preset="articles_custom" grid="SeparateTab" tab_preset="Default"/>
+<inp2:m_RenderElement name="combined_header" prefix="n" section="in-portal:browse" title_preset="articles_custom" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -49,14 +49,24 @@
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
+ <inp2:m_RenderElement name="ml_selector" prefix="n"/>
</tr>
</tbody>
</table>
+<inp2:n_SaveWarning name="grid_save_warning"/>
+<inp2:n_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="n" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf_PrintList render_as="cv_row_block" SourcePrefix="n" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:n_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
unify_multilingual_custom_field_processing_core_v2.patch [^] (16,203 bytes) 2011-04-14 12:36
[Show Content]
Index: admin_templates/categories/categories_edit_custom.tpl
===================================================================
--- admin_templates/categories/categories_edit_custom.tpl (revision 14318)
+++ admin_templates/categories/categories_edit_custom.tpl (working copy)
@@ -3,7 +3,7 @@
<inp2:m_include t="incs/header"/>
<inp2:m_include t="categories/categories_tabs"/>
-<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" title_preset="categories_custom" grid="SeparateTab" tab_preset="Default"/>
+<inp2:m_RenderElement name="combined_header" prefix="c" section="in-portal:browse" title_preset="categories_custom" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -51,23 +51,23 @@
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
+ <inp2:m_RenderElement name="ml_selector" prefix="c"/>
</tr>
</tbody>
</table>
+<inp2:c_SaveWarning name="grid_save_warning"/>
+<inp2:c_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_RenderElement
- name="grid"
- PrefixSpecial="cf"
- SourcePrefix="c"
- value_field="Value"
- IdField="CustomFieldId"
- per_page="-1"
- grid="SeparateTab"
- header_block="grid_column_title_no_sorting"
- no_init="no_init"
- />
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf.all_PrintList render_as="cv_row_block" SourcePrefix="c" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:c_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: admin_templates/incs/custom_blocks.tpl
===================================================================
--- admin_templates/incs/custom_blocks.tpl (revision 14318)
+++ admin_templates/incs/custom_blocks.tpl (working copy)
@@ -110,7 +110,15 @@
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_inc param="tab_index" by="1"/>
<td class="label-cell" onmouseover="show_form_error('<inp2:m_Param name="SourcePrefix" js_escape="1"/>', '<inp2:m_Param name="virtual_field" js_escape="1"/>')" onmouseout="hide_form_error('<inp2:m_Param name="SourcePrefix" js_escape="1"/>')">
- <inp2:m_RenderElement name="grid_data_label_ml_td" grid="$grid" SourcePrefix="$SourcePrefix" virtual_field="$virtual_field" value_field="$value_field" ElementTypeField="ElementType" field="Prompt" PrefixSpecial="$PrefixSpecial"/>
+ <span class="<inp2:m_if check='{$SourcePrefix}_HasError' field='$virtual_field'>error-cell</inp2:m_if>"><inp2:Field field="Prompt" as_label="1"/></span><inp2:m_if check="{$SourcePrefix}_IsRequired" field="$virtual_field"><span class="field-required"> *</span></inp2:m_if>:
+
+ <inp2:m_if check="FieldEquals" field="ElementType" value="textarea">
+ <br/>
+ <inp2:{$SourcePrefix}_InputName field="$virtual_field" result_to_var="input_name"/>
+ <a href="<inp2:m_Link template='popups/editor' TargetField='$input_name' pass_through='TargetField' pass='m,$SourcePrefix'/>" onclick="openSelector('<inp2:m_Param name='SourcePrefix' js_escape='1'/>', this.href, '', '800x575'); return false;">
+ <img src="img/icons/icon24_link_editor.gif" border="0">
+ </a>
+ </inp2:m_if>
</td>
<td class="control-mid"> </td>
<script type="text/javascript">
Index: admin_templates/incs/grid_blocks.tpl
===================================================================
--- admin_templates/incs/grid_blocks.tpl (revision 14318)
+++ admin_templates/incs/grid_blocks.tpl (working copy)
@@ -247,25 +247,6 @@
<inp2:Field field="$field" grid="$grid" plus_or_as_label="1" no_special="no_special" format="$format"/>
</inp2:m_DefineElement>
-<inp2:m_DefineElement name="grid_data_label_ml_td" format="">
- <span class="<inp2:m_if check="{$SourcePrefix}_HasError" field="$virtual_field">error-cell</inp2:m_if>">
- <inp2:{$PrefixSpecial}_Field field="$field" grid="$grid" as_label="1" no_special="no_special" format="$format"/>
- </span><inp2:m_if check="{$SourcePrefix}_IsRequired" field="$virtual_field"><span class="field-required"> *</span></inp2:m_if>:<br />
-
- <inp2:m_if check="FieldEquals" field="$ElementTypeField" value="textarea">
- <inp2:m_if check="Field" name="MultiLingual" equals_to="1" db="db">
- <a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>, 1);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.png" style="cursor:hand;" width="24" height="24" border="0"></a>
- <inp2:m_else/>
- <inp2:Field name="FieldName" result_to_var="custom_field"/>
- <a href="javascript:OpenEditor('§ion=in-link:editlink_general', 'kernel_form', '<inp2:{$SourcePrefix}_InputName field="cust_{$custom_field}"/>');"><img src="img/icons/icon24_link_editor.gif" style="cursor: hand;" width="24" height="24" border="0"></a>
- </inp2:m_if>
- <inp2:m_else/>
- <inp2:m_if check="Field" name="MultiLingual" equals_to="1" db="db">
- <a href="javascript:PreSaveAndOpenTranslatorCV('<inp2:m_param name="SourcePrefix"/>,<inp2:m_param name="SourcePrefix"/>-cdata', '<inp2:m_param name="SourcePrefix"/>-cdata:cust_<inp2:Field name="CustomFieldId"/>', 'popups/translator', <inp2:$SourcePrefix_Field field="ResourceId"/>);" title="<inp2:m_Phrase label="la_Translate" escape="1"/>"><img src="img/icons/icon24_translate.png" style="cursor:hand;" width="24" height="24" border="0"></a>
- </inp2:m_if>
- </inp2:m_if>
-</inp2:m_DefineElement>
-
<inp2:m_DefineElement name="grid_empty_filter">
</inp2:m_DefineElement>
Index: admin_templates/users/users_edit_custom.tpl
===================================================================
--- admin_templates/users/users_edit_custom.tpl (revision 14318)
+++ admin_templates/users/users_edit_custom.tpl (working copy)
@@ -49,23 +49,24 @@
</script>
</td>
- <inp2:m_if check="u_DisplayOriginal" display_original="1">
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTabOriginal"/>
- <inp2:m_else/>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
- </inp2:m_if>
+ <inp2:m_RenderElement name="ml_selector" prefix="u"/>
</tr>
</tbody>
</table>
+<inp2:u_SaveWarning name="grid_save_warning"/>
+<inp2:u_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_if check="u_DisplayOriginal" display_original="1">
- <inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="u" value_field="Value" per_page="-1" grid="SeparateTabOriginal" header_block="grid_column_title_no_sorting" no_init="no_init" original_title="la_section_OriginalValues" display_original="1"/>
-<inp2:m_else/>
- <inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="u" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
-</inp2:m_if>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf.all_PrintList render_as="cv_row_block" SourcePrefix="u" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:u_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: kernel/db/dbitem.php
===================================================================
--- kernel/db/dbitem.php (revision 14318)
+++ kernel/db/dbitem.php (working copy)
@@ -1512,9 +1512,11 @@
return true;
}
- $cdata_key = rtrim($this->Prefix.'-cdata.'.$this->Special, '.');
- $cdata =& $this->Application->recallObject($cdata_key, null, Array('skip_autoload' => true, 'populate_ml_fields' => true));
+ $cdata_key = rtrim($this->Prefix . '-cdata.' . $this->Special, '.');
+ $cdata =& $this->Application->recallObject($cdata_key, null, Array('skip_autoload' => true));
+ /* @var $cdata kDBItem */
+
$resource_id = $this->GetDBField('ResourceId');
$cdata->Load($resource_id, 'ResourceId');
$cdata->SetDBField('ResourceId', $resource_id);
@@ -1522,9 +1524,25 @@
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
/* @var $ml_formatter kMultiLanguage */
+ $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
+ /* @var $ml_helper kMultiLanguageHelper */
+
foreach ($this->customFields as $custom_id => $custom_name) {
- $force_primary = isset($cdata->Fields['cust_'.$custom_id]['force_primary']) && $cdata->Fields['cust_'.$custom_id]['force_primary'];
- $cdata->SetDBField($ml_formatter->LangFieldName('cust_'.$custom_id, $force_primary), $this->GetDBField('cust_'.$custom_name));
+ $field_options = $cdata->GetFieldOptions('cust_' . $custom_id);
+ $force_primary = isset($field_options['force_primary']) && $field_options['force_primary'];
+
+ if ($force_primary) {
+ $cdata->SetDBField($ml_formatter->LangFieldName('cust_' . $custom_id, true), $this->GetDBField('cust_' . $custom_name));
+ }
+ else {
+ for ($language_id = 1; $language_id <= $ml_helper->languageCount; $language_id++) {
+ if (!$ml_helper->LanguageFound($language_id)) {
+ continue;
+ }
+
+ $cdata->SetDBField('l' . $language_id . '_cust_' . $custom_id, $this->GetDBField('l' . $language_id . '_cust_' . $custom_name));
+ }
+ }
}
return $cdata->isLoaded() ? $cdata->Update() : $cdata->Create();
Index: units/custom_data/custom_data_event_handler.php
===================================================================
--- units/custom_data/custom_data_event_handler.php (revision 14318)
+++ units/custom_data/custom_data_event_handler.php (working copy)
@@ -147,8 +147,7 @@
$virtual_fields = $this->Application->getUnitOption($prefix, 'VirtualFields', Array());
$cf_helper =& $this->Application->recallObject('InpCustomFieldsHelper');
- $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
- /* @var $ml_formatter kMultiLanguage */
+ /* @var $cf_helper InpCustomFieldsHelper */
$is_install = defined('IS_INSTALL') && IS_INSTALL;
@@ -157,10 +156,12 @@
$field_options = Array('type' => 'string', 'default' => $custom_params['DefaultValue']);
// raises warnings during 4.3.9 -> 5.0.0 upgrade, no fatal sqls though
- if ($custom_params['IsRequired']) {
+ if ( $custom_params['IsRequired'] ) {
$field_options['required'] = 1;
}
+ $calculated_fields['cust_' . $custom_name] = 'cust.l' . $this->Application->GetDefaultLanguageId() .'_cust_' . $custom_id;
+
switch ($custom_params['ElementType']) {
case 'date':
unset($field_options['options']);
@@ -187,19 +188,17 @@
default:
if ($custom_params['MultiLingual']) {
- $calculated_fields['cust_'.$custom_name.'_Primary'] = 'cust.'.$ml_formatter->LangFieldName('cust_'.$custom_id, true);
- $virtual_fields['cust_'.$custom_name.'_Primary'] = $field_options;
- $field_options['master_field'] = 'cust_'.$custom_name.'_Primary';
- $field_options['formatter'] = 'kCustomFieldFormatter';
+ $field_options['formatter'] = 'kMultiLanguage';
+ $calculated_fields['cust_' . $custom_name] = 'cust.l%2$s_cust_' . $custom_id;
}
break;
}
- $calculated_fields['cust_'.$custom_name] = 'cust.'.$ml_formatter->LangFieldName('cust_'.$custom_id, !$custom_params['MultiLingual']);
- if (!isset($virtual_fields['cust_'.$custom_name])) {
- $virtual_fields['cust_'.$custom_name] = Array();
+ if ( !isset($virtual_fields['cust_' . $custom_name]) ) {
+ $virtual_fields['cust_' . $custom_name] = Array ();
}
- $virtual_fields['cust_'.$custom_name] = array_merge_recursive2($field_options, $virtual_fields['cust_'.$custom_name]);
+
+ $virtual_fields['cust_' . $custom_name] = array_merge_recursive2($field_options, $virtual_fields['cust_' . $custom_name]);
$custom_fields[$custom_id] = $custom_name;
}
Index: units/custom_fields/custom_fields_config.php
===================================================================
--- units/custom_fields/custom_fields_config.php (revision 14318)
+++ units/custom_fields/custom_fields_config.php (working copy)
@@ -158,32 +158,5 @@
// 'IsSystem' => Array ('title' => 'la_col_IsSystem', 'filter_block' => 'grid_options_filter'),
),
),
-
- 'SeparateTab' => Array (
- 'Icons' => Array (
- 'default' => 'icon16_item.png',
- ),
- 'Selector' => '',
- 'Fields' => Array (
- 'FieldName' => Array ( 'title'=>'la_col_FieldName', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
- 'Prompt' => Array ( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter', 'width' => 200, ),
- 'Value' => Array ( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter', 'width' => 200, ),
- 'Error' => Array ( 'title'=>'la_col_Error', 'data_block' => 'custom_error_td', 'filter_block' => 'grid_empty_filter', 'width' => 100, ),
- ),
- ),
-
- 'SeparateTabOriginal' => Array (
- 'Icons' => Array (
- 'default' => 'icon16_item.png',
- ),
- 'Selector' => '',
- 'Fields' => Array (
- 'FieldName' => Array ( 'title'=>'la_col_FieldName', 'data_block' => 'grid_icon_td', 'filter_block' => 'grid_like_filter'),
- 'Prompt' => Array ( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td', 'ElementTypeField' => 'ElementType', 'filter_block' => 'grid_empty_filter'),
- 'Value' => Array ( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td', 'filter_block' => 'grid_empty_filter'),
- 'OriginalValue' => Array ( 'title'=>'la_col_OriginalValue', 'data_block' => 'grid_original_td', 'filter_block' => 'grid_like_filter'),
- ),
- ),
-
),
);
\ No newline at end of file
Index: units/custom_fields/custom_fields_tag_processor.php
===================================================================
--- units/custom_fields/custom_fields_tag_processor.php (revision 14318)
+++ units/custom_fields/custom_fields_tag_processor.php (working copy)
@@ -112,14 +112,25 @@
$this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
if ($source_prefix) {
- $list->SetDBField($params['value_field'], $source_object->GetDBField('cust_'.$list->GetDBField('FieldName')));
+ $options = $source_object->GetFieldOptions('cust_'.$list->GetDBField('FieldName'));
+
+ if ( isset($options['formatter']) && $options['formatter'] == 'kMultiLanguage' ) {
+ $language_prefix = 'l' . $this->Application->GetVar('m_lang') . '_';
+ }
+ else {
+ $language_prefix = '';
+ }
+
+ $list->SetDBField($params['value_field'], $source_object->GetDBField($language_prefix . 'cust_'.$list->GetDBField('FieldName')));
+
if ($display_original) {
$list->SetDBField('OriginalValue', $original_object->GetField('cust_'.$list->GetDBField('FieldName')));
}
+
$block_params['field'] = $block_params['virtual_field'] = 'cust_'.$list->GetDBField('FieldName');
$block_params['show_heading'] = ($prev_heading != $list->GetDBField('Heading') ) ? 1 : 0;
- $options = $source_object->GetFieldOptions('cust_'.$list->GetDBField('FieldName'));
+
$list->SetDBField('DirectOptions', isset($options['options']) ? $options['options'] : false);
}
unify_multilingual_custom_field_processing_modules_v2.patch [^] (7,827 bytes) 2011-04-14 12:36
[Show Content]
Index: in-bulletin/admin_templates/topics/topics_custom.tpl
===================================================================
--- in-bulletin/admin_templates/topics/topics_custom.tpl (revision 14318)
+++ in-bulletin/admin_templates/topics/topics_custom.tpl (working copy)
@@ -1,7 +1,7 @@
<inp2:adm_SetPopupSize width="880" height="680"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" prefix="bb" section="in-portal:browse" grid="SeparateTab" title_preset="topics_custom" tab_preset="Default"/>
+<inp2:m_RenderElement name="combined_header" prefix="bb" section="in-portal:browse" title_preset="topics_custom" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -49,14 +49,24 @@
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
+ <inp2:m_RenderElement name="ml_selector" prefix="bb"/>
</tr>
</tbody>
</table>
+<inp2:bb_SaveWarning name="grid_save_warning"/>
+<inp2:bb_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="bb" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf.all_PrintList render_as="cv_row_block" SourcePrefix="bb" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:bb_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: in-commerce/admin_templates/products/products_custom.tpl
===================================================================
--- in-commerce/admin_templates/products/products_custom.tpl (revision 14318)
+++ in-commerce/admin_templates/products/products_custom.tpl (working copy)
@@ -1,7 +1,7 @@
<inp2:adm_SetPopupSize width="1000" height="680"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" prefix="p" section="in-portal:browse" grid="SeparateTab" title_preset="products_custom" tab_preset="Default"/>
+<inp2:m_RenderElement name="combined_header" prefix="p" section="in-portal:browse" title_preset="products_custom" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -52,15 +52,24 @@
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
+ <inp2:m_RenderElement name="ml_selector" prefix="p"/>
</tr>
</tbody>
</table>
+<inp2:p_SaveWarning name="grid_save_warning"/>
+<inp2:p_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="p" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf.all_PrintList render_as="cv_row_block" SourcePrefix="p" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:p_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: in-link/admin_templates/links/links_custom.tpl
===================================================================
--- in-link/admin_templates/links/links_custom.tpl (revision 14318)
+++ in-link/admin_templates/links/links_custom.tpl (working copy)
@@ -2,7 +2,7 @@
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" prefix="l" section="in-portal:browse" grid="SeparateTab" title_preset="links_custom" tab_preset="Default"/>
+<inp2:m_RenderElement name="combined_header" prefix="l" section="in-portal:browse" title_preset="links_custom" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -50,22 +50,24 @@
</script>
</td>
- <inp2:m_if check="l_DisplayOriginal" display_original="1">
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTabOriginal"/>
- <inp2:m_else/>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
- </inp2:m_if>
+ <inp2:m_RenderElement name="ml_selector" prefix="l"/>
</tr>
</tbody>
</table>
+<inp2:l_SaveWarning name="grid_save_warning"/>
+<inp2:l_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_if check="l_DisplayOriginal" display_original="1">
- <inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="l" value_field="Value" per_page="-1" grid="SeparateTabOriginal" header_block="grid_column_title_no_sorting" no_init="no_init" original_title="la_section_OriginalValues" display_original="1"/>
-<inp2:m_else/>
- <inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="l" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
-</inp2:m_if>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf.all_PrintList render_as="cv_row_block" SourcePrefix="l" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:l_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: in-news/admin_templates/articles/articles_custom.tpl
===================================================================
--- in-news/admin_templates/articles/articles_custom.tpl (revision 14318)
+++ in-news/admin_templates/articles/articles_custom.tpl (working copy)
@@ -1,7 +1,7 @@
<inp2:adm_SetPopupSize width="880" height="680"/>
<inp2:m_include t="incs/header"/>
-<inp2:m_RenderElement name="combined_header" prefix="n" section="in-portal:browse" title_preset="articles_custom" grid="SeparateTab" tab_preset="Default"/>
+<inp2:m_RenderElement name="combined_header" prefix="n" section="in-portal:browse" title_preset="articles_custom" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
@@ -49,14 +49,24 @@
</script>
</td>
- <inp2:m_RenderElement name="search_main_toolbar" prefix="cf" grid="SeparateTab"/>
+ <inp2:m_RenderElement name="ml_selector" prefix="n"/>
</tr>
</tbody>
</table>
+<inp2:n_SaveWarning name="grid_save_warning"/>
+<inp2:n_ErrorWarning name="form_error_warning"/>
+
<inp2:m_include t="incs/custom_blocks"/>
-<inp2:m_RenderElement name="grid" PrefixSpecial="cf" IdField="CustomFieldId" SourcePrefix="n" value_field="Value" per_page="-1" grid="SeparateTab" header_block="grid_column_title_no_sorting" no_init="no_init"/>
+<div id="scroll_container">
+ <table class="edit-form">
+ <inp2:cf.all_PrintList render_as="cv_row_block" SourcePrefix="n" value_field="Value" per_page="-1" grid="Default" original_title="la_section_OriginalValues" display_original="1"/>
+
+ <inp2:m_RenderElement name="inp_edit_filler"/>
+ </table>
+</div>
+
<input type="hidden" name="cf_type" value="<inp2:n_UnitOption name='ItemType'/>"/>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
|