You are here

function _spamicide_set_css_file in Spamicide 6

Same name and namespace in other branches
  1. 5 spamicide.module \_spamicide_set_css_file()
  2. 7 spamicide.inc \_spamicide_set_css_file()

Set the spamicide field name and .css file_name

Parameters

array $form_field:

2 calls to _spamicide_set_css_file()
spamicide_admin_adform_form_submit in ./spamicide.module
Implementation of hook_form_submit
spamicide_admin_form_submit in ./spamicide.module
Implementation of hook_form_submit

File

./spamicide.module, line 461
This module provides yet another tool to eliminate spam.

Code

function _spamicide_set_css_file($form_field) {
  $spam_path = file_directory_path() . "/spamicide";
  if (!file_check_directory($spam_path)) {
    mkdir($spam_path);
  }
  $css_file = $spam_path . '/' . $form_field . '.css';
  $path = file_create_path($css_file);
  if (!file_exists($path)) {
    $css = 'div.' . _spamicide_get_css_class($form_field) . ' { display:none; }';
    file_save_data($css, $path, FILE_EXISTS_REPLACE);
  }
}