Skip to content

Instantly share code, notes, and snippets.

@esimonetti
Last active November 29, 2017 20:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save esimonetti/9833daf823aa26b84afbbc4374e81f8a to your computer and use it in GitHub Desktop.
Save esimonetti/9833daf823aa26b84afbbc4374e81f8a to your computer and use it in GitHub Desktop.
Disable Activity Stream on Sugar 7 - Application logic hook to disable writes everywhere and example of vardefs to disable module specific UI
<?php
// Enrico Simonetti
// enricosimonetti.com
// custom/logichooks/application/afterEntryPoint.php
class afterEntryPoint
{
public function disableActivityStream($event, $arguments)
{
// disable activity stream
Activity::disable();
}
}
<?php
// Enrico Simonetti
// enricosimonetti.com
// custom/Extension/modules/Contacts/Ext/Vardefs/acitivity_stream.php
$dictionary['Contact']['activity_enabled'] = false;
<?php
// Enrico Simonetti
// enricosimonetti.com
// custom/Extension/application/Ext/LogicHooks/installer.afterEntryPoint.php
$hook_version = 1;
$hook_array['after_entry_point'][] = array(
1,
'Disable activity stream on after entry point hook',
'custom/logichooks/application/afterEntryPoint.php',
'afterEntryPoint',
'disableActivityStream',
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment