Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Commit b1ac721

Browse files
committed
Merge pull request #2222 from desmondmorris/toggle-sponsors
Toggle sponsors block from theme settings
2 parents e10161a + 621251e commit b1ac721

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

lib/themes/dosomething/paraneue_dosomething/paraneue_dosomething.info

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ features[] = secondary_menu
1414

1515
; Settings
1616
settings[show_campaign_finder] = 0
17+
settings[show_sponsors] = 1
1718

1819
;Exclude
1920
;javascript

lib/themes/dosomething/paraneue_dosomething/templates/home/node--home.tpl.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
</div>
151151
</div>
152152

153+
<?php if( theme_get_setting('show_sponsors') ) : ?>
153154
<div class="homepage--sponsors">
154155
<h4>Sponsors</h4>
155156
<p>
@@ -168,6 +169,7 @@
168169
</p>
169170
</div>
170171
</div>
172+
<?php endif; ?>
171173

172174
<?php
173175

lib/themes/dosomething/paraneue_dosomething/theme-settings.php

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,25 @@ function paraneue_dosomething_form_system_theme_settings_alter(&$form, $form_sta
1010
'#weight'=> -19
1111
);
1212

13-
$form['feature_flags']['show_campaign_finder'] = array(
14-
'#type' => 'checkbox',
15-
'#title' => t('Campaign Finder') ,
16-
'#description' => t('Toggles campaign finder on homepage/expore campaigns page.'),
17-
'#default_value' => theme_get_setting('show_campaign_finder')
13+
$flags = array(
14+
'show_campaign_finder' => array(
15+
'#title' => t('Campaign Finder'),
16+
'#description' => t('Toggles campaign finder on homepage/expore campaigns page.')
17+
),
18+
'show_profile_link' => array(
19+
'#title' => t('User Profile Link'),
20+
'#description' => t('Toggles the user profile/create an account link in the main navigation.')
21+
),
22+
'show_sponsors' => array(
23+
'#title' => t('Show sponsors'),
24+
'#description' => t('Toggles the sponsors block on the home page when finder is enabled.')
25+
)
1826
);
1927

20-
$form['feature_flags']['show_profile_link'] = array(
21-
'#type' => 'checkbox',
22-
'#title' => t('User Profile Link') ,
23-
'#description' => t('Toggles the user profile/create an account link in the main navigation.'),
24-
'#default_value' => theme_get_setting('show_profile_link')
25-
);
28+
foreach ($flags as $name => $flag) {
29+
$form['feature_flags'][$name] = $flag;
30+
$form['feature_flags'][$name]['#type'] = 'checkbox';
31+
$form['feature_flags'][$name]['#default_value'] = theme_get_setting($name);
32+
}
33+
2634
}

0 commit comments

Comments
 (0)