Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1046666
D124.diff
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
Sun, Jun 29, 2:28 AM
Size
2 KB
Mime Type
text/x-diff
Expires
Mon, Jun 30, 2:28 AM (10 h, 8 m)
Engine
blob
Format
Raw Data
Handle
676679
Attached To
D124: INP-1473 - Add "edit_field" parameter to "AdminEditButton" tag
D124.diff
View Options
Index: branches/5.3.x/core/admin_templates/incs/footer.tpl
===================================================================
--- branches/5.3.x/core/admin_templates/incs/footer.tpl
+++ branches/5.3.x/core/admin_templates/incs/footer.tpl
@@ -55,5 +55,24 @@
</inp2:m_ifnot>
<div id="nlsMenuPlace"></div>
+
+<inp2:m_if check="m_Get" name="edit_field">
+ <script type="text/javascript">
+ <inp2:m_if check="adm_UsePopups">
+ Application.setHook('m:OnAfterFormInit', function () {
+ var $row = get_control('<inp2:adm_PassedPrefixTag tag="InputName" name="#FIELD_NAME#" js_escape="1"/>', '<inp2:m_Get name="edit_field" js_escape="1"/>', 'row');
+
+ $('#scroll_container_container').scrollTop($($row).offset().top - $('#scroll_container_container').offset().top);
+ });
+ <inp2:m_else/>
+ $(document).ready(function () {
+ var $row = get_control('<inp2:adm_PassedPrefixTag tag="InputName" name="#FIELD_NAME#" js_escape="1"/>', '<inp2:m_Get name="edit_field" js_escape="1"/>', 'row');
+
+ $(getFrame('main').document).scrollTop($($row).offset().top);
+ });
+ </inp2:m_if>
+ </script>
+</inp2:m_if>
+
</body>
-</html>
\ No newline at end of file
+</html>
Index: branches/5.3.x/core/kernel/db/db_event_handler.php
===================================================================
--- branches/5.3.x/core/kernel/db/db_event_handler.php
+++ branches/5.3.x/core/kernel/db/db_event_handler.php
@@ -1829,10 +1829,14 @@
$event->SetRedirectParam($event->getPrefixSpecial() . '_id', array_shift($ids));
$event->SetRedirectParam('pass', 'all,' . $event->getPrefixSpecial());
- $simultaneous_edit_message = $this->Application->GetVar('_simultaneous_edit_message');
+ $pass_through = array('_simultaneous_edit_message', 'edit_field');
- if ( $simultaneous_edit_message ) {
- $event->SetRedirectParam('_simultaneous_edit_message', $simultaneous_edit_message);
+ foreach ( $pass_through as $name ) {
+ $value = $this->Application->GetVar($name);
+
+ if ( strlen($value) ) {
+ $event->SetRedirectParam($name, $value);
+ }
}
}
Index: branches/5.3.x/core/units/admin/admin_tag_processor.php
===================================================================
--- branches/5.3.x/core/units/admin/admin_tag_processor.php
+++ branches/5.3.x/core/units/admin/admin_tag_processor.php
@@ -1224,4 +1224,22 @@
return $this->Application->ParseBlock($block_params);
}
+
+ /**
+ * Processes tag of passed prefix
+ *
+ * @param array $params Tag params.
+ *
+ * @return string
+ */
+ protected function PassedPrefixTag(array $params)
+ {
+ $passed_prefixes = explode(',', $this->Application->GetVar('passed'));
+ $last_prefix = array_pop($passed_prefixes);
+ $tag = $params['tag'];
+ unset($params['tag']);
+
+ return $this->Application->ProcessParsedTag($last_prefix, $tag, $params);
+ }
+
}
Event Timeline
Log In to Comment