You are here

private function CampaignMonitorListsController::listToggleEnable in Campaign Monitor 8

Same name and namespace in other branches
  1. 8.2 src/Controller/CampaignMonitorListsController.php \Drupal\campaignmonitor\Controller\CampaignMonitorListsController::listToggleEnable()
2 calls to CampaignMonitorListsController::listToggleEnable()
CampaignMonitorListsController::listDisable in src/Controller/CampaignMonitorListsController.php
CampaignMonitorListsController::listEnable in src/Controller/CampaignMonitorListsController.php

File

src/Controller/CampaignMonitorListsController.php, line 145

Class

CampaignMonitorListsController
Campaign Monitor Lists controller.

Namespace

Drupal\campaignmonitor\Controller

Code

private function listToggleEnable($list_id) {

  // Get local list information and update enabled state.
  $list_options = campaignmonitor_get_list_settings($list_id);
  $enable = 0;
  if (isset($list_options['status']['enabled'])) {
    $enable = $list_options['status']['enabled'] == 1 ? 0 : 1;
  }
  $list_options['status']['enabled'] = $enable;
  campaignmonitor_set_list_settings($list_id, $list_options);

  // Clear blocks cache.
  //    _block_rehash();
}