Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH move private method to framework #1730

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions code/LeftAndMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -1529,20 +1529,6 @@ public function getEditForm($id = null, $fields = null)
return $form;
}

/**
* Convert an array of data to JSON and wrap it in an HTML tag as pjax is used and jQuery will parse this
* as an element on the client side in LeftAndMain.js handleAjaxResponse()
* The attribute type="application/json" denotes this is a data block and won't be processed by a browser
* https://html.spec.whatwg.org/#the-script-element
*
* @param array $data
* @return string
*/
private function prepareDataForPjax(array $data): string
{
return '<script type="application/json">' . json_encode($data) . '</script>';
}

/**
* Returns a placeholder form, used by {@link getEditForm()} if no record is selected.
* Our javascript logic always requires a form to be present in the CMS interface.
Expand Down
Loading