Skip to content

Instantly share code, notes, and snippets.

@tracylemke
Forked from esimonetti/afterEntryPoint.php
Created November 21, 2017 05:05
Show Gist options
  • Save tracylemke/a1f463a62ee84499ce22436454b1a549 to your computer and use it in GitHub Desktop.
Save tracylemke/a1f463a62ee84499ce22436454b1a549 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