It seems module currently has an administration configuration page that is defined in baidu_map_menu, in baidu_map.module, line 27 with the path admin/config/services/baidu_map, which calls back the form baidu_map_settings in baidu_map.module, line 43.
I think it would be recommended to move all the administration code in a separate file, called baidu_map.admin.inc, different from the module file (which loads on every page), which would slightly lower the memory footprint of the module.
This should be a very standard way of coding, organizing files and would be recommended by the Drupal developer community.
Feel free to let me know if you would have any questions, comments or concerns on any aspects of the discussed implementations, I would be glad to explain in more details.
Thanks very much to all, in advance, for your comments, feedback, and insight.
Cheers!
Comments
Comment #1
xiukun.zhou commentedQuick follow up on this task:
I didn't do any other change but to declare the file callback for the form page with
'file' => 'baidu_map.admin.inc',, and then simply copy/pasted all the code related with the form and other functions used to a new file called baidu_map.admin.inc.I went ahead and committed the changes against the 7.x-1.x branch at c6d2937.
This change doesn't add any new feature or function to the module, however, it improves its code organization, readability, maintainability as well as its memory footprint.
I allowed myself to mark this issue as fixed for now, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with this ticket or related commit c6d2937 (we would surely be happy to hear your feedback).
Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on the commit or this task in general, I would be glad to provide more information or explain in more details.
Thanks in advance to everyone for your testing, reviews, feedback and comments on this issue.
Cheers!