elkarte/Elkarte — pull request #1139 by Spuds (2013-12-09 15:34:06+00:00)
Title: config_var consolidation

The file count / lines changed may look a bit scarey, but the change is not that complex.

In most of our admin controllers we had duplicate sections of code with respect to config_vars. Each form had a config_var setup in a private method (used to generate the form), and then that array alone (and often some associated conditional logic) was duplicated in a public method that was used by the admin search.

Obviously have the same code twice was going to lead to some trouble, and in fact the two "instances" had already drifted apart in some areas.

So this PR moves the current private config_vars setup to a separate private method and calls that new method from the form setup. It also adds a public method which returns the value of the private settings for use in the admin search (replacing the old public method). This reduces the duplication and should keep everything in the proper containers, I think more can be done here but this is a start.