rocket_chat_group.module in Rocket.Chat 8.2
File
modules/rocket_chat_group/rocket_chat_group.module
View source
<?php
use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Console\Core\Command\Exclude\DrupliconCommand;
use Drupal\Core\Entity\EntityInterface;
use Drupal\group\Entity\GroupInterface;
use Drupal\rocket_chat_group\RocketChat\moduleHelper;
function rocket_chat_group_group_content_insert(Drupal\group\Entity\GroupContent $entity) {
try {
moduleHelper::ProcessGroupContentUpdate($entity, "insert");
} catch (InvalidPluginDefinitionException $e) {
Drupal::messenger()
->addError("Something went wrong, please notify the Site Admin");
Drupal::logger("Rocket Chat : Base Module")
->critical($e
->getMessage());
} catch (PluginNotFoundException $e) {
Drupal::messenger()
->addError("Something went wrong, please notify the Site Admin");
Drupal::logger("Rocket Chat : Base Module")
->critical($e
->getMessage());
}
}
function rocket_chat_group_group_content_update(Drupal\group\Entity\GroupContent $entity) {
try {
moduleHelper::ProcessGroupContentUpdate($entity, "update");
} catch (InvalidPluginDefinitionException $e) {
Drupal::messenger()
->addError("Something went wrong, please notify the Site Admin");
Drupal::logger("Rocket Chat : Base Module")
->critical($e
->getMessage());
} catch (PluginNotFoundException $e) {
Drupal::messenger()
->addError("Something went wrong, please notify the Site Admin");
Drupal::logger("Rocket Chat : Base Module")
->critical($e
->getMessage());
}
}
function rocket_chat_group_group_content_delete(Drupal\group\Entity\GroupContent $entity) {
try {
moduleHelper::ProcessGroupContentUpdate($entity, "delete");
} catch (InvalidPluginDefinitionException $e) {
Drupal::messenger()
->addError("Something went wrong, please notify the Site Admin");
Drupal::logger("Rocket Chat : Base Module")
->critical($e
->getMessage());
} catch (PluginNotFoundException $e) {
Drupal::messenger()
->addError("Something went wrong, please notify the Site Admin");
Drupal::logger("Rocket Chat : Base Module")
->critical($e
->getMessage());
}
}
function rocket_chat_group_theme($existing, $type, $theme, $path) {
return moduleHelper::themeRocketChannelBLock($existing, $type, $theme, $path);
}