You are here

function skinr_validate in Skinr 6.2

Validate a skinr object.

Parameters

$skinr: A skinr object.

Return value

TRUE on success, FALSE on failure.

2 calls to skinr_validate()
skinr_set in ./skinr.module
Save a skinr object.
skinr_ui_import_form_validate in ./skinr_ui.admin.inc
Validation handler for Skinr settings import form.

File

./skinr.module, line 430

Code

function skinr_validate(&$skinr) {
  if (!isset($skinr->theme) || !isset($skinr->module) || !isset($skinr->sid) || !isset($skinr->skins)) {
    return FALSE;
  }
  if (!isset($skinr->settings)) {
    $skinr->settings = array();
  }
  if (!is_array($skinr->skins) || !is_array($skinr->settings)) {
    return FALSE;
  }

  // Strip empty skins.
  $skinr->skins = _skinr_array_strip_empty($skinr->skins);
  return TRUE;
}