You are here

function skinr_skin_validate in Skinr 7.2

Same name and namespace in other branches
  1. 8.2 skinr.module \skinr_skin_validate()

Validate a skinr object.

Parameters

$skin: A skin object.

Return value

TRUE on success, FALSE on failure.

2 calls to skinr_skin_validate()
skinr_skin_save in ./skinr.module
Save a skin object.
skinr_ui_import_form_validate in ./skinr_ui.admin.inc
Form validation handler for skinr_ui_import_form().

File

./skinr.module, line 607
Handles core Skinr functionality.

Code

function skinr_skin_validate(&$skin) {
  if (empty($skin->theme) || empty($skin->module) || empty($skin->element) || empty($skin->skin) || empty($skin->options)) {
    return FALSE;
  }
  if (!is_array($skin->options)) {
    return FALSE;
  }

  // Strip empty skins.
  $skin->options = _skinr_array_strip_empty($skin->options);
  if (empty($skin->options)) {
    return FALSE;
  }
  return TRUE;
}