Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F800517
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Feb 22, 12:08 AM
Size
27 KB
Mime Type
text/x-diff
Expires
Mon, Feb 24, 12:08 AM (2 h, 14 m)
Engine
blob
Format
Raw Data
Handle
573764
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/5.2.x/core/admin_templates/js/forms.js
===================================================================
--- branches/5.2.x/core/admin_templates/js/forms.js (revision 16569)
+++ branches/5.2.x/core/admin_templates/js/forms.js (revision 16570)
@@ -1,427 +1,429 @@
var last_shown_error = false;
var errors = {};
var first_error = {};
var fields = {};
function show_form_error(prefix, field, sticky) {
if ( isset(errors[prefix]) && isset(errors[prefix][field]) ) {
span = document.getElementById('error_msg_' + prefix);
span.innerHTML = fields[prefix][field] + ' - ' + errors[prefix][field];
if ( sticky ) {
last_shown_error = field;
}
}
}
function hide_form_error(prefix) {
span = document.getElementById('error_msg_' + prefix);
if ( !span ) {
return;
}
span.innerHTML = '<br/>';
if ( typeof(last_shown_error) != 'undefined' && last_shown_error ) {
show_form_error(prefix, last_shown_error);
}
}
function add_form_error(prefix, field, element, error_msg, block_name) {
if ( error_msg == '' ) {
// no error message - do nothing
return;
}
if ( typeof(errors[prefix]) == 'undefined' ) {
errors[prefix] = {};
}
errors[prefix][field] = error_msg;
var $input_fields = $('#' + jq(element));
switch (block_name) {
case 'inp_edit_timezone':
$input_fields = $input_fields.add('#timezone_group');
break;
case 'cf:datetime':
case 'inp_edit_date_time':
$input_fields = $input_fields.add('#' + jq(element.replace(field, field + '_date')));
$input_fields = $input_fields.add('#' + jq(element.replace(field, field + '_time')));
break;
case 'inp_edit_combo_target':
$input_fields = $input_fields.add('#' + jq(element.replace(field, field + 'Type')));
break;
case 'cf:multiselect':
case 'inp_edit_multioptions':
$input_fields = $('#' + jq(element) + '_select');
break;
case 'cf:checkbox':
case 'inp_edit_checkbox':
$input_fields = $('#_cb_' + jq(element));
break;
case 'cf:radio':
case 'inp_edit_radio':
case 'inp_edit_checkboxes':
$input_fields = $("input[id^='" + jq(element) + "_']");
break;
case 'inp_edit_weight':
$input_fields = $input_fields.add('#' + jq(element.replace(field, field + '_a')));
$input_fields = $input_fields.add('#' + jq(element.replace(field, field + '_b')));
break;
case 'inp_edit_picker':
$input_fields = $('#' + jq(element) + '_selected');
break;
case 'inp_edit_cron_box':
$input_fields = $input_fields.add('#' + jq(element.replace(field, field + 'Hints')));
break;
}
if ( $input_fields.length > 0 ) {
// some controls don't have element to focus on (e.g. swf uploader)
$input_fields.focus(function ($e) {
show_form_error(prefix, field, true);
});
$input_fields.blur(function ($e) {
last_shown_error = false;
});
}
/*else {
console.log('error: focusing failed for [', prefix, '.', field, '] = ', element);
}*/
if ( typeof(first_error[prefix]) == 'undefined' || first_error[prefix] == false ) {
first_error[prefix] = [field, element];
}
}
function FCKeditor_OnComplete( editor )
{
Form.Resize();
}
function InitEditors() {
if ( !$.isEmptyObject($CKEditors) ) {
// process all CKEditor instances
CKEDITOR.on(
'instanceReady',
function( ev ) {
FCKeditor_OnComplete( CKEDITOR.instances[ ev.editor.name ] );
}
);
ckeditors_apply_typekit();
for (var $editor_id in $CKEditors) {
CKEDITOR.replace($editor_id, $CKEditors[$editor_id]);
}
}
// process all CodePress instances
if ($.isFunction(window.CodePress)) {
CodePress.run(/*FCKeditor_OnComplete*/);
}
}
function Form() {}
Form = new Form();
Form.Controls = new Array();
Form.Div = false;
Form.MinControlsHeight = 0;
Form.Options = new Object();
Form.FlexibleCount = 0;
Form.ScrollerW = 17;
Form.ScrollerH = 17;
Form.HasChanged = false;
Form.Init = function(id) {
this.Div = document.getElementById(id);
if (!this.Div) {
return ;
}
for (var i = 0; i < this.Controls.length; i++) {
dim = getDimensions( document.getElementById(this.Controls[i]) );
options = this.Options[this.Controls[i]];
if (options.height) { // fixed height
options.min_height = options.height;
options.max_height = options.height;
}
if (!options.min_height) {
options.min_height = $( jq('#' + this.Controls[i]) ).outerHeight(); // dim.innerHeight
}
// if ( $( jq('#' + this.Controls[i]) ).parents('tr:first').is(':visible') ) {
this.MinControlsHeight += options.min_height;
// }
if (dim.innerHeight < options.min_height) {
document.getElementById(this.Controls[i]).style.height = options.min_height+'px';
}
// alert('adding element '+this.Controls[i]+' height: '+options.min_height+' total: '+this.MinControlsHeight)
}
// all <script> tags will be executed again after wrap method is called, so remove them to prevent that
$('script', this.Div).remove();
$(this.Div).wrap('<div id="' + this.Div.id + '_container" style="position: relative; overflow: auto; width: 100%;"></div>');
Application.removeDebuggerStatistics();
this.Table = $('table:first', this.Div).get(0);
this.Table.style.height = 'auto';
// this.Table.style.width = 'auto';
this.MinHeight = this.Table.offsetHeight;
this.MinWidth = this.Table.offsetWidth;
// alert('Measuring min width now')
addEvent(window, 'resize', function() {Form.Resize()})
this.Resize(false);
this.displayFirstError();
if (_Simultaneous_Edit_Message != '') {
alert(_Simultaneous_Edit_Message);
}
this.InitOnChange();
Application.processHooks('m:OnAfterFormInit');
InitEditors();
};
Form.displayFirstError = function () {
if (isset(first_error)) {
for (var i in first_error) {
if (first_error[i] != false) {
if (document.getElementById(first_error[i][1])) {
// some controls don't have element to focus on (e.g. swf uploader)
document.getElementById(first_error[i][1]).focus();
}
show_form_error(i, first_error[i][0], true);
// alert('focused on '+first_error[i][1])
}
}
}
};
Form.InitOnChange = function()
{
var inputs = window.document.getElementsByTagName('INPUT');
var selects = window.document.getElementsByTagName('SELECT');
var textareas = window.document.getElementsByTagName('TEXTAREA');
var groups = [inputs, selects, textareas];
for (var g=0; g<groups.length; g++) {
for (var i=0; i<groups[g].length; i++) {
var elem = groups[g][i];
if (elem.tagName == 'INPUT' && elem.type == 'hidden') continue;
addEvent(elem, elem.type=='button' ? 'click' : 'change', function() {Form.Changed()});
}
}
};
Form.Changed = function()
{
this.HasChanged = true;
};
Form.addControl = function(id, options) {
this.Controls.push(id);
if (!options) {
options = {coeff: 1, max_height: 0, min_height: 0};
}
else {
if (typeof(options['coeff']) == 'undefined') options['coeff'] = 1;
if (typeof(options['max_height']) == 'undefined') options['max_height'] = 0;
if (typeof(options['min_height']) == 'undefined') options['min_height'] = 0;
}
options['real_height'] = 0;
this.Options[id] = options; // for future use
// print_pre(this.Options[id]);
};
Form._parseSize = function ($size) {
if ($size.toString().match(/^([\d]+)px$/)) {
return parseInt(RegExp.$1);
}
return parseInt($size);
};
Form.Resize = function($init_done) {
if (!this.Div) {
return ;
}
if ( ($init_done === true || $init_done === undefined) && !$.isEmptyObject($CKEditors) ) {
// process all CKEditor instances
for (var $editor_id in $CKEditors) {
var $ckeditor_textarea = $( '#' + jq($editor_id) );
CKEDITOR.instances[ $editor_id ].resize( $ckeditor_textarea.width(), $ckeditor_textarea.height() );
}
}
var h = (document.all ? window.document.body.offsetHeight : window.innerHeight);
var $div = $(this.Div);
var pos = $div.offset();
h -= pos.top;
if (this.Div.style.height.length) {
// height set for scroll_container overrides automatic container height detection
h = this._parseSize(this.Div.style.height);
}
if ($div.attr('mode') == 'minimal') {
// height will become minimal required (when data height is smaller, then window)
h = this.MinHeight;
}
h -= ($div.outerHeight() - $div.height());
// alert('h after correction is '+h);
- /*
- // use this 2 lines, instead of next 3 lines, when scrolling without popups needed
- var w = $(window.document.body).outerWidth(false);
- w -= ($div.outerWidth() - $div.width());*/
+ if ( use_popups() && window.name.match(/[\d]+$/) ) {
+ window.document.body.style.width = '100%';
+ var w = (document.all ? window.document.body.offsetWidth : window.innerWidth);
- window.document.body.style.width = '100%';
- var w = (document.all ? window.document.body.offsetWidth : window.innerWidth);
+ w -= pos.left + ($div.outerWidth() - $div.width());
+ }
+ else {
+ var w = $(window.document.body).outerWidth(false);
- w -= pos.left + ($div.outerWidth() - $div.width());
+ w -= ($div.outerWidth() - $div.width());
+ }
scroller_height = this.MinWidth > w ? this.ScrollerH : 0; // width of 1st table in scroll_container is larger, then window width?
scroller_width = this.MinHeight > h - scroller_height ? this.ScrollerW : 0; // table height > total height - scroller_height -> vertical scroller is found
scroller_height = this.MinWidth > w - scroller_width ? this.ScrollerH : 0; // table width > total width - scroller_width -> horizontal scroller is found
var st = document.getElementById('width_status');
if (st) st.innerHTML = 'minWdith: '+this.MinWidth+' minHeight: '+this.MinHeight+' w: '+w+' h: '+h+' scroll_w: '+scroller_width+' scroll_h: '+scroller_height;
// alert('scroller W x H = '+scroller_width+' x '+scroller_height);
// alert('resize: '+w+'x'+h)
this.Table.style.width = (w-scroller_width) + 'px';
this.Div.parentNode.style.width = w + 'px';
this.Div.style.width = (w-scroller_width) + 'px';
this.Div.parentNode.style.height = h + 'px';
var count = this.Controls.length;
// -count here is adjustment - 1px for each control
var split = h /*- (count * 2)*/ - this.MinHeight + this.MinControlsHeight;
if (split < this.MinControlsHeight) {
split = this.MinControlsHeight;
}
this.ResetHeights();
var used = this.SetMinHeights();
split -= used;
var cur_diff = 0;
var iterations = 0;
do {
var prev_diff = cur_diff;
var cur_diff = this.SplitExtra(split);
split = cur_diff;
iterations++;
} while (cur_diff != 0 && cur_diff != prev_diff && iterations < 10);
for (var i = 0; i < this.Controls.length; i++) {
document.getElementById(this.Controls[i]).style.height = this.Options[ this.Controls[i] ]['real_height'] + 'px';
// document.getElementById(this.Controls[i]).value = this.Options[this.Controls[i]]['real_height'];
}
// alert('h is: '+h+' min height is '+this.MinHeight+' MinControlsHeight is '+this.MinControlsHeight+' -> '+split+' to split between '+count);
// print_pre(this.Controls)
};
Form.ResetHeights = function()
{
for (var i = 0; i < this.Controls.length; i++) {
var options = this.Options[this.Controls[i]]
options['real_height'] = 0;
options.fixed = false;
}
this.FlexibleCount = this.Controls.length;
};
// Enlarge heights when possible
// Return any not split pixels number
Form.SplitExtra = function(split) {
var number = 0;
for (var i = 0; i < this.Controls.length; i++) {
var options = this.Options[ this.Controls[i] ];
if (options['max_height'] == 0 || options['real_height'] < options.max_height) {
number++;
}
}
if (number == 0) {
return 0;
}
var delta = Math.floor(split / number);
// alert('splitting '+split+' between '+number+' delta is '+delta)
var added = 0;
for (var i = 0; i < this.Controls.length; i++) {
var options = this.Options[this.Controls[i]];
var to_add;
if (options['max_height'] != 0 && options['real_height'] + delta > options['max_height']) {
to_add = options['max_height'] - options['real_height'];
}
else {
to_add = delta;
}
// alert('delta: '+delta+' current real: '+options['real_height']+' min: '+options['min_height']+' max:'+options['max_height']+' to_add: '+to_add)
options['real_height'] = options['real_height'] + to_add;
added += to_add;
}
// alert('added total '+added)
// removing extra added from the last (any) control
if (added > split) {
extra = added - split;
options['real_height'] -= extra;
added -= extra;
}
return split - added;
};
Form.SetMinHeights = function()
{
var used = 0;
for (var i = 0; i < this.Controls.length; i++) {
var options = this.Options[this.Controls[i]]
if (options['real_height'] < options['min_height']) {
options['real_height'] = options.min_height;
used += options.min_height;
}
}
return used;
-};
\ No newline at end of file
+};
Index: branches/5.2.x/core/admin_templates/incs/footer.tpl
===================================================================
--- branches/5.2.x/core/admin_templates/incs/footer.tpl (revision 16569)
+++ branches/5.2.x/core/admin_templates/incs/footer.tpl (revision 16570)
@@ -1,59 +1,42 @@
<script type="text/javascript">
var _Simultaneous_Edit_Message = '<inp2:m_Get var="_simultaneous_edit_message" js_escape="1"/>';
- <inp2:m_if check="adm_UsePopups">
- var o = '';
- var el = document.getElementById('scroll_container');
- if (el) {
- document.body.style.height = '100%';
- document.body.style.overflow = 'hidden';
- document.body.scroll = 'no'
-
- addLoadEvent(
- function() {
- Form.Init('scroll_container');
- }
- );
- }
-
- <inp2:m_ifnot check="m_Get" name="m_wid" equals_to="">
- // for popups only; TODO: find a way, how to identify editing popups, not selectors
- var _DropTempUrl = '<inp2:m_t pass="m,adm" adm_event="OnDropTempTablesByWID" no_amp="1" js_escape="1"/>';
- </inp2:m_ifnot>
+ var o = '';
+ var el = document.getElementById('scroll_container');
+ if (el) {
+ document.body.style.height = '100%';
+ document.body.style.overflow = 'hidden';
+ document.body.scroll = 'no';
- Application.footerInit();
- <inp2:m_else/>
addLoadEvent(
function() {
- Form.displayFirstError();
- IterateUploaders('renderBrowseButton');
+ Form.Init('scroll_container');
}
);
+ }
- InitEditors();
- </inp2:m_if>
+ <inp2:m_ifnot check="m_Get" name="m_wid" equals_to="">
+ // for popups only; TODO: find a way, how to identify editing popups, not selectors
+ var _DropTempUrl = '<inp2:m_t pass="m,adm" adm_event="OnDropTempTablesByWID" no_amp="1" js_escape="1"/>';
+ </inp2:m_ifnot>
+
+ Application.footerInit();
<inp2:m_if check="m_Get" name="_temp_table_message">
addLoadEvent(
function() {
alert('<inp2:m_Get name="_temp_table_message" js_escape="1"/>');
}
);
</inp2:m_if>
</script>
-<inp2:m_ifnot check="adm_UsePopups">
- <inp2:m_ifnot check="m_Get" name="t" equals_to="head|tree">
- <br /><br />
- </inp2:m_ifnot>
-</inp2:m_ifnot>
-
<inp2:adm_AfterScript/>
<inp2:m_ifnot check="m_Param" name="noform" equals_to="yes">
<inp2:m_RenderElement name="kernel_form_end"/>
</inp2:m_ifnot>
<div id="nlsMenuPlace"></div>
</body>
-</html>
\ No newline at end of file
+</html>
Index: branches/5.2.x/core/admin_templates/config/config_search.tpl
===================================================================
--- branches/5.2.x/core/admin_templates/config/config_search.tpl (revision 16569)
+++ branches/5.2.x/core/admin_templates/config/config_search.tpl (revision 16570)
@@ -1,142 +1,144 @@
<inp2:m_include t="incs/header"/>
<inp2:m_Get name="section" no_html_escape="1" result_to_var="section"/>
<inp2:m_RenderElement name="combined_header" prefix="confs" section="$section" perm_event="confs:OnLoad" title_preset="config_list_search"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
var a_toolbar = new ToolBar();
<inp2:m_if check="m_IsDebugMode">
a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_NewSearchConfig" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>', function() {
std_new_item('confs', 'config/config_search_edit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
</inp2:m_if>
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('confs','<inp2:confs_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('confs','OnCancel');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_DefineElement name="confs_checkbox_td">
<td valign="top" class="text">
<inp2:m_if check="m_ParamEquals" name="nolabel" value="true">
<inp2:m_else />
<label for="_cb_<inp2:InputName field="$Field"/>"><inp2:m_Phrase label="$Label" /></label>
</inp2:m_if>
<input type="checkbox" name="_cb_<inp2:InputName field="$Field"/>" <inp2:Field field="$Field" checked="checked" db="db"/> id="_cb_<inp2:InputName field="$Field"/>" onclick="update_checkbox(this, document.getElementById('<inp2:InputName field="$Field"/>'))" >
<input type="hidden" id="<inp2:InputName field="$Field"/>" name="<inp2:InputName field="$Field"/>" value="<inp2:Field field="$Field" db="db"/>">
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="confs_edit_text">
<td valign="top" class="text">
<label for="<inp2:InputName field="$Field"/>"><inp2:m_Phrase label="$Label" /></label>
<input type="text" name="<inp2:InputName field="$Field"/>" value="<inp2:Field field="$Field"/>" size="3" />
</td>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="confs_detail_row">
<inp2:m_if check="m_ParamEquals" name="show_heading" value="1">
<tr class="subsectiontitle">
<td colspan="4">
<inp2:Field name="ConfigHeader" as_label="1"/>
</td>
</tr>
</inp2:m_if>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td class="text">
<inp2:Field field="DisplayName" as_label="true" />
<inp2:m_if check="m_IsDebugMode">
<br /><small style="color: grey;">[ID: <b><inp2:Field name="SearchConfigId"/></b>; DisplayOrder: <b><inp2:Field name="DisplayOrder"/></b>; Field: <b><inp2:Field name="FieldName"/></b>]</small>
</inp2:m_if>
</td>
<inp2:m_if check="Field" name="FieldType" equals_to="text|range|select|multiselect" db="db">
<inp2:m_RenderElement name="confs_checkbox_td" pass_params="true" IdField="SearchConfigId" Label="la_prompt_SimpleSearch" Field="SimpleSearch" />
<inp2:m_else/>
<td class="text">
</td>
</inp2:m_if>
<inp2:m_RenderElement name="confs_edit_text" pass_params="true" IdField="SearchConfigId" Label="la_prompt_weight" Field="Priority" />
<inp2:m_RenderElement name="confs_checkbox_td" pass_params="true" IdField="SearchConfigId" Label="la_prompt_AdvancedSearch" Field="AdvancedSearch" />
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_values">
<tr class="subsectiontitle">
<td colspan="4">
<inp2:m_phrase name="$module_item" /> <inp2:m_phrase name="la_prompt_relevence_settings" />
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td colspan="4">
<inp2:m_phrase name="la_prompt_required_field_increase"/>
<input type="text" size="3" name="conf[<inp2:conf_GetVariableID name="SearchRel_Increase_{$module_key}"/>][VariableValue]" VALUE="<inp2:Field field="SearchRel_Increase_{$module_key}" />">%
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td colspan="4">
<inp2:m_phrase name="la_prompt_relevence_percent"/>
<input type="text" size="3" name="conf[<inp2:conf_GetVariableID name="SearchRel_Keyword_{$module_key}"/>][VariableValue]" value="<inp2:Field field="SearchRel_Keyword_{$module_key}" />">% <inp2:Field field="SearchRel_Keyword_{$module_key}_prompt" as_label="1" />
<input type="text" size="3" name="conf[<inp2:conf_GetVariableID name="SearchRel_Pop_{$module_key}"/>][VariableValue]" value="<inp2:Field field="SearchRel_Pop_{$module_key}" />">% <inp2:Field field="SearchRel_Pop_{$module_key}_prompt" as_label="1" />
<input type="text" size="3" name="conf[<inp2:conf_GetVariableID name="SearchRel_Rating_{$module_key}"/>][VariableValue]" value="<inp2:Field field="SearchRel_Rating_{$module_key}" />">% <inp2:Field field="SearchRel_Rating_{$module_key}_prompt" as_label="1" />
</td>
</tr>
<inp2:m_if check="m_GetEquals" name="module" value="In-Portal" inverse="inverse">
<tr class="subsectiontitle">
<td colspan="4">
<inp2:m_phrase name="$module_item" /> <inp2:m_phrase name="la_prompt_multipleshow" />
</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td class="text" width="120"><inp2:Field field="Search_ShowMultiple_{$module_key}_prompt" as_label="1"/></td>
<td class="text" colspan="3">
<input type="checkbox" name="_cb_conf[<inp2:conf_GetVariableID name="Search_ShowMultiple_{$module_key}"/>][VariableValue]" <inp2:Field field="Search_ShowMultiple_{$module_key}" checked="checked" db="db"/> id="_cb_conf[<inp2:conf_GetVariableID name="Search_ShowMultiple_{$module_key}"/>][VariableValue]" onclick="update_checkbox(this, document.getElementById('conf[<inp2:conf_GetVariableID name="Search_ShowMultiple_{$module_key}"/>][VariableValue]'))" >
<input type="hidden" id="conf[<inp2:conf_GetVariableID name="Search_ShowMultiple_{$module_key}"/>][VariableValue]" name="conf[<inp2:conf_GetVariableID name="Search_ShowMultiple_{$module_key}"/>][VariableValue]" value="<inp2:Field field="Search_ShowMultiple_{$module_key}" db="db"/>">
</td>
</tr>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_include t="incs/config_blocks"/>
<inp2:m_RenderElement name="config_updated_notice"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered"<inp2:m_if check="conf_ShowRelevance"> style="border-bottom-width: 0px;"</inp2:m_if>>
- <inp2:confs_PrintList render_as="confs_detail_row" />
-</table>
-
-<inp2:m_if check="conf_ShowRelevance">
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
- <inp2:conf_PrintConfList block="config_values" per_page="-1"/>
-</table>
-</inp2:m_if>
+<div id="scroll_container">
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered"<inp2:m_if check="conf_ShowRelevance"> style="border-bottom-width: 0px;"</inp2:m_if>>
+ <inp2:confs_PrintList render_as="confs_detail_row" />
+ </table>
+
+ <inp2:m_if check="conf_ShowRelevance">
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered">
+ <inp2:conf_PrintConfList block="config_values" per_page="-1"/>
+ </table>
+ </inp2:m_if>
+</div>
<inp2:m_include t="incs/footer"/>
Index: branches/5.2.x/core/admin_templates/config/config_universal.tpl
===================================================================
--- branches/5.2.x/core/admin_templates/config/config_universal.tpl (revision 16569)
+++ branches/5.2.x/core/admin_templates/config/config_universal.tpl (revision 16570)
@@ -1,151 +1,153 @@
<inp2:m_include t="incs/header"/>
<inp2:conf_InitList per_page="-1"/>
<inp2:m_Get name="section" no_html_escape="1" result_to_var="section"/>
<inp2:m_RenderElement name="combined_header" prefix="conf" section="$section" title_preset="section_label" perm_event="conf:OnLoad"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function validate_password_fields() {
var $validated = true;
$("input[primarytype='password']", '#' + $form_name).each(
function ($e) {
if ( !validate_password_field(this.id) ) {
$validated = false;
}
}
);
return $validated;
}
function validate_password_field($field_id) {
var password_field = document.getElementById($field_id),
password_verify_field = document.getElementById('verify_' + $field_id);
if ( password_field && password_verify_field && password_field.value == password_verify_field.value ) {
return true;
}
else {
var password_error_cell = document.getElementById('error_' + $field_id);
if ( password_error_cell ) {
$(window).scrollTop($(password_field).position().top - 15);
password_error_cell.innerHTML = '<inp2:m_Phrase name="la_error_PasswordMatch"/>';
}
return false;
}
}
function toggle_section($label) {
var $row = null,
$is_visible = false,
$table = document.getElementById('config_table');
for (var $i = 0; $i < $table.rows.length; $i++) {
$row = $table.rows[$i];
if ( $row.getAttribute('header_label') != $label ) {
continue;
}
if ( !$row.style.display ) {
$row.style.display = document.all ? 'block' : 'table-row';
}
$is_visible = !($row.style.display == 'none');
$row.style.display = $is_visible ? 'none' : (document.all ? 'block' : 'table-row');
document.getElementById('toggle_mark[' + $label + ']').innerHTML = '[' + ($is_visible ? '+' : '-') + ']';
}
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton(
new ToolBarButton(
'select',
'<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>',
function () {
submit_event('conf', '<inp2:conf_SaveEvent/>');
}
)
);
a_toolbar.AddButton(
new ToolBarButton(
'cancel',
'<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>',
function () {
submit_event('conf', 'OnCancel');
}
)
);
<inp2:m_if check="m_IsDebugMode">
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton(
new ToolBarButton(
'new_item',
'<inp2:m_phrase label="la_ToolTip_NewSystemSetting" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
std_precreate_item('conf', 'config/config_edit');
}
)
);
</inp2:m_if>
<inp2:m_ModuleInclude template = "config/custom_toolbar"/>
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_include t="incs/config_blocks"/>
<inp2:m_RenderElement name="config_updated_notice"/>
<inp2:conf_SaveWarning name="grid_save_warning"/>
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
- <inp2:conf_PrintList list_name="default" block="config_block" full_block="config_block" half_block1="config_block1" half_block2="config_block2" value_render_as="cf_default_value"/>
-</table>
+<div id="scroll_container">
+ <table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
+ <inp2:conf_PrintList list_name="default" block="config_block" full_block="config_block" half_block1="config_block1" half_block2="config_block2" value_render_as="cf_default_value"/>
+ </table>
+</div>
<script type="text/javascript">
<inp2:m_if check="m_Get" name="refresh_tree">
getFrame('menu').location.reload();
</inp2:m_if>
<inp2:m_if check="m_Get" name="refresh_all">
var $menu_frame = getFrame('menu');
$menu_frame.parent.location.href = $menu_frame.parent.location.href;
</inp2:m_if>
Application.setHook(
'conf:*',
function ($event) {
$event.status = $event.Name == 'OnCancel' ? true : validate_password_fields();
}
);
<inp2:m_if check="m_Get" name="first_error">
$(document).ready(function () {
var $error_cell = $('.field-<inp2:m_Get name="first_error"/>.error');
if ( $error_cell.length ) {
$(window).scrollTop($error_cell.position().top - 15);
}
});
</inp2:m_if>
</script>
<inp2:m_include t="incs/footer"/>
Event Timeline
Log In to Comment