You are here

function textactions_text2canvas_validate in ImageCache Actions 5.2

Same name and namespace in other branches
  1. 5.3 textactions.inc \textactions_text2canvas_validate()

TODO Validation will not trigger in D6 unless imagecache.module applies a patch first.

File

./textactions.inc, line 121

Code

function textactions_text2canvas_validate($form) {
  if (!($fontfile = textactions_find_font($form['data']['fontfile']['#value'], TRUE))) {

    // Just warn, don't prevent
    drupal_set_message(t("Unable to confirm that the font %fontfile is available on your system. This may fail, or your system may provide an appropriate fallback, depending on your toolkit behaviour.", array(
      '%fontfile' => $form['data']['fontfile']['#value'],
    )), 'warning');
  }
  else {
    drupal_set_message(t("Font was found at %fontfile", array(
      '%fontfile' => $fontfile,
    )));
  }
  if (!is_numeric($form['data']['alpha']['#value']) || $form['data']['alpha']['#value'] < 1 || $form['data']['alpha']['#value'] > 100) {
    form_set_error('alpha', t('Opacity must be a number between 1 and 100.'));
  }
}