You are here

function mostpopular_mostpopular_service_presave in Drupal Most Popular 7

Before a mostpopular service is saved, update its status.

Parameters

object $service The service being saved.:

File

./mostpopular.module, line 506
The main file for the Most Popular module.

Code

function mostpopular_mostpopular_service_presave($service) {
  if ($service->enabled == 0) {
    $service->status = MOSTPOPULAR_SERVICE_STATUS_DISABLED;
  }
  elseif ($service->status == MOSTPOPULAR_SERVICE_STATUS_DISABLED) {
    $service->status = MOSTPOPULAR_SERVICE_STATUS_PENDING;
  }
}