You are here

function skinr_ui_skinsets_settings_form in Skinr 6.2

Menu callback; displays a listing of all skins in a skinsets, allowing you to enable or disable them individually for each theme.

See also

skinr_ui_skinsets_settings_form_submit()

1 string reference to 'skinr_ui_skinsets_settings_form'
skinr_ui_menu in ./skinr_ui.module
Implementation of hook_menu().

File

./skinr_ui.admin.inc, line 466
Admin page callbacks for the skinr module.

Code

function skinr_ui_skinsets_settings_form($form_state, $skinset_name) {
  $form = array(
    '#tree' => TRUE,
  );
  $skinsets = skinr_skinsets('skinset');
  if (!empty($skinsets[$skinset_name])) {
    $skinset = $skinsets[$skinset_name];
  }
  $themes = list_themes();
  ksort($themes);
  foreach ($skinset->skins as $skin_name => $skin) {
    $form[$skin_name]['info'] = array(
      '#type' => 'value',
      '#value' => $skin,
    );
    $status = array();
    $options = array();
    foreach ($themes as $theme) {
      if (!$theme->status) {
        continue;
      }
      $options[$theme->name] = '';
      if (!empty($skin['status'][$theme->name])) {
        $status[] = $theme->name;
      }
    }
    $form[$skin_name]['status'] = array(
      '#type' => 'checkboxes',
      '#options' => $options,
      '#default_value' => $status,
    );
  }
  $form['skinset'] = array(
    '#type' => 'value',
    '#value' => $skinset_name,
  );
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  $form['buttons']['reset'] = array(
    '#type' => 'submit',
    '#value' => t('Reset to defaults'),
  );
  return $form;
}