Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F804092
D124.id517.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
Wed, Feb 26, 9:06 AM
Size
3 KB
Mime Type
text/x-diff
Expires
Thu, Feb 27, 9:06 AM (1 h, 14 m)
Engine
blob
Format
Raw Data
Handle
576806
Attached To
D124: INP-1473 - Add "edit_field" parameter to "AdminEditButton" tag
D124.id517.diff
View Options
Index: core/admin_templates/incs/footer.tpl
===================================================================
--- core/admin_templates/incs/footer.tpl
+++ core/admin_templates/incs/footer.tpl
@@ -56,4 +56,22 @@
<div id="nlsMenuPlace"></div>
</body>
-</html>
\ No newline at end of file
+</html>
+
+<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>
Index: core/kernel/db/db_event_handler.php
===================================================================
--- core/kernel/db/db_event_handler.php
+++ core/kernel/db/db_event_handler.php
@@ -1811,10 +1811,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: core/units/admin/admin_tag_processor.php
===================================================================
--- core/units/admin/admin_tag_processor.php
+++ core/units/admin/admin_tag_processor.php
@@ -1219,4 +1219,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);
+ }
+
}
Index: themes/advanced/in-link/elements/links.elm.tpl
===================================================================
--- themes/advanced/in-link/elements/links.elm.tpl
+++ themes/advanced/in-link/elements/links.elm.tpl
@@ -241,4 +241,4 @@
</table>
</td>
</inp2:m_DefineElement>
-<!--## / SEARCH LINK ELEMENT ##-->
\ No newline at end of file
+<!--## / SEARCH LINK ELEMENT ##-->
Event Timeline
Log In to Comment