Skip to content

Commit 33c6afd

Browse files
committed
Made a configuration form for the BWCD
1 parent 5907593 commit 33c6afd

File tree

6 files changed

+265
-6
lines changed

6 files changed

+265
-6
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name = CityGroups Profile
22
description = Install CityGroups.
33
version = VERSION
4+
45
core = 7.x
56

67
dependencies[] = features
78
dependencies[] = citygroups
89

910
files[] = citygroups_profile.profile
11+
version = "7.8"
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?php
2+
3+
/**
4+
* @file
5+
*
6+
*/
7+
8+
/**
9+
* Category edit page.
10+
*/
11+
function sea_blockwatch_configure_edit_form($form, &$form_state, array $rule = array()) {
12+
$form['introduction'] = array(
13+
'#markup' => '
14+
<h3>Configure Seattle Blockwatch </h3>
15+
<p><strong>Configure the Seattle Blockwatch pages.</strong></p>
16+
<a name="site-content"></a>
17+
<h3>Site Content</h3>
18+
<p>Enter custom text that should appear throughout the site & on the homepage.</p>
19+
',
20+
);
21+
22+
$form['sea_blockwatch_name'] = array(
23+
'#type' => 'textfield',
24+
'#title' => t('Name of Project'),
25+
'#default_value' => variable_get('sea_blockwatch_name', 'Block Watch Captain Directory'),
26+
'#description' => 'Name of project.',
27+
);
28+
29+
$form['sea_blockwatch_content_tagline'] = array(
30+
'#type' => 'textarea',
31+
'#title' => t('Tagline'),
32+
'#default_value' => variable_get('sea_blockwatch_content_tagline', '
33+
<h3>Find the nearest Block Watch Captain</h3>
34+
<p>The Block Watch Captain Directory lists basic contact information for Block Watch Captains in Seattle.</p>'),
35+
'#description' => 'Customize site tagline',
36+
);
37+
38+
$form['sea_blockwatch_content_groups'] = array(
39+
'#type' => 'textarea',
40+
'#title' => t('View Groups (homepage content)'),
41+
'#default_value' => variable_get('sea_blockwatch_content_groups', '
42+
<h3>' . t('View Block Watch Captains') .'</h3>
43+
<p>Find a Block Watch Captain on the map.</p>'
44+
),
45+
'#description' => 'Prompt to check out groups in the directory',
46+
);
47+
48+
$form['sea_blockwatch_content_add_new_group'] = array(
49+
'#type' => 'textarea',
50+
'#title' => t('Add New Group (homepage content)'),
51+
'#default_value' => variable_get('sea_blockwatch_content_add_new_group', '
52+
<h3>' . t('Are you a Block Watch Captain?') . '</h3>
53+
<p>Help your neighbors and other Block Watch captains find you. <a href="/node/add/community-group">Add</a> your contact information and map your Block Watch community.</p>
54+
<div class="button"><a href="/node/add/community-group">Add New</a></div>
55+
'),
56+
'#description' => 'Prompt to add new groups.',
57+
);
58+
59+
$form['sea_blockwatch_content_news'] = array(
60+
'#type' => 'textarea',
61+
'#title' => t('News (homepage content)'),
62+
'#default_value' => variable_get('sea_blockwatch_content_news',
63+
'<h3>' . t('Mapping in West Seattle.') . '</h3>
64+
<p>This fall we are reaching out to Block Watch Captains in West Seattle to build a public map of Block Watch Groups.</p>
65+
<p>As you can see, there are only a handful of Block Watch Captains listed, and our goal is to develop a complete list and map, and eventually have a Captain on every block in West Seattle.</p>
66+
<p>We are working with the <a href="http://genesee-schmitz.org">Genesee-Schmitz Neighborhood Council</a>, the <a href="http://wsblockwatchnet.wordpress.com/">West Seattle Block Watch Captain’s Network</a> and the
67+
<a href="http://www.seattle.gov/spd/">Seattle Police Department</a> to reach out to Block Watch Captains in Seattle and fill in this map.</p>
68+
'),
69+
'#description' => 'News about this project',
70+
);
71+
72+
$form['sea_blockwatch_content_promote'] = array(
73+
'#type' => 'textarea',
74+
'#title' => t('Promote (homepage content)'),
75+
'#default_value' => variable_get('sea_blockwatch_content_promote', '
76+
<h3>Spread the word</h3>
77+
<p>Tell your friends, neighbors & local community groups.</p>
78+
<p>We’ve written emails, made <a href="blockwatch/get-involved">printable flyers</a> to make it easy to explain to others.</p>'),
79+
'#description' => 'Links to promotional content',
80+
);
81+
82+
83+
$form['sea_blockwatch_social_media_twitter'] = array(
84+
'#type' => 'textfield',
85+
'#title' => t('Twitter Handle'),
86+
'#default_value' => variable_get('sea_blockwatch_social_media_twitter', 'AllCityGroups'),
87+
'#description' => 'What is the account name? (Ex. BostonCityGroups)',
88+
);
89+
90+
$form['sea_blockwatch_social_media_facebook'] = array(
91+
'#type' => 'textfield',
92+
'#title' => t('Facebook'),
93+
'#default_value' => variable_get('sea_blockwatch_social_media_facebook', array()),
94+
'#description' => 'Link to Facebook page',
95+
);
96+
97+
$form['sea_blockwatch_mailing_list'] = array(
98+
'#type' => 'textfield',
99+
'#title' => t('Mailing List'),
100+
'#default_value' => variable_get('sea_blockwatch_mailing_list', 'http://citygroups.us2.list-manage1.com/subscribe?u=eb1facd19686e6ad279923882&id=ea0d4c3774'),
101+
'#description' => 'Link to mailing list.',
102+
);
103+
104+
$form['sea_blockwatch_social_media_flyer'] = array(
105+
'#type' => 'textfield',
106+
'#title' => t('Flyer'),
107+
'#default_value' => variable_get('sea_blockwatch_social_media_flyer', array()),
108+
'#description' => 'Path to printable flyer',
109+
);
110+
111+
return system_settings_form($form);
112+
}

sites/all/modules/custom/citygroups_projects/sea_blockwatch/sea_blockwatch.blocks.inc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function sea_blockwatch_contents($type) {
113113
<div class=\"grid_6 about alpha\">
114114
<h3>What is a Block Watch Captain?</h3>
115115
<p>Block Watch is a national program that is based on the principle that neighbors working together are the first and best line of defense against crime. The Captain is also the logical person to organize the efforts to prepare for a disaster or emergency like a major earthquake. Each household and every block needs to be prepared.</p>
116-
<p>Block Watch Captains take the lead among their neighbors by partnering with the Seattle Police Department, the Department of Emergency Preparedness, and other city departments to alert them to suspicious activity, to organize their block to prepare for and respond to an emergency, and create a better sense of community as neighbors help each other. Block parties, emergency kit building, street cleanups and other creative initiatives at the block or neighborhood level makes this work</p>
116+
<p>Block Watch Captains take the lead among their neighbors by partnering with the Seattle Police Department, the Department of Emergency Preparedness, and other city departments to alert them to suspicious activity, to organize their block to prepare for and respond to an emergency, and create a better sense of community as neighbors help each other. Block parties, emergency kit building, street cleanups and other creative initiatives at the block or neighborhood level makes this work.</p>
117117
</div>
118118
119119
<div class=\"grid_4 push_1 participate\">
@@ -125,8 +125,11 @@ function sea_blockwatch_contents($type) {
125125
<div class=\"grid_4 push_1 local omega\">
126126
<h3>Block Watch Resources</h3>
127127
<p>Get connected to the Seattle Police Department and other local crime prevention & emergency preparedness initiatives.</p>
128+
<p><a href=\"/blockwatch/resources\">See list of resources</a></p>
129+
<br />
128130
<h3>More Local community groups</h3>
129131
<p>CityGroups lists other kinds of community groups working to make your neighborhood better in Seattle. Find other community leaders near you.</p>
132+
<p><a href=\"/blockwatch/categories\">See related groups</a></p>
130133
</div>
131134
</div>
132135
";

sites/all/modules/custom/citygroups_projects/sea_blockwatch/sea_blockwatch.module

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ function sea_blockwatch_help($path, $arg) {
2424
* are overwritten.
2525
*/
2626
function sea_blockwatch_menu() {
27+
28+
$items['admin/config/citygroups/sea_blockwatch'] = array(
29+
'title' => 'CityGroups Seattle Block Watch Settings',
30+
'page callback' => 'drupal_get_form',
31+
'page arguments' => array('sea_blockwatch_configure_edit_form'),
32+
'access arguments' => array('administer users'),
33+
'type' => MENU_LOCAL_ACTION,
34+
'weight' => 1,
35+
'file' => 'sea_blockwatch.admin.inc',
36+
);
37+
38+
2739
$items['blockwatch'] = array(
2840
'title' => 'Find the nearest Block Watch Captain',
2941
'page callback' => 'sea_blockwatch_home_render',
@@ -54,6 +66,13 @@ function sea_blockwatch_menu() {
5466
'page arguments' => array(t('Blockwatch About Page')),
5567
'access callback' => TRUE,
5668
);
69+
70+
$items['blockwatch/resources'] = array(
71+
'title' => 'Resources',
72+
'page callback' => 'sea_blockwatch_resources_render',
73+
'page arguments' => array(t('Resources')),
74+
'access callback' => TRUE,
75+
);
5776
return $items;
5877
}
5978

@@ -92,8 +111,6 @@ function sea_blockwatch_list_render() {
92111
function sea_blockwatch_categories_render() {
93112
//@TODO This is where we would load related terms for civic taxonomy web service.
94113

95-
$output = '';
96-
97114
$output = '
98115
<div class="related-categories">
99116
<ul class="categories">
@@ -113,8 +130,16 @@ function sea_blockwatch_categories_render() {
113130
* Render custom page for blockwatch.
114131
*/
115132
function sea_blockwatch_about_render() {
116-
$output = '<h3>Resources</h3>
117-
<ul>
133+
$output = '
134+
';
135+
return $output;
136+
}
137+
138+
/**
139+
* Render custom page for blockwatch.
140+
*/
141+
function sea_blockwatch_resources_render() {
142+
$output = '<ul>
118143
<li><a href="">West Seattle Blockwatch Captains Network</a></li>
119144
<li><a href="">Emergency Hubs</a></li>
120145
<li><a href="">SNAP (Seattle Neighborhoods Actively Prepare)</a></li>
@@ -136,6 +161,7 @@ function sea_blockwatch_preprocess_page(&$vars) {
136161
case 'blockwatch/categories':
137162
case 'blockwatch/list':
138163
case 'blockwatch/list/Block-watch':
164+
case 'blockwatch/resources':
139165
sea_blockwatch_page_variables($vars);
140166
break;
141167
case 'blockwatch/add':

sites/all/modules/features/citygroups_site_settings/citygroups_site_settings.info

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ features[variable][] = "comment_form_location_community_group_feed_csv_reimpor"
1414
features[variable][] = "comment_preview_community_group_feed_csv_reimpor"
1515
features[variable][] = "comment_subject_field_community_group_feed_csv_reimpor"
1616
features[variable][] = "contact_default_status"
17+
features[variable][] = "date_api_use_iso8601"
18+
features[variable][] = "date_api_version"
19+
features[variable][] = "date_first_day"
20+
features[variable][] = "date_format_long"
21+
features[variable][] = "date_format_medium"
22+
features[variable][] = "date_format_short"
1723
features[variable][] = "error_level"
1824
features[variable][] = "field_bundle_settings"
1925
features[variable][] = "flag_default_flag_status"
@@ -28,13 +34,20 @@ features[variable][] = "logintoboggan_purge_unvalidated_user_interval"
2834
features[variable][] = "logintoboggan_redirect_on_confirm"
2935
features[variable][] = "logintoboggan_redirect_on_register"
3036
features[variable][] = "logintoboggan_unified_login"
37+
features[variable][] = "maintenance_mode_message"
3138
features[variable][] = "menu_expanded"
3239
features[variable][] = "menu_options_community_group"
3340
features[variable][] = "menu_options_community_group_feed_csv_reimpor"
3441
features[variable][] = "menu_options_community_group_feed_upload_csv"
3542
features[variable][] = "menu_parent_community_group"
3643
features[variable][] = "menu_parent_community_group_feed_csv_reimpor"
3744
features[variable][] = "menu_parent_community_group_feed_upload_csv"
45+
features[variable][] = "minimum_word_size"
46+
features[variable][] = "mollom_fallback"
47+
features[variable][] = "mollom_privacy_link"
48+
features[variable][] = "mollom_servers"
49+
features[variable][] = "mollom_status"
50+
features[variable][] = "mollom_testing_mode"
3851
features[variable][] = "node_admin_theme"
3952
features[variable][] = "node_options_community_group_feed_csv_reimpor"
4053
features[variable][] = "node_preview_community_group"

sites/all/modules/features/citygroups_site_settings/citygroups_site_settings.strongarm.inc

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,48 @@ function citygroups_site_settings_strongarm() {
9494
$strongarm->value = 1;
9595
$export['contact_default_status'] = $strongarm;
9696

97+
$strongarm = new stdClass;
98+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
99+
$strongarm->api_version = 1;
100+
$strongarm->name = 'date_api_use_iso8601';
101+
$strongarm->value = 0;
102+
$export['date_api_use_iso8601'] = $strongarm;
103+
104+
$strongarm = new stdClass;
105+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
106+
$strongarm->api_version = 1;
107+
$strongarm->name = 'date_api_version';
108+
$strongarm->value = '5.2';
109+
$export['date_api_version'] = $strongarm;
110+
111+
$strongarm = new stdClass;
112+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
113+
$strongarm->api_version = 1;
114+
$strongarm->name = 'date_first_day';
115+
$strongarm->value = '0';
116+
$export['date_first_day'] = $strongarm;
117+
118+
$strongarm = new stdClass;
119+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
120+
$strongarm->api_version = 1;
121+
$strongarm->name = 'date_format_long';
122+
$strongarm->value = 'l, F j, Y - H:i';
123+
$export['date_format_long'] = $strongarm;
124+
125+
$strongarm = new stdClass;
126+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
127+
$strongarm->api_version = 1;
128+
$strongarm->name = 'date_format_medium';
129+
$strongarm->value = 'D, Y-m-d H:i';
130+
$export['date_format_medium'] = $strongarm;
131+
132+
$strongarm = new stdClass;
133+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
134+
$strongarm->api_version = 1;
135+
$strongarm->name = 'date_format_short';
136+
$strongarm->value = 'Y-m-d H:i';
137+
$export['date_format_short'] = $strongarm;
138+
97139
$strongarm = new stdClass;
98140
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
99141
$strongarm->api_version = 1;
@@ -147,6 +189,11 @@ function citygroups_site_settings_strongarm() {
147189
$strongarm->name = 'flag_default_flag_status';
148190
$strongarm->value = array(
149191
'bookmarks' => TRUE,
192+
'duplicate' => TRUE,
193+
'inappropriate' => TRUE,
194+
'watch' => TRUE,
195+
'inactive' => TRUE,
196+
'recommend' => TRUE,
150197
);
151198
$export['flag_default_flag_status'] = $strongarm;
152199

@@ -227,6 +274,13 @@ function citygroups_site_settings_strongarm() {
227274
$strongarm->value = 1;
228275
$export['logintoboggan_unified_login'] = $strongarm;
229276

277+
$strongarm = new stdClass;
278+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
279+
$strongarm->api_version = 1;
280+
$strongarm->name = 'maintenance_mode_message';
281+
$strongarm->value = 'CityGroups is currently under maintenance. We should be back shortly. Thank you for your patience.';
282+
$export['maintenance_mode_message'] = $strongarm;
283+
230284
$strongarm = new stdClass;
231285
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
232286
$strongarm->api_version = 1;
@@ -284,11 +338,60 @@ function citygroups_site_settings_strongarm() {
284338
$strongarm->value = 'main-menu:0';
285339
$export['menu_parent_community_group_feed_upload_csv'] = $strongarm;
286340

341+
$strongarm = new stdClass;
342+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
343+
$strongarm->api_version = 1;
344+
$strongarm->name = 'minimum_word_size';
345+
$strongarm->value = '3';
346+
$export['minimum_word_size'] = $strongarm;
347+
348+
$strongarm = new stdClass;
349+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
350+
$strongarm->api_version = 1;
351+
$strongarm->name = 'mollom_fallback';
352+
$strongarm->value = '1';
353+
$export['mollom_fallback'] = $strongarm;
354+
355+
$strongarm = new stdClass;
356+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
357+
$strongarm->api_version = 1;
358+
$strongarm->name = 'mollom_privacy_link';
359+
$strongarm->value = 1;
360+
$export['mollom_privacy_link'] = $strongarm;
361+
362+
$strongarm = new stdClass;
363+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
364+
$strongarm->api_version = 1;
365+
$strongarm->name = 'mollom_servers';
366+
$strongarm->value = array(
367+
0 => 'http://174.37.205.152',
368+
1 => 'http://67.228.84.11',
369+
);
370+
$export['mollom_servers'] = $strongarm;
371+
372+
$strongarm = new stdClass;
373+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
374+
$strongarm->api_version = 1;
375+
$strongarm->name = 'mollom_status';
376+
$strongarm->value = array(
377+
'keys' => TRUE,
378+
'keys valid' => TRUE,
379+
'servers' => FALSE,
380+
);
381+
$export['mollom_status'] = $strongarm;
382+
383+
$strongarm = new stdClass;
384+
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
385+
$strongarm->api_version = 1;
386+
$strongarm->name = 'mollom_testing_mode';
387+
$strongarm->value = 0;
388+
$export['mollom_testing_mode'] = $strongarm;
389+
287390
$strongarm = new stdClass;
288391
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
289392
$strongarm->api_version = 1;
290393
$strongarm->name = 'node_admin_theme';
291-
$strongarm->value = '0';
394+
$strongarm->value = 0;
292395
$export['node_admin_theme'] = $strongarm;
293396

294397
$strongarm = new stdClass;

0 commit comments

Comments
 (0)