Skip to content

Commit

Permalink
ENH move private method to framework (#1730)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Apr 26, 2024
1 parent 6e5379a commit d43e6dc
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions code/LeftAndMain.php
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit d43e6dc

Please sign in to comment.