Hi Marc,
thanks for your questions.
Unfortunately, for both of them, there is no easy solution. Those default settings that you mention for the “List of tables” (number and sort order) and the default settings for the “DataTables JavaScript Features” are hard-coded into the plugin.
Let met start with the “DataTables JavaScript Features”:
To change those default values, take a look at the $default_table variable in line 42 of the file “controller-base.php” in the “controllers” subfolder of the plugin.
There you can change the default state of most features (true/false).
For the “List of tables”, there is possibility to change the default sort order, but you can not choose which tables are shown.
To change the sort order, please see the file “controller-admin.php” in the “controllers” subfolder and go to line 1862. There, change
"aaSorting": [],
to
"aaSorting": [[2, 'desc']],
That should sort the list by the names, in descending order when the list is loaded (untested).
Please be aware that you will have to redo any modifications you make after you update the plugin to a new version. So, it is not really a final solution and I don’t really like and recommend it, but for the moment it should work.
Best wishes,
Tobias
Tobias,
Thanks for the rapid reply. I managed to solve some of my problems by figuring out how to edit the dump file, which let me change the settings for the 60 or so tables I had already imported. Since these were all booleans, it is easy to change the value without worrying about changing the length of the string. You can even do global search and replace, if the new string is the same length as the old one. I’m hoping to have a friend write a little Perl program (or whatever language they choose) to allow for more flexible editing of the dump file to allow for broader search and replace.
If it is possible in a future version to make the number of tables shown in the List Tables a changeable parameter, that feature would still be very helpful. I will also likely implement the suggestions you made if I need to import another large batch of tables.
Thanks,
Marc
Hi Marc,
you are right, booleans in the Dump file can be changed quite easily. However, please be always careful, when editing that file, as it is quite easy to break something, so I do not really recommend working in it. But as you are aware of the “length of the string” problem, I guess you know what you are doing 🙂
About the number of tables in the “List of Tables”: That sounds like a good suggestion, and this actually a feature in the DataTables JavaScript library, it is just turned off on that screen (but I don’t remember why I did that…). So, I’ll look into it again 🙂
Thanks!
Tobias
Tobias,
I learned the “hard” way how easy it is to break the dump file, but fortunately you wrote the plug-in correctly so that if there is an attempt to import a defective dump file, it does not overwrite the existing tables. Thus, as long as you are prepared to recreate a dump file, or you only modify a copy of one, which is the safer approach, it wasn’t too painful a way to discover how the file is structured.
Thanks again,
Marc