enabled = ESI__BLOCK_CONFIG_DEFAULT__IS_ENABLED; $config->ttl = ESI__BLOCK_CONFIG_DEFAULT__TTL; } return $config; } /** * Get a list of possible ttl choices. */ function _esi__ttl_options($current_ttl) { $options = array( '5' => t('@count seconds', array('@count' => 5)), '30' => t('@count seconds', array('@count' => 30)), '60' => t('1 minute'), '300' => t('@count minutes', array('@count' => 5)), '1800' => t('@count minutes', array('@count' => 30)), '3600' => t('1 hour'), '10800' => t('@count hours', array('@count' => 3)), '21600' => t('@count hours', array('@count' => 6)), '43200' => t('@count hours', array('@count' => 12)), '86400' => t('1 day'), ); // if the given ttl isn't one of our options, add the current ttl as a custom option. if(!array_key_exists($current_ttl, $options)) { $options[$current_ttl] = format_plural($current_ttl, 'Custom: @count second', 'Custom: @count seconds'); } return $options; }