@@ -272,46 +272,59 @@ function _paraneue_dosomething_theme_settings_footer(&$form, $form_state) {
272272 );
273273
274274 $ links = &$ form ['footer ' ]['links ' ];
275- $ columns = array ('first ' , 'second ' , 'third ' );
276- foreach ($ columns as $ column ) {
277- $ prefix = 'footer_links_ ' . $ column ;
278275
279- $ links [$ prefix ] = array (
276+ // Set up theme settings for each country's footer
277+ $ countries = dosomething_global_get_countries ();
278+ foreach ($ countries as $ country ) {
279+ $ links [$ country . '_links ' ] = [
280280 '#type ' => 'fieldset ' ,
281- '#title ' => t (ucwords ( $ column ) . ' column ' ),
281+ '#title ' => t (' @country Links ' , [ ' @country ' => $ country ] ),
282282 '#collapsible ' => TRUE ,
283- '#collapsed ' => TRUE
284- );
285-
286- $ link_column = &$ links [$ prefix ];
287-
288- $ link_column [$ prefix . '_column_heading ' ] = array (
289- '#type ' => 'textfield ' ,
290- '#title ' => t (ucwords ($ column ) . ' Column Heading ' ),
291- '#default_value ' => theme_get_setting ('footer_links_ ' . $ column . '_column_heading ' )
292- );
293-
294- $ link_column [$ prefix . '_column_links ' ] = array (
295- '#type ' => 'textarea ' ,
296- '#title ' => t (ucwords ($ column ) . ' Column Links ' ),
297- '#default_value ' => theme_get_setting ('footer_links_ ' . $ column . '_column_links ' )
298- );
299-
300- $ link_column [$ prefix . '_advanced ' ] = array (
301- '#type ' => 'fieldset ' ,
302- '#title ' => t ('Advanced options ' ),
303- '#collapsible ' => TRUE ,
304- '#collapsed ' => TRUE
305- );
306-
307- $ link_column [$ prefix . '_advanced ' ][$ prefix . '_column_class ' ] = array (
308- '#type ' => 'textfield ' ,
309- '#title ' => t (ucwords ($ column ) . ' Column Class ' ),
310- '#default_value ' => theme_get_setting ('footer_links_ ' . $ column . '_column_class ' )
311- );
283+ '#collapsed ' => TRUE ,
284+ ];
285+
286+ // Set up theme settings for each of the three columns
287+ $ columns = ['first ' , 'second ' , 'third ' ];
288+ foreach ($ columns as $ column ) {
289+ $ prefix = 'footer_links_ ' . $ country . '_ ' . $ column ;
290+
291+ $ links [$ country . '_links ' ][$ prefix ] = [
292+ '#type ' => 'fieldset ' ,
293+ '#title ' => t (ucwords ($ column ) .' column ' ),
294+ '#collapsible ' => TRUE ,
295+ '#collapsed ' => TRUE ,
296+ ];
297+
298+ $ link_column = &$ links [$ country . '_links ' ][$ prefix ];
299+
300+ // Get new country code setting if it exists, if not fallback to old setting.
301+ // @TODO: Remove this after we've updated theme settings everywhere.
302+ $ heading_default = theme_get_setting ('footer_links_ ' . $ country . '_ ' . $ column . '_column_heading ' );
303+ if (!$ heading_default === NULL ) {
304+ $ heading_default = theme_get_setting ('footer_links_ ' . $ column . '_column_heading ' );
305+ }
306+
307+ $ link_column [$ prefix . '_column_heading ' ] = [
308+ '#type ' => 'textfield ' ,
309+ '#title ' => t (ucwords ($ country ) . ' ' . ucwords ($ column ) . ' Column Heading ' ),
310+ '#default_value ' => $ heading_default ,
311+ ];
312+
313+ // Get new country code setting if it exists, if not fallback to old setting.
314+ // @TODO: Remove this after we've updated theme settings everywhere.
315+ $ links_default = theme_get_setting ('footer_links_ ' . $ country . '_ ' . $ column . '_column_links ' );
316+ if (!$ links_default === NULL ) {
317+ $ links_default = theme_get_setting ('footer_links_ ' . $ column . '_column_links ' );
318+ }
319+
320+ $ link_column [$ prefix . '_column_links ' ] = [
321+ '#type ' => 'textarea ' ,
322+ '#title ' => t (ucwords ($ country ) . ' ' . ucwords ($ column ) . ' Column Links ' ),
323+ '#default_value ' => $ links_default ,
324+ ];
325+ }
312326
313327 }
314-
315328}
316329
317330function _paraneue_dosomething_theme_settings_user (&$ form , $ form_state ) {
@@ -321,7 +334,7 @@ function _paraneue_dosomething_theme_settings_user(&$form, $form_state) {
321334 );
322335 $ form_user = &$ form ['user ' ];
323336
324- // Validaions .
337+ // Validations .
325338 $ form_user ['validations ' ] = array (
326339 '#type ' => 'fieldset ' ,
327340 '#title ' => t ('JS Validations ' ),
0 commit comments