CMD_SKINS custom skin colors json/api (SKINS)(LANG)

Version 1.531


Feature for skin.conf which allows for custom colors. The skin.conf might have something like: CUSTOM_COLOR_1=#0083B4 CUSTOM_COLOR_1_options=#0083B4:#009933:#262626 CUSTOM_COLOR_2=#0193CA CUSTOM_COLOR_2_OPTIONS=ANY where custom_color_1 will be the default value. The custom_color_1_options will contains a colon separated list of colors that can be selected. If custom_color_1_options is set to ANY, then a color selector should be used instead, as this item would allow any color to be selected. Up to 128 custom colors can be used. The json output for: CMD_SKINS?action=edit_customization&name=evolution&json=yes might look like: { "CUSTOM_LOGO_TOKEN": "IMG_LOGO_LARGE", "HAS_CUSTOMIZATION": "1", "HAS_CUSTOM_LOGO": "1", "SKIN_NUM_CUSTOM_COLORS": "2", "CUSTOM_COLOR_1": "#0083B4", "CUSTOM_COLOR_1_OPTIONS": { "1": "#0083B4", "2": "#009933", "3": "#262626" }, "CUSTOM_COLOR_2": "#0193CA", "CUSTOM_COLOR_2_OPTIONS": "ANY", "name": "evolution" } The CMD_API_SKINS API output is similar, but does not use a sub-array for the options list. For the API, the raw color separted list is given instead, eg: custom_color_1_options=#0083B4:#009933:#262626 =========================== Save a custom color: CMD_SKINS method: POST action=select_custom_color name=skinname save=anytext color1=#AA33FF color_check_1=1 where the "1" in color1 and "=1" must match.. The number in "color_check_1" does not matter, but needs to be a number. =========================== Clear a custom color: CMD_SKINS method: POST action=select_custom_color name=skinname clear_customization=anytext color_check_1=1 Where color_check_1=1 specifies which color number to edit. The 1 in color_check_1 has no effect, it can be any number (the =1 is what matters), but for simplicity, you might as well make the match. (DA does not, we'll usually have color_check_0=1 to specify color 1 is selected) =========================== SKINS reseller/skins_customize.html added |CUSTOM_COLOR_TABLE| token, and javascript to handle color changes when selected.

Interested to try DirectAdmin? Get a 30-day Free Trial!