Added ability to specify field name (that is present on editing template) that needs to be in focus when editing template opens.
Details
Preparations
- go to Admin Console
- go to Website & Content & Structure & Data → Directory section
- click on Sections tab
- create Sub Directory category in it using New Section button on toolbar
- go to Website & Content & Structure & Data → Directory → Sub Directory section
- click on Links tab
- add a link using New Link button on toolbar
- make following changes in IDE in advanced theme templates:
- add edit_field="FormSubmittedTemplate" attribute to <inp2:st_EditPage mode="start" item_prefix="$item_prefix"/> tag in platform/designs/default_design.des.tpl template
- add edit_field="Url" attribute to <inp2:AdminEditButton/> tag in in-link/elements/links.elm.tpl template
Test Plan
- go to Admin Console
- select Same Window value for Editing Window Style variable in Configuration → Website → Advanced section
- go to Website & Content → Browse Website section
- click on Content Mode button in top frame
- click on the green Section Properties button in the right corner
- confirm that edit window, that opens is scrolled automatically to Online Form Submitted Template field
- go to Website & Content → Browse Website section
- click on Content Mode button in top frame
- use top menu to go to Directory → Sub Directory section
- confirm, that link created before is shown in there
- click on green Edit Item button next to that link
- confirm that editing window was opened and was automatically scrolled to URL field
Diff Detail
- Repository
- rINP In-Portal
- Branch
- /in-portal/branches/5.3.x
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 138 Build 138: arc lint + arc unit
Event Timeline
core/admin_templates/incs/footer.tpl | ||
---|---|---|
60–77 | Move all this code at the end of form_error_warning block definition. The prefix block parameter available in form_error_warning block would allow to universally identify edited unit. | |
63 | Please replace with: var $row = get_control('<inp2:$prefix_InputName name="#FIELD_NAME#" js_escape="1"/>', '<inp2:m_Get name="edit_field"/>', 'row'); See comment related to PassedPrefixTag declaration. | |
63–65 | Element query code & IF statement needs to be placed inside hook code. The m:OnAfterFormInit hook is called after Form class wraps elements in <div id="scroll_container"> DIV in another DIV used for scrolling. Nature of wrapping operation is performing copy/paste of elements in that DIV and reference to DOM element stored in $row variable would point to different element at that point. | |
72 |
| |
core/kernel/db/db_event_handler.php | ||
1819 | Please replace with: if ( strlen($value) ) { The 0 in $value variable won't result in parameter being passed in upcoming redirect. Right now it won't create any problem, but if in the future more $pass_through variables would be used, then this won't create problems for them. | |
core/units/admin/admin_tag_processor.php | ||
1222–1237 | Please delete this. The prefix guessing logic doesn't cover the case, when there are multiple prefixes in url and one, that is used on the form isn't last passed. |
core/admin_templates/incs/footer.tpl | ||
---|---|---|
72 | scrollTop on the document object not always working - this solution is not cross-browser. |
core/admin_templates/incs/footer.tpl | ||
---|---|---|
72 | Can you please be more specific about browsers, where this doesn't work? On both Chrome and Firefox I did this:
window.frames['main'].$(window.frames['main'].document).scrollTop(10);
|
core/admin_templates/incs/footer.tpl | ||
---|---|---|
72 | Yes, it works. Seems, i used some wrong approach when trying scrollTop. I do not remember what code was tried before scrollBy solution. |
core/admin_templates/incs/footer.tpl | ||
---|---|---|
60–77 | After discussing over Skype decided not to do this, because the form_error_warning block is only shown when there is an error on the form. | |
63 | Decided not to do this. | |
63–65 | It appears, that this change wasn't done in 377 diff. | |
72 | It appears, that this change wasn't done in 377 diff. | |
core/kernel/db/db_event_handler.php | ||
1819 | It appears, that this change wasn't done in 377 diff. | |
core/units/admin/admin_tag_processor.php | ||
1222–1237 | Decided not to do this. Please update test plan to confirm, that it works for non-categories (e.g. products) as well. |
I've enhanced test plan with more details and tested that all works according to plan.
Please make these minor changes please.
core/admin_templates/incs/footer.tpl | ||
---|---|---|
65 | Please also add js_escape="1" to the m_Get tag call. | |
71 | Please also add js_escape="1" to the m_Get tag call. | |
core/units/admin/admin_tag_processor.php | ||
1232–1233 |
$passed_prefixes = explode(',', $this->Application->GetVar('passed')); $last_prefix = array_pop($passed_prefixes);
| |
1235 | Remove tag parameter from $params array before calling tag from $params['tag']. The tag parameter is passed to called tag, but that tag doesn't know what to do with it. |
core/admin_templates/incs/footer.tpl | ||
---|---|---|
60–77 | Please move JavaScript code block up in the DOM tree to be last node inside <body> tag. Having JavaScript code after </html> tag isn't guaranteed to work in all Web Browsers. |