This repository has been archived by the owner on Jul 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding site wide "controller" feature.
We should have added this way earlier, but better late than never. This feature will hold components that are strictly exportable and site-wide, along with hooks and code to automate deployments. references #80
- Loading branch information
1 parent
efb1693
commit 5c38e0f
Showing
5 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
sites/all/modules/custom/features/f_site_controller/f_site_controller.features.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
/** | ||
* @file | ||
* f_site_controller.features.inc | ||
*/ | ||
|
||
/** | ||
* Implements hook_ctools_plugin_api(). | ||
*/ | ||
function f_site_controller_ctools_plugin_api() { | ||
list($module, $api) = func_get_args(); | ||
if ($module == "strongarm" && $api == "strongarm") { | ||
return array("version" => "1"); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
sites/all/modules/custom/features/f_site_controller/f_site_controller.features.taxonomy.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* @file | ||
* f_site_controller.features.taxonomy.inc | ||
*/ | ||
|
||
/** | ||
* Implements hook_taxonomy_default_vocabularies(). | ||
*/ | ||
function f_site_controller_taxonomy_default_vocabularies() { | ||
return array( | ||
'vocab_elections' => array( | ||
'name' => 'Elections', | ||
'machine_name' => 'vocab_elections', | ||
'description' => 'Tags to associate content with a particular election. Like india-elections-2014 or delhi-elections-2013 etc.', | ||
'hierarchy' => '0', | ||
'module' => 'taxonomy', | ||
'weight' => '0', | ||
), | ||
'vocab_pc' => array( | ||
'name' => 'Parliament Constituencies', | ||
'machine_name' => 'vocab_pc', | ||
'description' => 'List of Parliament Constituencies of India', | ||
'hierarchy' => '0', | ||
'module' => 'taxonomy', | ||
'weight' => '0', | ||
), | ||
'vocab_states' => array( | ||
'name' => 'States', | ||
'machine_name' => 'vocab_states', | ||
'description' => 'List of states and union territories in India, to tag various content like candidates etc. ', | ||
'hierarchy' => '0', | ||
'module' => 'taxonomy', | ||
'weight' => '0', | ||
), | ||
); | ||
} |
19 changes: 19 additions & 0 deletions
19
sites/all/modules/custom/features/f_site_controller/f_site_controller.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name = Site Controller | ||
description = Holds site wide components and deployment related install hooks | ||
core = 7.x | ||
package = AAP Features | ||
version = 7.x-1.0 | ||
project = f_site_controller | ||
dependencies[] = ctools | ||
dependencies[] = features | ||
dependencies[] = metatag | ||
dependencies[] = strongarm | ||
dependencies[] = taxonomy | ||
features[ctools][] = strongarm:strongarm:1 | ||
features[features_api][] = api:1 | ||
features[taxonomy][] = vocab_elections | ||
features[taxonomy][] = vocab_pc | ||
features[taxonomy][] = vocab_states | ||
features[variable][] = pathauto_taxonomy_term_vocab_elections_pattern | ||
features[variable][] = pathauto_taxonomy_term_vocab_pc_pattern | ||
features[variable][] = pathauto_taxonomy_term_vocab_states_pattern |
7 changes: 7 additions & 0 deletions
7
sites/all/modules/custom/features/f_site_controller/f_site_controller.module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
/** | ||
* @file | ||
* Code for the Site Controller feature. | ||
*/ | ||
|
||
include_once 'f_site_controller.features.inc'; |
35 changes: 35 additions & 0 deletions
35
sites/all/modules/custom/features/f_site_controller/f_site_controller.strongarm.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* @file | ||
* f_site_controller.strongarm.inc | ||
*/ | ||
|
||
/** | ||
* Implements hook_strongarm(). | ||
*/ | ||
function f_site_controller_strongarm() { | ||
$export = array(); | ||
|
||
$strongarm = new stdClass(); | ||
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ | ||
$strongarm->api_version = 1; | ||
$strongarm->name = 'pathauto_taxonomy_term_vocab_elections_pattern'; | ||
$strongarm->value = 'election/[term:name]'; | ||
$export['pathauto_taxonomy_term_vocab_elections_pattern'] = $strongarm; | ||
|
||
$strongarm = new stdClass(); | ||
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ | ||
$strongarm->api_version = 1; | ||
$strongarm->name = 'pathauto_taxonomy_term_vocab_pc_pattern'; | ||
$strongarm->value = 'parliament-constituency/[term:name]'; | ||
$export['pathauto_taxonomy_term_vocab_pc_pattern'] = $strongarm; | ||
|
||
$strongarm = new stdClass(); | ||
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ | ||
$strongarm->api_version = 1; | ||
$strongarm->name = 'pathauto_taxonomy_term_vocab_states_pattern'; | ||
$strongarm->value = 'state/[term:name]'; | ||
$export['pathauto_taxonomy_term_vocab_states_pattern'] = $strongarm; | ||
|
||
return $export; | ||
} |