Permalink
Browse files

Add breadcrumbs support

  • Loading branch information...
1 parent 2689e4b commit 22609ad757ca29c1e209a5af2dbcc2e8dba385e2 @amoore5 committed Jan 24, 2012
Showing with 43 additions and 0 deletions.
  1. +21 −0 campuscms_feature_webform.install
  2. +22 −0 campuscms_feature_webform.module
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Implements hook_install().
+ *
+ * Perform actions to set up the webform feature.
+ */
+function campuscms_feature_webform_install() {
+ if (module_exists('custom_breadcrumbs')) {
+ _campuscms_feature_webform_custom_breadcrumbs();
+ }
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function campuscms_feature_webform_uninstall() {
+ if (module_exists('custom_breadcrumbs')) {
+ db_delete('custom_breadcrumbs')->condition('name', 'campuscms_feature_webform-%', 'LIKE')->execute();
+ }
+}
@@ -5,3 +5,25 @@
*/
include_once('campuscms_feature_webform.features.inc');
+
+/**
+ * Implements hook_modules_installed().
+ */
+function campuscms_feature_webform_modules_installed($modules) {
+ if (in_array('custom_breadcrumbs', $modules)) {
+ _campuscms_feature_webform_custom_breadcrumbs();
+ }
+}
+
+// Create some breadcrumbs
+function _campuscms_feature_webform_custom_breadcrumbs() {
+ // Add node breadcrumb.
+ $breadcrumb = new stdClass();
+ $breadcrumb->name = 'campuscms_feature_webform-node-webform';
+ $breadcrumb->titles = array('Menu Parent Trail', '[node:title]');
+ $breadcrumb->paths = array('<menu-parent-trail>', '<none>');
+ $breadcrumb->visibility_php = '';
+ $breadcrumb->node_type = 'webform';
+
+ _custom_breadcrumbs_save_breadcrumb('custom_breadcrumbs', 'node', $breadcrumb);
+}

0 comments on commit 22609ad

Please sign in to comment.