summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xheartbeat.api.php33
-rwxr-xr-xheartbeat.module2
-rwxr-xr-xmodules/heartbeat_ui/heartbeat_ui.module14
3 files changed, 43 insertions, 6 deletions
diff --git a/heartbeat.api.php b/heartbeat.api.php
index 431a725..4c93224 100755
--- a/heartbeat.api.php
+++ b/heartbeat.api.php
@@ -7,8 +7,14 @@
* This file is divided into static hooks (hooks with string literal names) and
* dynamic hooks (hooks with pattern-derived string names).
*
- * There are also some utility or api functions available.
+ * Note that the export hooks like
+ * ° hook_defaults_heartbeat_template_info,
+ * ° hook_defaults_heartbeat_stream_info
+ * ° hook_heartbeat_plugin_info
+ * are dependant on CTools. This requires you to include the
+ * hook_ctools_plugin_api() as well.
*
+ * There are also some utility or api functions available.
*
* heartbeat_api_log
* API function to log a message when an event occurs. Most people will log through
@@ -44,7 +50,20 @@
*/
/**
+ * Implement hook_ctools_plugin_api().
+ *
+ * This hook is needed to let ctools know about exportables.
+ */
+function hook_ctools_plugin_api($module, $api) {
+ if ($module == 'yourmodule' && $api == 'yourmodule') {
+ return array('version' => 1);
+ }
+}
+
+/**
* Register default heartbeat streams.
+ *
+ * @see hook_ctools_plugin_api.
*/
function hook_defaults_heartbeat_stream_info() {
@@ -68,6 +87,8 @@ function hook_defaults_heartbeat_stream_info() {
/**
* Register heartbeat templates.
+ *
+ * @see hook_ctools_plugin_api.
*/
function hook_defaults_heartbeat_template_info() {
@@ -149,6 +170,16 @@ function hook_heartbeat_activity_insert($heartbeatActivity) {
}
/**
+ * Take action when activity is being saved.
+ *
+ * @param HeartbeatActivity $heartbeatActivity
+ * The heartbeat activity object.
+ */
+function hook_heartbeat_activity_save($heartbeatActivity) {
+ // Do your stuff...
+}
+
+/**
* Hook to alter the stream or take action when the stream
* is loaded.
*/
diff --git a/heartbeat.module b/heartbeat.module
index 85d6205..94af84d 100755
--- a/heartbeat.module
+++ b/heartbeat.module
@@ -1198,7 +1198,7 @@ function heartbeat_stream_more_link(HeartbeatStream $heartbeatStream, $offset_ti
// Link to the pages.
if (!$heartbeatStream->isPage() && (!$heartbeatStream->isAjax() || $heartbeatStream->config->block_show_pager == 3)) {
- $path = 'heartbeat/' . $heartbeatStream->config->name;
+ $path = 'heartbeat/' . $heartbeatStream->config->class;
if (isset($attributes['attributes']['onclick'])) {
unset($attributes['attributes']['onclick']);
}
diff --git a/modules/heartbeat_ui/heartbeat_ui.module b/modules/heartbeat_ui/heartbeat_ui.module
index 1a01819..971c3d3 100755
--- a/modules/heartbeat_ui/heartbeat_ui.module
+++ b/modules/heartbeat_ui/heartbeat_ui.module
@@ -452,7 +452,7 @@ function heartbeat_streams_ui_ctools_export_ui_form(&$form, &$form_state) {
'#options' => $options,
);
- // Stream settings
+ // Stream settings.
$form['settings']['fs_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Settings'),
@@ -527,7 +527,7 @@ function heartbeat_streams_ui_ctools_export_ui_form(&$form, &$form_state) {
'#description' => t('Maximum gap for the same activity to be grouped together and before an identical activity can be logged again'),
);
- // Blocks settings
+ // Blocks settings.
$form['settings']['fs_blocks'] = array(
'#type' => 'fieldset',
'#title' => t('Blocks'),
@@ -561,7 +561,7 @@ function heartbeat_streams_ui_ctools_export_ui_form(&$form, &$form_state) {
'#default_value' => $heartbeatStreamConfig->block_show_pager,
);
- // Page settings
+ // Page settings.
$form['settings']['fs_pages'] = array(
'#type' => 'fieldset',
'#title' => t('Pages'),
@@ -571,7 +571,7 @@ function heartbeat_streams_ui_ctools_export_ui_form(&$form, &$form_state) {
$form['settings']['fs_pages']['page_disabled'] = array(
'#title' => t('Page disabled'),
'#type' => 'checkbox',
- '#default_value' => 1,
+ '#default_value' => $heartbeatStreamConfig->page_disabled,
);
$form['settings']['fs_pages']['profilePage'] = array(
'#title' => t('Add user profile page'),
@@ -617,8 +617,14 @@ function heartbeat_streams_ui_ctools_export_ui_form_submit(&$form, &$form_state)
unset($form_state['values']['settings'][$name]);
}
}
+
cache_clear_all('heartbeat_streams', 'cache');
drupal_static_reset('heartbeat_streams');
+
+ if ($form_state['item']->page_disabled != $form_state['values']['settings']['page_disabled']) {
+ // clear menu cache.
+ menu_cache_clear_all();
+ }
}
/**