How to add a custom editor in phpMyAdmin only for certain fields?

I would like to integrate JSON Editor Onlinewith phpMyAdminto edit certain fields of a table containing PHP arrays encoded in JSON format.

I looked at the configuration options , and the only ones related to the field editors were:

CharEditing: Which editor should be used for CHAR/VARCHAR fields

I read this SO question which points to tbl_change.phpbut cannot see an easy way to configure it.

I would like to do something like this:

  • determine which fields a custom editor needs (for example, based on criteria such as data type, field name ...)
  • associate these fields with the name of the custom editor
  • create a custom editor in a normalized way (using JS, we could describe how the field value is loaded into the editor and which event / value to use to save the edited value back to DB.

Does anyone know of a way to add a custom editor in phpMyAdmin for specific fields only?

+5
source share
2 answers

There is currently no plugin support for setting up the editor.

However, you can easily change the editor used for some fields in libraries/insert_edit.lib.php- change the function PMA_getValueColumnthat is responsible for receiving HTML code for editing the field.

PS: We will talk about the upcoming phpMyAdmin 4.0 above, I'm not sure about older versions.

+1

i phpmyadmin. , , ,

sql.php libraries/display_tbl.lib.php display_tbl.lib.php

line 1293: $grid_edit_class = 'grid_edit';

, phpmyadmin , .   - , grid_edit2 , phpmyadmin .

gis_data_editor.js - phpmyadmin, sql.php

sql.php grid_edit2 , .

makegrid.js script 29, script script tbl_replace.php this -

ajax_request:true
sql_query:
token:0203ddaa0c51d4776e93921e6ca1281f
db:sepidarsoft_portal
table:archive_media
clause_is_unique:1
where_clause[]:`archive_media`.`_id` = 45
fields[multi_edit][0][]:1364198434
fields_name[multi_edit][0][]:UTime
fields_null[multi_edit][0][]:
rel_fields_list:
do_transformations:false
transform_fields_list:
relational_display:K
goto:sql.php
submit_type:save
_nocache:1364974511419938233

,

+1

All Articles