'CiviMail', 'translatedName' => ts('CiviMail'), 'title' => 'CiviCRM Mailing Engine', 'search' => 1, 'showActivitiesInCore' => 1, ); } static function workflowEnabled() { $config = CRM_Core_Config::singleton(); // early exit, since not true for most if (!$config->userSystem->is_drupal || !function_exists('module_exists') ) { return FALSE; } if (!module_exists('rules')) { return FALSE; } $enableWorkflow = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'civimail_workflow', NULL, FALSE ); return ($enableWorkflow && $config->userSystem->is_drupal ) ? TRUE : FALSE; } // docs inherited from interface public function getPermissions($getAllUnconditionally = FALSE) { $permissions = array( 'access CiviMail', 'access CiviMail subscribe/unsubscribe pages', 'delete in CiviMail', 'view public CiviMail content', ); if (self::workflowEnabled() || $getAllUnconditionally) { $permissions[] = 'create mailings'; $permissions[] = 'schedule mailings'; $permissions[] = 'approve mailings'; } return $permissions; } // docs inherited from interface public function getUserDashboardElement() { // no dashboard element for this component return NULL; } public function getUserDashboardObject() { // no dashboard element for this component return NULL; } // docs inherited from interface public function registerTab() { return array( 'title' => ts('Mailings'), 'id' => 'mailing', 'url' => 'mailing', 'weight' => 45, ); } // docs inherited from interface public function registerAdvancedSearchPane() { return array('title' => ts('Mailings'), 'weight' => 20, ); } // docs inherited from interface public function getActivityTypes() { return NULL; } // add shortcut to Create New public function creatNewShortcut(&$shortCuts) {} }